#27188: FileField cannot be used with unique=True
--------------------------------------+--------------------
     Reporter:  jribbens              |      Owner:  nobody
         Type:  Bug                   |     Status:  new
    Component:  File uploads/storage  |    Version:  1.10
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  1                     |      UI/UX:  0
--------------------------------------+--------------------
 In #4345 , code was added which explicitly prevents the use of
 `unique=True` on `FileField` fields. This seems bizarre and wrong, since
 making unique FileFields not only makes sense, it would be rare for
 ''not'' making them unique to make sense - after all, you can't have two
 different files with the same filename! Not allowing `unique=True` leads
 to impaired data integrity as the database can't therefore enforce the
 necessary uniqueness of filenames. (Looking at the previous ticket, it
 appears people were confused that it would be the file contents that was
 supposed to be unique, not the filenames.)

--
Ticket URL: <https://code.djangoproject.com/ticket/27188>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.d10a3c2eb910031f8349d31a81b5d75b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to