#37004: BaseModelFormSet could leverage totally_ordered property
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                    Owner:  Sarah
         Type:                       |  Boyce
  Cleanup/optimization               |                   Status:  assigned
    Component:  Forms                |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):

 Go for it Rodrigo!

 We'll likely want to ''augment'' the ordering with `pk` here and not
 entirely replace it
 
([https://github.com/django/django/blob/edd899786851f6285abbc3c272f4f5ec0e48a74c/django/core/serializers/python.py#L82-L87
 just like serializers do]) otherwise it might break the natural ordering
 expected by users (e.g inlines ordered by name or publish date) so the
 proposed patch will need a bit of tweaking.

 `order_by` also accepts `"pk"` so we can avoid model introspection here;
 `self.model._meta.pk.name` -> `"pk"`.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/37004#comment:3>
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 visit 
https://groups.google.com/d/msgid/django-updates/0107019d3c613d8c-65f4278d-94c9-4bef-b19f-1930984fda8c-000000%40eu-central-1.amazonses.com.

Reply via email to