Permalink
Browse files

fixed a bug where callables which require zero arguments can be used …

…on models - it is possible that it should be ' == 0' since I'm pretty sure the ONE argument is supposed to be 'self' which is apparently not counted. (or maybe this is a python 2.6 issue)
  • Loading branch information...
jiaaro
jiaaro committed May 25, 2010
1 parent 4b56dc3 commit 693b6fe4e906fa6ec665e76668b6a9687fa396ee
Showing with 1 addition and 1 deletion.
  1. +1 −1 piston/emitters.py
View
@@ -230,7 +230,7 @@ def _model(data, fields=()):
maybe = getattr(data, maybe_field, None)
if maybe:
if callable(maybe):
- if len(inspect.getargspec(maybe)[0]) == 1:
+ if len(inspect.getargspec(maybe)[0]) <= 1:
ret[maybe_field] = _any(maybe())
else:
ret[maybe_field] = _any(maybe)

0 comments on commit 693b6fe

Please sign in to comment.