Opened 16 years ago
Closed 12 years ago
#8565 closed Cleanup/optimization (wontfix)
Comments should use object_id instead of object_pk
Reported by: | Peter Baumgartner | Owned by: | nobody |
---|---|---|---|
Component: | contrib.comments | Version: | dev |
Severity: | Normal | Keywords: | comments generic object_pk object_id |
Cc: | pete@… | Triage Stage: | Someday/Maybe |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
django.contrib.comments.models.BaseCommentAbstractModel
uses object_pk
to create a generic relation
I may be missing something, but straying from the expected and documented default of object_id
seems to only create extra confusion. I noticed this when trying to add a GenericTabularInline
Change History (6)
comment:1 by , 16 years ago
comment:3 by , 13 years ago
Easy pickings: | unset |
---|---|
Resolution: | duplicate |
Severity: | → Normal |
Status: | closed → reopened |
Type: | → Uncategorized |
UI/UX: | unset |
I don't see how this is a duplicate of 8554, which has to do with casting the output of object_pk to text. The issue here is the use of "object_pk" instead of "object_id" has the field name. This non-standard field name requires anyone who extends it and uses GenericRelation back to use object_id_field="object_pk". This isn't documented anywhere either.
comment:4 by , 13 years ago
Type: | Uncategorized → Bug |
---|
comment:5 by , 13 years ago
Triage Stage: | Unreviewed → Someday/Maybe |
---|---|
Type: | Bug → Cleanup/optimization |
This isn't documented anywhere either.
How about https://docs.djangoproject.com/en/1.4/ref/contrib/comments/models/ ?
I don't really see an issue here. Sure, it would be better if the original author used the default name, but having a different name doesn't break anything. Changing this would mean, *every* project using contrib.comments would have to migrate or monkey patch, so I don't think this is worth the trouble. Maybe in 2.0 ?
comment:6 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
This is a bit annoying, but changing the name doesn't seem worth it at this point.
See also #8554