#21436: 1.5.1 returns "object has no attribute '_known_related_objects'" when
using
the bitwise or operator with objects.get()
-------------------------------------+-------------------------------------
Reporter: mamalos | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 1.5
(models, ORM) | Resolution: invalid
Severity: Normal | Triage Stage:
Keywords: bitwise or, model, | Unreviewed
get, filter | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by akaariai):
* status: new => closed
* resolution: => invalid
Comment:
The .get() method returns an instance, but queryset combining with | or &
works only for querysets. So, use .filter(id=x.id) instead of .get().
--
Ticket URL: <https://code.djangoproject.com/ticket/21436#comment:2>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.e357d502ceaba79f33df9bb536536f91%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.