Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tev
plugin_event
Commits
c73e61ae
Commit
c73e61ae
authored
Mar 02, 2017
by
LE GAC Renaud
Browse files
Modify the database schema to add lists2.summary_group and summary_all.
parent
eeccbae2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
17 deletions
+42
-17
docs/db_schema/database.png
docs/db_schema/database.png
+0
-0
docs/db_schema/database.xml
docs/db_schema/database.xml
+5
-2
modules/plugin_event/model_report.py
modules/plugin_event/model_report.py
+9
-4
modules/plugin_event/report_tools.py
modules/plugin_event/report_tools.py
+16
-3
modules/plugin_event/ui_report.py
modules/plugin_event/ui_report.py
+12
-8
No files found.
docs/db_schema/database.png
View replaced file @
eeccbae2
View file @
c73e61ae
178 KB
|
W:
|
H:
180 KB
|
W:
|
H:
2-up
Swipe
Onion skin
docs/db_schema/database.xml
View file @
c73e61ae
...
...
@@ -377,8 +377,11 @@
<row
name=
"columns"
null=
"0"
autoincrement=
"0"
>
<datatype>
text
</datatype>
</row>
<row
name=
"features"
null=
"1"
autoincrement=
"0"
>
<datatype>
text
</datatype>
<row
name=
"summary_group"
null=
"0"
autoincrement=
"0"
>
<datatype>
boolean
</datatype>
<default>
NULL
</default></row>
<row
name=
"summary_all"
null=
"0"
autoincrement=
"0"
>
<datatype>
boolean
</datatype>
<default>
NULL
</default></row>
<key
type=
"PRIMARY"
name=
""
>
<part>
id
</part>
...
...
modules/plugin_event/model_report.py
View file @
c73e61ae
...
...
@@ -215,10 +215,15 @@ class Report(object):
notnull
=
migrate
,
comment
=
T
(
TP_COLUMNS
)),
Field
(
"features"
,
"text"
,
default
=
def_features
,
comment
=
T
(
TP_FEATURES
)),
Field
(
"summary_group"
,
"boolean"
,
default
=
True
,
label
=
T
(
"Summary row per group"
)),
Field
(
"summary_all"
,
"boolean"
,
default
=
True
,
label
=
T
(
"Summary row"
)),
migrate
=
"lists2.table"
)
...
...
modules/plugin_event/report_tools.py
View file @
c73e61ae
...
...
@@ -16,9 +16,15 @@ FIELD_TYPES = {"gridcolumn": "string",
"datecolumn"
:
"date"
,
"numbercolumn"
:
"float"
}
GROUPING_SUMMARY
=
{
"ftype"
:
"groupingsummary"
,
"groupHeaderTpl"
:
"{name}"
,
"startCollapsed"
:
False
}
MSG_NO_DATAINDEX
=
"The property dataIndex is missing."
MSG_NO_XTYPE
=
"The property xtype is missing."
SUMMARY
=
{
"ftype"
:
"summary"
}
class
ReportException
(
BaseException
):
pass
...
...
@@ -152,9 +158,16 @@ class List2(object):
#
self
.
grid
=
Storage
(
columns
=
grid_columns
,
features
=
[])
features
=
config
.
features
if
features
not
in
(
None
,
''
):
self
.
grid
.
features
=
json
.
loads
(
features
)
if
config
.
summary_group
or
config
.
summary_all
:
features
=
[]
if
config
.
summary_group
:
features
.
append
(
GROUPING_SUMMARY
)
if
config
.
summary_all
:
features
.
append
(
SUMMARY
)
self
.
grid
.
features
=
features
def
_add_store_fields
(
self
,
column
):
...
...
modules/plugin_event/ui_report.py
View file @
c73e61ae
...
...
@@ -232,12 +232,6 @@ class ReportUi(object):
height
=
120
,
hideLabel
=
True
)
mdf
.
configure_field
(
"features"
,
editorHeight
=
240
,
hideLabel
=
True
,
language
=
"json"
,
xtype
=
"xaceeditorfield"
)
mdf
.
configure_field
(
"id_events"
,
emptyText
=
" "
)
mdf
.
configure_field
(
"query"
,
...
...
@@ -250,6 +244,14 @@ class ReportUi(object):
hideHeader
=
True
,
minimumRows
=
10
)
mdf
.
configure_field
(
"summary_group"
,
labelAlign
=
"right"
,
labelWidth
=
170
)
mdf
.
configure_field
(
"summary_all"
,
labelAlign
=
"right"
,
labelWidth
=
170
)
#.....................................................................
#
# Form
...
...
@@ -274,7 +276,8 @@ class ReportUi(object):
mdf
.
merge_fields
(
"columns"
,
title
=
T
(
"Columns"
))
mdf
.
merge_fields
(
"features"
,
mdf
.
merge_fields
(
"summary_group"
,
"summary_all"
,
title
=
T
(
"Summary"
))
mdf
.
set_mapper
(
dbui
.
map_tabpanel
)
...
...
@@ -289,13 +292,14 @@ class ReportUi(object):
mdf
.
hide_columns
(
"columns"
,
"conditions"
,
"eval"
,
"features"
,
"group_field"
,
"id_events"
,
"kwargs"
,
"query"
,
"sorters"
,
"source"
,
"summary_group"
,
"summary_all"
,
"title"
)
#.....................................................................
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment