Ticket #10244: filefield_null.diff

File filefield_null.diff, 793 bytes (added by oyvind, 16 years ago)

Patch that solves this issue, FieldFile's name can now be None also "is" and "==" is not the same

  • django/db/models/fields/files.py

     
    2020        self.instance = instance
    2121        self.field = field
    2222        self.storage = field.storage
    23         self._name = name or u''
     23        self._name = name
    2424        self._closed = False
    2525        self._committed = True
    2626
     
    175175    def get_db_prep_value(self, value):
    176176        "Returns field's value prepared for saving into a database."
    177177        # Need to convert File objects provided via a form to unicode for database insertion
    178         if value is None:
     178        if value == None:
    179179            return None
    180180        return unicode(value)
    181181
Back to Top