Re: [Django] #13137: GenericForeignKey does not allow content type PK 0

8 views
Skip to first unread message

Django

unread,
Nov 6, 2012, 5:18:27 PM11/6/12
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: assigned
Component: | Version: master
contrib.contenttypes | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: contenttype | Needs documentation: 0
genericforeignkey | Patch needs improvement: 1
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by woodlee):

* owner: nobody => woodlee
* status: new => assigned


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

Django

unread,
Nov 6, 2012, 5:33:13 PM11/6/12
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: assigned
Component: | Version: master
contrib.contenttypes | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: contenttype | Needs documentation: 0
genericforeignkey | Patch needs improvement: 1
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by woodlee):

Fixing in
https://github.com/mapmyfitness/django/commit/9d17d485bd661e77de587e70b231b846dc40d721

--
Ticket URL: <https://code.djangoproject.com/ticket/13137#comment:10>

Django

unread,
Nov 6, 2012, 5:33:56 PM11/6/12
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: assigned
Component: | Version: master
contrib.contenttypes | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: contenttype | Needs documentation: 0
genericforeignkey | Patch needs improvement: 0

Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by woodlee):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/13137#comment:11>

Django

unread,
Nov 6, 2012, 5:38:35 PM11/6/12
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: assigned
Component: | Version: master
contrib.contenttypes | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: contenttype | Needs documentation: 0
genericforeignkey | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by woodlee):

All contenttypes.ContentTypesTests pass under sqlite.

--
Ticket URL: <https://code.djangoproject.com/ticket/13137#comment:12>

Django

unread,
Feb 1, 2013, 9:15:46 PM2/1/13
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: assigned
Component: | Version: master
contrib.contenttypes | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: contenttype | Needs documentation: 0
genericforeignkey | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by ramiro):

See also #13085.

--
Ticket URL: <https://code.djangoproject.com/ticket/13137#comment:13>

Django

unread,
Feb 7, 2013, 2:22:25 PM2/7/13
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: assigned
Component: | Version: master
contrib.contenttypes | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: contenttype | Needs documentation: 0
genericforeignkey | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by ramiro):

I'd say close this ticket as ''wontfix'' because ContentType is an
'internal' model over which the user has no control so its IntegerField id
PK follows the usual semantics of a Django model regarding it having a
value of 0 meaning the model has no corresponding DB record.
So the only scenario in which CT could have a 0 PK is an edge-case one and
IMHO it's not worth to special-case PK semantics of CT for it.

--
Ticket URL: <https://code.djangoproject.com/ticket/13137#comment:14>

Django

unread,
Feb 7, 2013, 2:22:36 PM2/7/13
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: assigned
Component: | Version: master
contrib.contenttypes | Resolution:
Severity: Normal | Triage Stage: Design
Keywords: contenttype | decision needed
genericforeignkey | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by anonymous):

* stage: Accepted => Design decision needed


--
Ticket URL: <https://code.djangoproject.com/ticket/13137#comment:15>

Django

unread,
Feb 7, 2013, 2:43:46 PM2/7/13
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: assigned
Component: | Version: master
contrib.contenttypes | Resolution:
Severity: Normal | Triage Stage: Design
Keywords: contenttype | decision needed
genericforeignkey | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by ramiro):

The one that changed triage state to DDN was me. Sorry

--
Ticket URL: <https://code.djangoproject.com/ticket/13137#comment:16>

Django

unread,
Mar 20, 2013, 4:44:49 AM3/20/13
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: assigned
Component: | Version: master
contrib.contenttypes | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: contenttype | Needs documentation: 0
genericforeignkey | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

* stage: Design decision needed => Accepted


Comment:

I'm in favor of strict checking against `None` when determining is
something is "missing" (which is the case here).

--
Ticket URL: <https://code.djangoproject.com/ticket/13137#comment:17>

Django

unread,
Mar 20, 2013, 4:50:54 AM3/20/13
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: assigned
Component: | Version: master
contrib.contenttypes | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: contenttype | Needs documentation: 0
genericforeignkey | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by aaugustin):

Similar cleanup already happened in this file:
https://github.com/django/django/commit/04d9730b127c689b8eda01cbc913efa6e2eb230b#L0L55

The patch fixes the two last instances of `if foo:`.

--
Ticket URL: <https://code.djangoproject.com/ticket/13137#comment:18>

Django

unread,
May 31, 2013, 3:17:37 PM5/31/13
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: assigned
Component: | Version: master
contrib.contenttypes | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: contenttype | Needs documentation: 0
genericforeignkey | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by timo):

https://github.com/django/django/pull/505

--
Ticket URL: <https://code.djangoproject.com/ticket/13137#comment:19>

Django

unread,
Jul 12, 2013, 1:37:26 PM7/12/13
to django-...@googlegroups.com
#13137: GenericForeignKey does not allow content type PK 0
-------------------------------------+-------------------------------------
Reporter: devesine | Owner: woodlee
Type: Bug | Status: closed
Component: | Version: master
contrib.contenttypes | Resolution: fixed

Severity: Normal | Triage Stage: Accepted
Keywords: contenttype | Needs documentation: 0
genericforeignkey | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

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


Comment:

Fixed in [6bdc47f75ca].

--
Ticket URL: <https://code.djangoproject.com/ticket/13137#comment:20>

Reply all
Reply to author
Forward
0 new messages