mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 01:57:00 +03:00
updated comparison due to pep8 programming recommendations
http://www.python.org/dev/peps/pep-0008/#programming-recommendations
This commit is contained in:
parent
196fa5e94f
commit
9459289d7d
|
@ -34,7 +34,7 @@ Declaring a serializer looks very similar to declaring a form:
|
|||
created = serializers.DateTimeField()
|
||||
|
||||
def restore_object(self, attrs, instance=None):
|
||||
if instance:
|
||||
if instance is not None:
|
||||
instance.title = attrs['title']
|
||||
instance.content = attrs['content']
|
||||
instance.created = attrs['created']
|
||||
|
|
Loading…
Reference in New Issue
Block a user