diff options
| author | Carles Barrobés | 2011-07-30 22:23:53 +0200 |
|---|---|---|
| committer | Carles Barrobés | 2011-07-30 22:23:53 +0200 |
| commit | 3b413dbb40128fb3e3b62a5359b2bd2968d626d8 (patch) | |
| tree | 437d0a58ede41c649a1a926e1c4a3ca71048707f /djangorestframework/mixins.py | |
| parent | 53fcf290811f062c54939f40db1cd7c06544f002 (diff) | |
| download | django-rest-framework-3b413dbb40128fb3e3b62a5359b2bd2968d626d8.tar.bz2 | |
Added support for OPTIONS method, including a few unit tests
Diffstat (limited to 'djangorestframework/mixins.py')
| -rw-r--r-- | djangorestframework/mixins.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/djangorestframework/mixins.py b/djangorestframework/mixins.py index bb26ad96..a34b9230 100644 --- a/djangorestframework/mixins.py +++ b/djangorestframework/mixins.py @@ -452,7 +452,10 @@ class ResourceMixin(object): return self._resource.filter_response(obj) def get_bound_form(self, content=None, method=None): - return self._resource.get_bound_form(content, method=method) + if hasattr(self._resource, 'get_bound_form'): + return self._resource.get_bound_form(content, method=method) + else: + return None @@ -566,7 +569,7 @@ class UpdateModelMixin(object): # TODO: update on the url of a non-existing resource url doesn't work correctly at the moment - will end up with a new url try: if args: - # If we have any none kwargs then assume the last represents the primrary key + # If we have any none kwargs then assume the last represents the primary key self.model_instance = model.objects.get(pk=args[-1], **kwargs) else: # Otherwise assume the kwargs uniquely identify the model |
