#34354: models. Manager annotate() queryset conflict with models.Model
-------------------------------+--------------------------------------
     Reporter:  David Pratten  |                    Owner:  nobody
         Type:  New feature    |                   Status:  closed
    Component:  contrib.admin  |                  Version:  4.1
     Severity:  Normal         |               Resolution:  duplicate
     Keywords:  Possible       |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * type:  Bug => New feature
 * resolution:   => duplicate


Comment:

 You cannot add a field based on an annotation to the model as
 `models.IntegerField()`. As far using annotations in `list_display` there
 are open tickets for that so marking as a duplicate, see #14336 and
 #27229.

 > What is the correct way to add a computed field to a model in Admin
 land?

 The answer is in the error message: ''"which is not a **callable**, an
 **attribute of 'MyPapersAdmin'**, or an **attribute or method on
 'literature.MyPapers'**."''

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34354#comment:1>
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/010701866d16f281-dac69613-0bf2-4151-85d4-46e2e8919a81-000000%40eu-central-1.amazonses.com.

Reply via email to