From 6459b929f5b3ed565b50799686731d67e74292b3 Mon Sep 17 00:00:00 2001 From: Lars Wiegman Date: Sat, 14 Jan 2012 15:04:08 +0100 Subject: [PATCH] Improved comments to better explain the need for auto-completion --- djangorestframework/resources.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/djangorestframework/resources.py b/djangorestframework/resources.py index 9a8e02186..8900d3936 100644 --- a/djangorestframework/resources.py +++ b/djangorestframework/resources.py @@ -104,10 +104,11 @@ class FormResource(Resource): to be populated when an empty dict is supplied in `data` """ - # Autocompleet fields if they have a default value set in the model. - # Otherwise, what's the point of having a default value in the model if - # they aren't used during form validation. - # A better place for this would be in Django forms or db module. + # Auto-complete fields with the default value on a POST request. + # + # While Django web forms have auto-populate, POST requests in REST + # should have auto-complete. Otherwise, what's the point + # of having a default value. method = self.view._method if hasattr(self.view, '_method') else None if 'POST' == method and hasattr(self.model, '_meta'): data_mutable = data.copy()