﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
17418	ForeignKey automatic attribute does not depend on db_column	anonymous	nobody	"Here is an example:
{{{
class Author(models.Model):
    name = models.CharField(max_length=10)

class Book(models.Model):
    name = models.CharField(max_length=10)
    author = models.ForeignKey(Author, db_column=""author_key"")
}}}

As from django documentation it will create a column in the database by appending '_id' to the field name, in our case it will be 'author_id'. It will also create an attribute author_id for the Book's instance. The database column name can be overwritten by defining db_column, this is what I did in my example. However, I expect that attribute will be changed from author_id to author_key but it does not happen.
"	Cleanup/optimization	closed	Database layer (models, ORM)	1.3	Normal	invalid			Unreviewed	0	0	0	0	0	0
