#30947: Apply data structure best practices to the django.contrib models and 
docs
-------------------------------------+-------------------------------------
     Reporter:  Jon Dufresne         |                    Owner:  Ojas
         Type:                       |  Gupta
  Cleanup/optimization               |                   Status:  assigned
    Component:  Documentation        |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Alex Morega):

 > Some of the examples you pointed should remain tuples as they are mixing
 heterogenous data and mostly used to a define a schema over data.

 Right! I meant it as a starting point of places that might need fixing.

 > Since we're on the topic of data structure best practices
 `unique_together` and friends should likely be defined as `set` and not
 `list` as only unique entries will be considered and because the order in
 which they are defined on the model doesn't have any significance.

 I see your point, but AFAIU, a side effect of `unique_together` is
 creating composite database indexes, where the
 [https://www.postgresql.org/docs/current/indexes-multicolumn.html order of
 columns matters].

 There hasn't been any activity on the ticket for 3 weeks; may I take
 ownership?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30947#comment:19>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070182c4788a5e-e3d37947-771d-4a87-8603-d08363fb56e6-000000%40eu-central-1.amazonses.com.

Reply via email to