docs/model-api for ForeignKeyField lacks option to specify model name
|Reported by:||Owned by:||Jacob|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The docs for ForeignKeyField in docs/model-api.txt state that you have to pass the model as the first argument.
Actually, you can also pass the model name.
I came upon this after trying something stupid and getting the following error message:
File "/home/mir/src/django/active/django/db/models/fields/related.py", line 410, in init
assert isinstance(to, basestring), "ForeignKey(%r) is invalid. First parameter to ForeignKey must be either a model, a model name, or the string %r" % (to, RECURSIVE_RELATIONSHIP_CONSTANT)
AssertionError: ForeignKey(<class django_pop.email_admin.models.Ipkunde at 0xb74be41c>) is invalid. First parameter to ForeignKey must be either a model, a model name, or the string 'self'
I'm not sure if this actually works, but if not, then the error message is wrong ;-) I need this for cyclic foreign key references ... (no, it's not designed by me, so don't bash me about it ...)