Hi All,
Getting a weird problem calling syncdb on models with ForeignKey
fields.
My models looks like this:
class Plugin(models.Model):
name = models.CharField(max_length=50)
description = models.CharField(max_length=100)
class PluginContainer(models.Model):
title = models.CharField(max_length=50)
plugin_settings = models.CharField(max_length=2000)
plugin = models.ForeignKey(Plugin)
PluginContainer refers to Plugin object (ForeignKey) Running manage.py
syncdb produces the tables:
App_plugin and app_plugincontainer
notice the incorrect casing on app_plugincontainer. Removing the
ForeignKey from PluginContainer correctly creates the table as
App_plugincontainer
This is causing a problem with running manage.py syncdb again as it
cannot find App_plugincontainer and then tries to create
app_plugincontainer and fails as the table already exists.
My environment: OS: Mac OS X 10.5 DB: MySql 5.05 Python: 2.5 Django:
SVN
MySql's lower_case_table_names variable is set to 2 (default on mac os
x)
I haven't had the oppurtunity to test this on any other os/db
combination yet.
Cheers Naren
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---