Changes between Initial Version and Version 1 of Ticket #33682, comment 5


Ignore:
Timestamp:
05/09/22 17:34:13 (7 months ago)
Author:
Robert Leach
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33682, comment 5

    initial v1  
    2727- `order_by`: `name`
    2828
     29So it's essentially resolved as:
     30
     31{{{
     32list(TestSynonym.objects.distinct('compound_id').order_by('compound__name'))
     33}}}
     34
    2935When those methods are assessed individually, I understand why those fields are the preferred solution (e.g. the meta ordering may not be unique), but given that `distinct` requires the same fields be present at the beginning of the order-by, I don't know what prevents the code to be written to have those fields be resolved in a way that is copacetic.  Like, why not convert the reference into 2 additional fields that together, meet both requirements (`name` AND `compound_id`)?  Order-by would be satisfied and distinct would be satisfied.  Or... in my case, `name` is unique, so distinct could resolve to the meta ordering without issue...
    3036
Back to Top