grid: custom representation of None value, in view
This commit is contained in:
1 parent
0c52f2a561
commit
876508a227
1 file changed
+4
@@ -2318,6 +2318,10 @@ class SQLFORM(FORM):
|
|||||||
elif details and request.args(-3) == 'view':
|
elif details and request.args(-3) == 'view':
|
||||||
table = db[request.args[-2]]
|
table = db[request.args[-2]]
|
||||||
record = table(request.args[-1]) or redirect(referrer)
|
record = table(request.args[-1]) or redirect(referrer)
|
||||||
|
if represent_none is not None:
|
||||||
|
for field in record.iterkeys():
|
||||||
|
if record[field] is None:
|
||||||
|
record[field] = represent_none
|
||||||
sqlformargs = dict(upload=upload, ignore_rw=ignore_rw,
|
sqlformargs = dict(upload=upload, ignore_rw=ignore_rw,
|
||||||
formstyle=formstyle, readonly=True,
|
formstyle=formstyle, readonly=True,
|
||||||
_class='web2py_form')
|
_class='web2py_form')
|
||||||
|
|||||||
Reference in new issue
Block a user