Ticket #16022: fieldfile-weakref.patch
File fieldfile-weakref.patch, 675 bytes (added by , 14 years ago) |
---|
-
django/db/models/fields/files.py
1 1 import datetime 2 2 import os 3 import weakref 3 4 4 5 from django.conf import settings 5 6 from django.db.models.fields import Field … … 17 18 class FieldFile(File): 18 19 def __init__(self, instance, field, name): 19 20 super(FieldFile, self).__init__(None, name) 20 self.instance = instance21 self.instance = weakref.ref(instance) 21 22 self.field = field 22 23 self.storage = field.storage 23 24 self._committed = True