Ticket #5574: base_serializer.diff
File base_serializer.diff, 632 bytes (added by , 17 years ago) |
---|
-
django/core/serializers/base.py
56 56 """ 57 57 if isinstance(field, models.DateTimeField): 58 58 value = getattr(obj, field.name).strftime("%Y-%m-%d %H:%M:%S") 59 elif isinstance(field, models.FileField):60 value = getattr(obj, "get_%s_url" % field.name, lambda: None)()61 59 else: 62 60 value = field.flatten_data(follow=None, obj=obj).get(field.name, "") 63 61 return smart_unicode(value)