jiaaro  committed e85842d

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)

  • Participants
  • Parent commits 72a636f
  • Branches default

Comments (0)

Files changed (1)

File piston/

                         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())
                                 ret[maybe_field] = _any(maybe)