Hello everyone!
I've got a strange behaviour of manage.py. Main thing is: not always
my models that use models.ForeignKey as field can be right transformed
to sql query for sqlite3. I've checked versions 0.96 and subversion.
Simple steps to reproduce:
1. django-admin.py startproject testproject
2. cd testproject
3. django-admin.py startapp test
4. changing settings.py: add 'test' to INSTALLED_APPS and set
DATABASE_ENGINE = 'sqlite3'
5. changing models.py
from django.db import models
# Create your models here.
class t(models.Model):
i = models.IntegerField()
class p(models.Model):
field = models.ForeignKey(t)
6. managy.py sql test
BEGIN;
CREATE TABLE "test_p" (
"id" integer NOT NULL PRIMARY KEY,
"field_id" integer NOT NULL
)
;
CREATE TABLE "test_t" (
"id" integer NOT NULL PRIMARY KEY
)
;
COMMIT;
no keyword REFERENCES. Where is it?
7. If you will add two classes from tutorial and will change
setting.py like this:
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
class Choice(models.Model):
poll = models.ForeignKey(Poll)
choice = models.CharField(max_length=200)
votes = models.IntegerField()
class t(models.Model):
i = models.IntegerField()
class p(models.Model):
field = models.ForeignKey(Poll)
calling 'managy.py sql test' still don't show 'REFERENCES' for
"field_id".
So, is it bug or feature?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---