[gen] pod fields now read pod templates directly from disk. Fields 'template' and 'formats' that were generated into the database (and editable through-the-web) are now removed. This simplification will allow in a second step to define several templates for a unique pod field, ie: multiDoc = Pod(template='od/Item*.odt'). [gen] Additionally, fields tool.numberOfSearchColumnsForXXX and tool.searchFieldsForXXX are not generated anymore and are replace by static class attributes class.numberOfSearchColumns and class.searchFields.
This commit is contained in:
parent
c5930edd2d
commit
e1b83574c5
8 changed files with 50 additions and 255 deletions
24
gen/model.py
24
gen/model.py
|
@ -214,13 +214,12 @@ setattr(Page, Page.pages.back.attribute, Page.pages.back)
|
|||
|
||||
# The Tool class ---------------------------------------------------------------
|
||||
# Prefixes of the fields generated on the Tool.
|
||||
toolFieldPrefixes = ('podTemplate', 'formats', 'numberOfSearchColumns',
|
||||
'searchFields')
|
||||
defaultToolFields = ('title', 'mailHost', 'mailEnabled', 'mailFrom',
|
||||
'appyVersion', 'dateFormat', 'hourFormat', 'users',
|
||||
'connectedUsers', 'groups', 'translations',
|
||||
'loadTranslationsAtStartup', 'pages', 'unoEnabledPython',
|
||||
'openOfficePort', 'numberOfResultsPerPage')
|
||||
'appyVersion', 'dateFormat', 'hourFormat',
|
||||
'unoEnabledPython', 'openOfficePort',
|
||||
'numberOfResultsPerPage', 'users', 'connectedUsers',
|
||||
'groups', 'translations', 'loadTranslationsAtStartup',
|
||||
'pages')
|
||||
|
||||
class Tool(ModelClass):
|
||||
# In a ModelClass we need to declare attributes in the following list.
|
||||
|
@ -239,6 +238,9 @@ class Tool(ModelClass):
|
|||
appyVersion = gen.String(**lf)
|
||||
dateFormat = gen.String(default='%d/%m/%Y', **lf)
|
||||
hourFormat = gen.String(default='%H:%M', **lf)
|
||||
unoEnabledPython = gen.String(default='/usr/bin/python', **lf)
|
||||
openOfficePort = gen.Integer(default=2002, **lf)
|
||||
numberOfResultsPerPage = gen.Integer(default=30, **lf)
|
||||
|
||||
# Ref(User) will maybe be transformed into Ref(CustomUserClass).
|
||||
userPage = gen.Page('users', show=isManager)
|
||||
|
@ -265,16 +267,6 @@ class Tool(ModelClass):
|
|||
show='view', back=gen.Ref(attribute='toTool3', show=False),
|
||||
page=gen.Page('pages', show=isManager))
|
||||
|
||||
# Document generation page
|
||||
dgp = {'page': gen.Page('documents', show=isManagerEdit)}
|
||||
def validPythonWithUno(self, value): pass # Real method in the wrapper
|
||||
unoEnabledPython = gen.String(default='/usr/bin/python', show=False,
|
||||
validator=validPythonWithUno, **dgp)
|
||||
openOfficePort = gen.Integer(default=2002, show=False, **dgp)
|
||||
# User interface page
|
||||
numberOfResultsPerPage = gen.Integer(default=30,
|
||||
page=gen.Page('userInterface', show=False))
|
||||
|
||||
@classmethod
|
||||
def _appy_clean(klass):
|
||||
toClean = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue