#13527: Allow column on ForeignKey
---------------------------------------------------+------------------------
Reporter: malthe | Owner: nobody
Status: closed | Milestone:
Component: Database layer (models, ORM) | Version: 1.1
Resolution: wontfix | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
---------------------------------------------------+------------------------
Changes (by russellm):
* status: new => closed
* needs_better_patch: => 0
* resolution: => wontfix
* needs_tests: => 0
* needs_docs: => 0
Comment:
I'm afraid I don't see the value here. You can name the attribute anything
you want (using the model definition), and you can specify whatever
database column name you want (using db_column); the "append _id to the
field name" is a helpful convention so you always know how you can
retrieve the underlying key value.
Ultimately, this is cosmetic change that allows the user to define
potentially confusing models (why doesn't object_id retrieve the key for
the related object?), and introduces extra complexity to validation (since
from_field can't clash with the attribute or field name of any other field
on the model).
--
Ticket URL: <http://code.djangoproject.com/ticket/13527#comment:1>
Django <http://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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.