﻿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
3103	[patch]: Remove restriction on string name for relationship fields.	Eric Van Dewoestine <ervandew@…>	Adrian Holovaty	"Patch based on development version 4051.

As described in the many-to-one relationships doc [http://www.djangoproject.com/documentation/model_api/#many-to-one-relationships], django currently has the following restriction:

{{{
If you need to create a relationship on a model that has not yet been defined,
you can use the name of the model, rather than the model object itself:

...

Note, however, that you can only use strings to refer to models in the same
models.py file -- you cannot use a string to reference a model in a different
application, or to reference a model that has been imported from elsewhere.
}}}

The attached patch removes this restriction allowing one to do something like:

{{{
class Car(models.Model):
    manufacturer = models.ForeignKey('mysite.myotherapp.models.Manufacturer')
}}}"	enhancement	closed	Database layer (models, ORM)	dev	normal	wontfix			Unreviewed	1	0	0	0	0	0
