#17080: Custom fields using attname, Model __init__ and Deserialization: hard-coded magic for relation fields -------------------------------------+------------------------------------- Reporter: anentropic | Owner: nobody Type: Bug | Status: reopened Component: Core | Version: 1.3 (Serialization) | Resolution: Severity: Normal | Triage Stage: Design Keywords: | decision needed Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by akaariai):
* stage: Accepted => Design decision needed Comment: Ok, I was a bit quick to mark this accepted. There is no need for Django to fix this, as attname seems to be something that is internal to Django. There is this documentation in django/db/models/fields/`__init__.py`: {{{ # A guide to Field parameters: # # * name: The name of the field specifed in the model. # * attname: The attribute to use on the model object. This is the same as # "name", except in the case of ForeignKeys, where "_id" is # appended. # * db_column: The db_column specified in the model (or None). # * column: The database column for this field. This is the same as # "attname", except if db_column is specified. }}} I couldn't find anything interesting about attname from Django's documentation. So, now my take is that if this is going to be fixed, the right fix is to define what attname and name really mean. And then fix the code to match that definition. Currently the definition for attname seems to be that it is to be used only with foreign keys. Marking this design decision needed. -- Ticket URL: <https://code.djangoproject.com/ticket/17080#comment:6> 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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.