Re: Django won't create foreign keys

2008-01-27 Thread Matti Haavikko
Hi, I experienced the same problem. I found an earlier ticket on this same error and reopened it. See http://code.djangoproject.com/ticket/2130 The fix you suggested fixes the problem for me. I've added it to the comments of the ticket. - Haavikko apramanik wrote: > Anyone? I still haven't g

Re: Django won't create foreign keys

2008-01-14 Thread Rajesh Dhawan
On Jan 14, 3:15 pm, apramanik <[EMAIL PROTECTED]> wrote: > Anyone? I still haven't gotten this to work without modifying Django. > Thanks! See the discussion here: http://code.djangoproject.com/ticket/4193 Although it mentions only SQLite, I think the problem is more general than that based on

Re: Django won't create foreign keys

2008-01-14 Thread apramanik
Anyone? I still haven't gotten this to work without modifying Django. Thanks! On Jan 12, 3:34 pm, apramanik <[EMAIL PROTECTED]> wrote: > It seems to be fixed if I change sql_create django/core/management/ > sql.py to > > for model in app_models: > output, references = sql_model_create

Re: Django won't create foreign keys

2008-01-12 Thread apramanik
It seems to be fixed if I change sql_create django/core/management/ sql.py to for model in app_models: output, references = sql_model_create(model, style, known_models) final_output.extend(output) for refto, refs in references.items(): pending_references.se

Re: Django won't create foreign keys

2008-01-12 Thread apramanik
Well inserting rows with invalid poll_id's works, until i enter the ALTER TABLE by hand, so the foreign key constraints are definitely not there. Anyways, here's what it outputs: BEGIN; CREATE TABLE `polls_poll` ( `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `question` varchar(200)

Re: Django won't create foreign keys

2008-01-12 Thread [EMAIL PROTECTED]
Do manage.py sqlall polls instead, it will show all the sql, not just the tables, On Jan 12, 3:41 pm, apramanik <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm trying out the Django development version and have been going > through the tutorial, but the models aren't creating foreign keys. > > When

Django won't create foreign keys

2008-01-12 Thread apramanik
Hi all, I'm trying out the Django development version and have been going through the tutorial, but the models aren't creating foreign keys. When I run 'python manage.py sql polls' I get: BEGIN; CREATE TABLE `polls_poll` ( `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `question` var