#34013: order_by() crashes with annotated JSONObject fields.
-------------------------------------+-------------------------------------
     Reporter:  Eugene Morozov       |                    Owner:  Aman
                                     |  Pandey
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  orm, json, ordering  |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by saadullahaleem):

 Is this issue still valid? I'm trying to find a good first issue to create
 a PR for and did some digging here.

 It looks like a `model` is attached to a `Field` object using the
 `contribute_to_class` method.

 It seems that the `contribute_to_class` method is called when fields are
 added to the model class during its creation or when fields are added
 dynamically. In this case, we're not adding or modifying fields in the
 model class; we're only working with the queryset and computing new values
 based on existing fields. The queryset annotations do not modify the model
 class itself, so `contribute_to_class` is not called in this context.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34013#comment:8>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187d1ac0dba-01e00b99-bc3f-4cf7-a748-cb30fcb4819b-000000%40eu-central-1.amazonses.com.

Reply via email to