Hi all.

If I specify the ForeignKey target model as a string because it is not
yet defined, the (SQLite3) SQL table entry misses the REFERENCES
specifier. Example:

class Department(models.Model):
    head = models.ForeignKey('Person', related_name='heads')
class Person(models.Model):
    department = models.ForeignKey(Department)

results in the following SQL:

CREATE TABLE "common_department" (
    "id" integer NOT NULL PRIMARY KEY,
    "head_id" integer NOT NULL);
CREATE TABLE "common_person" (
    "id" integer NOT NULL PRIMARY KEY,
    "department_id" integer NOT NULL REFERENCES
"common_department" ("id"));

Is the missing REFERENCES in the department table a Django bug?

Thanks for your time,
Dirk

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to