Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
139
Merge Requests
139
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
90651e2d
Commit
90651e2d
authored
Aug 29, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Sep 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ERP5Form] Field.render passes extra arguments so user-defined fields can have richer rendering
parent
28934d42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
product/Formulator/Field.py
product/Formulator/Field.py
+5
-4
No files found.
product/Formulator/Field.py
View file @
90651e2d
...
...
@@ -194,7 +194,7 @@ class Field:
return
"Unknown error: %s"
%
name
security
.
declarePrivate
(
'_render_helper'
)
def
_render_helper
(
self
,
key
,
value
,
REQUEST
,
render_prefix
=
None
,
editable
=
None
):
def
_render_helper
(
self
,
key
,
value
,
REQUEST
,
render_prefix
=
None
,
editable
=
None
,
**
kw
):
value
=
self
.
_get_default
(
key
,
value
,
REQUEST
)
__traceback_info__
=
(
'key=%s value=%r'
%
(
key
,
value
))
if
self
.
get_value
(
'hidden'
,
REQUEST
=
REQUEST
):
...
...
@@ -204,10 +204,10 @@ class Field:
editable
=
self
.
get_value
(
'editable'
,
REQUEST
=
REQUEST
)
if
not
editable
:
return
self
.
widget
.
render_view
(
self
,
value
,
REQUEST
=
REQUEST
,
render_prefix
=
render_prefix
)
render_prefix
=
render_prefix
,
**
kw
)
else
:
return
self
.
widget
.
render
(
self
,
key
,
value
,
REQUEST
,
render_prefix
=
render_prefix
)
render_prefix
=
render_prefix
,
**
kw
)
security
.
declarePrivate
(
'_render_odt_helper'
)
def
_render_odt_helper
(
self
,
key
,
value
,
as_string
,
ooo_builder
,
...
...
@@ -261,7 +261,7 @@ class Field:
return
REQUEST
.
form
[
key
]
security
.
declareProtected
(
'View'
,
'render'
)
def
render
(
self
,
value
=
None
,
REQUEST
=
None
,
key
=
None
,
render_prefix
=
None
,
key_prefix
=
None
,
editable
=
None
):
def
render
(
self
,
value
=
None
,
REQUEST
=
None
,
key
=
None
,
render_prefix
=
None
,
key_prefix
=
None
,
editable
=
None
,
**
kw
):
"""Render the field widget.
value -- the value the field should have (for instance
from validation).
...
...
@@ -279,6 +279,7 @@ class Field:
REQUEST
,
render_prefix
=
render_prefix
,
editable
=
editable
,
**
kw
)
security
.
declareProtected
(
'View'
,
'render_view'
)
...
...
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