issue 674, allows methods as represent function, thanks Carlos
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 1.99.4 (2012-02-26 15:34:08) stable
|
Version 1.99.4 (2012-02-26 15:36:09) stable
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ def represent(field,value,record):
|
|||||||
if not callable(f):
|
if not callable(f):
|
||||||
return str(value)
|
return str(value)
|
||||||
n = f.func_code.co_argcount-len(f.func_defaults or [])
|
n = f.func_code.co_argcount-len(f.func_defaults or [])
|
||||||
|
if getattr(f, 'im_self', None): n -= 1
|
||||||
if n==1:
|
if n==1:
|
||||||
return f(value)
|
return f(value)
|
||||||
elif n==2:
|
elif n==2:
|
||||||
|
|||||||
Reference in New Issue
Block a user