Re: [Django] #34458: QuerySet.defer('user_id') raises AttributeError: 'ForeignKey' object has no attribute 'field'

0 views
Skip to first unread message

Django

unread,
Apr 4, 2023, 1:34:07 PM4/4/23
to django-...@googlegroups.com
#34458: QuerySet.defer('user_id') raises AttributeError: 'ForeignKey' object has no
attribute 'field'
-------------------------------------+-------------------------------------
Reporter: Andrew Cordery | Owner: Simon
| Charette
Type: Bug | Status: assigned
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* owner: nobody => Simon Charette
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/34458#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 4, 2023, 5:01:25 PM4/4/23
to django-...@googlegroups.com
#34458: QuerySet.defer('user_id') raises AttributeError: 'ForeignKey' object has no
attribute 'field'
-------------------------------------+-------------------------------------
Reporter: Andrew Cordery | Owner: Simon
| Charette
Type: Bug | Status: assigned
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/34458#comment:4>

Django

unread,
Apr 4, 2023, 11:40:37 PM4/4/23
to django-...@googlegroups.com
#34458: QuerySet.defer('user_id') raises AttributeError: 'ForeignKey' object has no
attribute 'field'
-------------------------------------+-------------------------------------
Reporter: Andrew Cordery | Owner: Simon
| Charette
Type: Bug | Status: assigned
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34458#comment:5>

Django

unread,
Apr 5, 2023, 12:05:59 AM4/5/23
to django-...@googlegroups.com
#34458: QuerySet.defer('user_id') raises AttributeError: 'ForeignKey' object has no
attribute 'field'
-------------------------------------+-------------------------------------
Reporter: Andrew Cordery | Owner: Simon
| Charette
Type: Bug | Status: closed

Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"87c63bd8df0eb0109df333df1264c6a96707d6a4" 87c63bd]:
{{{
#!CommitTicketReference repository=""
revision="87c63bd8df0eb0109df333df1264c6a96707d6a4"
Fixed #34458 -- Fixed QuerySet.defer() crash on attribute names.

Thanks Andrew Cordery for the report.

Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34458#comment:6>

Django

unread,
Apr 5, 2023, 12:07:03 AM4/5/23
to django-...@googlegroups.com
#34458: QuerySet.defer('user_id') raises AttributeError: 'ForeignKey' object has no
attribute 'field'
-------------------------------------+-------------------------------------
Reporter: Andrew Cordery | Owner: Simon
| Charette
Type: Bug | Status: closed
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"647920b76694526c6be0375ff22e4d6ee43c9580" 647920b]:
{{{
#!CommitTicketReference repository=""
revision="647920b76694526c6be0375ff22e4d6ee43c9580"
[4.2.x] Fixed #34458 -- Fixed QuerySet.defer() crash on attribute names.

Thanks Andrew Cordery for the report.

Regression in b3db6c8dcb5145f7d45eff517bcd96460475c879.

Backport of 87c63bd8df0eb0109df333df1264c6a96707d6a4 from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34458#comment:7>

Reply all
Reply to author
Forward
0 new messages