Commit 9e9ae609 by Tom Christie

forms/models can be set on the view as well as the resource

parent cefc6a25
......@@ -410,9 +410,9 @@ class ResourceMixin(object):
def _resource(self):
if self.resource:
return self.resource(self)
elif hasattr(self, 'model'):
elif getattr(self, 'model', None):
return ModelResource(self)
elif hasattr(self, 'form'):
elif getattr(self, 'form', None):
return FormResource(self)
return Resource(self)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment