#15953: Allow setting individual fields as 'unique' from the model Meta options
-------------------------------------+-------------------------------------
               Reporter:  julien     |          Owner:  nobody
                   Type:  New        |         Status:  closed
  feature                            |      Component:  Database layer
              Milestone:             |  (models, ORM)
                Version:  1.3        |       Severity:  Normal
             Resolution:  wontfix    |       Keywords:
           Triage Stage:  Design     |      Has patch:  0
  decision needed                    |    Needs tests:  0
    Needs documentation:  0          |  Easy pickings:  0
Patch needs improvement:  0          |
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
Changes (by mtredinnick):

 * status:  new => closed
 * ui_ux:   => 0
 * resolution:   => wontfix


Comment:

 I'm with Alex for most of the same reasons. Retrofitting the database
 level behaviour of a parent class feels a bit fragile. Model inheritance
 differs from Python class inheritance in a few ways and overriding is one
 of them. A field validator is probably one solution here.

 The reuse argument doesn't convince me a lot, either. If the field is
 genuinely intended to be reused as unique, it should be marked as such.
 It's not really subclassing when it's both unique and non-unique in
 different situations -- it's attempting to reuse something of the same
 name in different context, not using "is-a" relationships.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/15953#comment:10>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to