#14179: django create table with capitalized chars
---------------------------+------------------------------------------------
 Reporter:  boris          |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  1.2       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 Hello!

 I have a model like this:
 {{{

 ...

 class OrganizationType(models.Model):
   name         = models.CharField(max_length = 255, unique = True)

   def __unicode__(self):
     return self.name

   class Meta:
     ordering = ('name',)

 class Parameter(models.Model):
   code               = models.PositiveIntegerField()
   name               = models.CharField(max_length = 255)
   description        = models.TextField(null = True, blank = True)
   weight             = models.PositiveIntegerField()
   group              = models.ForeignKey(Subcategory)
   type               = models.ForeignKey(ParameterType)
   organizationType   = models.ManyToManyField(OrganizationType)
   exclude            = models.ManyToManyField(Organization, null = True,
 blank = True)

   def __unicode__(self):
     return '%d.%d.%d. %s' % (self.group.group.code, self.group.code,
 self.code, self.name)

   def fullcode(self):
     return '%d.%d.%d' % (self.group.group.code, self.group.code,
 self.code)

   class Meta:
     unique_together = (
       ('name', 'group'),
       ('code', 'group'),
     )
     ordering = ('group__group__code', 'group__code', 'code')

 ...

 }}}


 python manage.py sql appname generate SQL:
 {{{

 ...

 BEGIN;
 CREATE TABLE "exmo2010_organizationtype" (
     "id" integer NOT NULL PRIMARY KEY,
     "name" varchar(255) NOT NULL UNIQUE
 )
 ;
 CREATE TABLE "exmo2010_parameter_organizationType" (
     "id" integer NOT NULL PRIMARY KEY,
     "parameter_id" integer NOT NULL,
     "organizationtype_id" integer NOT NULL REFERENCES
 "exmo2010_organizationtype" ("id"),
     UNIQUE ("parameter_id", "organizationtype_id")
 )
 ;
 CREATE TABLE "exmo2010_parameter" (
     "id" integer NOT NULL PRIMARY KEY,
     "code" integer unsigned NOT NULL,
     "name" varchar(255) NOT NULL,
     "description" text,
     "weight" integer unsigned NOT NULL,
     "group_id" integer NOT NULL REFERENCES "exmo2010_subcategory" ("id"),
     "type_id" integer NOT NULL REFERENCES "exmo2010_parametertype" ("id"),
     UNIQUE ("name", "group_id"),
     UNIQUE ("code", "group_id")
 )
 ;

 ...

 }}}

 in this line `CREATE TABLE "exmo2010_parameter_organizationType"` table
 name contains capital letter 'T'. I think this is an error, isn't it?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14179>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en.

Reply via email to