experimental fix for represent
This commit is contained in:
+1
-1
Submodule gluon/packages/dal updated: 9272062bf1...5d53574761
+6
-3
@@ -58,9 +58,12 @@ def represent(field, value, record):
|
||||
f = field.represent
|
||||
if not callable(f):
|
||||
return str(value)
|
||||
n = f.func_code.co_argcount - len(f.func_defaults or [])
|
||||
if getattr(f, 'im_self', None):
|
||||
n -= 1
|
||||
if hasattr(f,'func_code'):
|
||||
n = f.func_code.co_argcount - len(f.func_defaults or [])
|
||||
if getattr(f, 'im_self', None):
|
||||
n -= 1
|
||||
else:
|
||||
n = 1
|
||||
if n == 1:
|
||||
return f(value)
|
||||
elif n == 2:
|
||||
|
||||
Reference in New Issue
Block a user