Django 1.5.4 syncdb not creating some fields in PostgreSQL 9.1/PostGIS 2 tables -


i have django model this:

class company(models.model):     name=models.charfield(max_length=256, default=''),     user=models.foreignkey(user),     logo=models.imagefield(upload_to='logos')      def __unicode__(self):         return unicode(self.name) 

after running syncdb, postgresql table

create table myapp_company (     id integer not null,     logo character varying(100) not null ); 

so, no name field, neither user id. same thing happens other model classes: missing fields. , random. example, weird. model

class maplayer(models.model):     cartodb_layer = models.foreignkey('cartodblayer'),     work_map = models.foreignkey('workmap'),     overlap = models.booleanfield(default=false),     min_zoom = models.integerfield(default=4),     max_zoom = models.integerfield(default=14),     opacity = models.floatfield(default=0.6),     anti_aliasing = models.floatfield(default=0.5) 

generates postgresql table

create table myapp_maplayer (     id integer not null,     anti_aliasing double precision not null ); 

so, why id , last field (a float), not other field??

same problem trying run schemamigration --initial via south 0.8.2. fact simple syncdb fails makes me think it's not south issue.

my software versions:

  • django 1.5.4
  • south 0.8.2
  • postgresql 9.1 + postgis 2

any clues?

solved. stupidest mistake ever. problem commas. so, need replace

class company(models.model):     name=models.charfield(max_length=256, default=''),     user=models.foreignkey(user),     logo=models.imagefield(upload_to='logos')      def __unicode__(self):         return unicode(self.name) 

with

class company(models.model):     name=models.charfield(max_length=256, default='')     user=models.foreignkey(user)     logo=models.imagefield(upload_to='logos')      def __unicode__(self):         return unicode(self.name) 

Comments

Popular posts from this blog

php - Magento - Deleted Base url key -

javascript - Tooltipster plugin not firing jquery function when button or any click even occur -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -