Re: syncdb & postgreSQL
On 3/24/07, jewe <[EMAIL PROTECTED]> wrote: > The constraints was now creates with a new nameconstruct. > i.E.: team_id_refs_team_id_6e4cb777 > > The referenced tabel was now named without the tablename. I assume > that's a hash-value.(?) Yes, the way Django names database constraints changed between the 0.95 and 0.96 releases; there's an item in the release notes for 0.96 about this, including suggested workarounds. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: syncdb & postgreSQL
1 hour ago, I have installed the svn-version from django (rev.4809) and now, it works brilliant (for the moment :o)). The constraints was now creates with a new nameconstruct. i.E.: team_id_refs_team_id_6e4cb777 The referenced tabel was now named without the tablename. I assume that's a hash-value.(?) Anyway, now it works. thx, for the efforts!!! Note: If you try to install django from svn in windows and you have to create a new *.pth file. Use only small types in the path-statement!!! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: syncdb & postgreSQL
OK, here are a piece of backgrounds: OS: Windows XP The version of Django is 0.95.1 (stable version; not svn), the version of PostgreSQL is 8.2. I use psycopg2-2.0.6b1.win32-py2.5-pg8.2.1- release for the databasebinding. The error comes from Django: Following steps (the applicationname is tm): - validate -> 0 errors found - syncdb -> creating tables and installing some initial data; all works fine - reset -> error: = Error: tm couldn't be installed. Possible reasons: * The database isn't running or isn't configured correctly. * At least one of the database tables already exists. * The SQL was invalid. Hint: Look at the output of 'django-admin.py sqlreset tm'. That's the SQL this command wasn't able to run. The full error: constraint "team_id_referencing_tm_team_team_id" does not exist = - sqlreset: (abstract) = BEGIN; ... ALTER TABLE "tm_player" DROP CONSTRAINT "team_id_referencing_tm_team_team_id"; ... "; = - a look in the databaseinterfcae (pgAdmin): the name of the constraint in table tm_player is: team_id_referencing_tm_team_team_id_1 I don't know, what can I do. For every changes in the db-model, I have delete all tables by hand and but now I can use syncdb. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: syncdb & postgreSQL
On Fri, 2007-03-23 at 17:54 +, jewe wrote: > Hi everbody, > > I'm trying to create tables with help of models (use postgreSQL; > engin: postgresql_psycopg2). > My model (part): > > ... > class Team(models.Model): > team_id = models.IntegerField(primary_key=True) > name= models.CharField(maxlength=100) > > class Player(models.Model): > player_id = models.IntegerField(primary_key=True) > firstname = models.CharField(maxlength=50) > lastname = models.CharField(maxlength=50) > team = models.ForeignKey(Team) > ... > > (Note: It's importand here to use own keys and not autogenerated) > The command syncdb create the tables correct, but it was created a > constraint with the name: team_id_referencing_tm_team_team_id_1 > for the table player > > Now, I have trouble withe the reset-command. It will drop the > constraint: > team_id_referencing_tm_team_team_id > > (the reset was canceled with an error) Can you give some more details of the error, since it's important. Is it a database error, or something raised by Django itself? Also, what version of Django are your using -- the last release, or something you checked out of subversion? In the latter case, which version (type "svn info" to see the revision number). Using the models you provided, I can create and reset them using PostgreSQL without any errors, so this isn't a universal problem: there's something special about your set up. Regards, Malcolm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
syncdb & postgreSQL
Hi everbody, I'm trying to create tables with help of models (use postgreSQL; engin: postgresql_psycopg2). My model (part): ... class Team(models.Model): team_id = models.IntegerField(primary_key=True) name= models.CharField(maxlength=100) class Player(models.Model): player_id = models.IntegerField(primary_key=True) firstname = models.CharField(maxlength=50) lastname = models.CharField(maxlength=50) team = models.ForeignKey(Team) ... (Note: It's importand here to use own keys and not autogenerated) The command syncdb create the tables correct, but it was created a constraint with the name: team_id_referencing_tm_team_team_id_1 for the table player Now, I have trouble withe the reset-command. It will drop the constraint: team_id_referencing_tm_team_team_id (the reset was canceled with an error) Yes, I could rename the attribute-name 'team', but it's not a good solution. Have someone a better idea? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---