On Thu, Oct 2, 2008 at 2:26 PM, Karthik Krishnan <[EMAIL PROTECTED]>wrote:

>
> I have the following table in models.py
>
> class SiteAccessProcess(models.Model):
>  """Object model mapping to the site_access_process table.
>
>  Each element in the class represents a table column.
>  """
>  instance_id = models.DecimalField(
>      blank=False, max_digits=32, decimal_places=0,
>      help_text='Unique integer id')
>  active_status = models.CharField(
>      max_length=3, choices=YES_NO_CHOICES, blank=False,
>      help_text='Status indicate whether the site is active or not.')
>  revision_date = models.DateTimeField(blank=False,
>                                       help_text='Date of revision')
>  revision_owner = models.CharField(max_length=64, blank=False,
>                                    help_text='Revision owner')
>  site_network = models.ForeignKey('Site', to_field='network_id',
>                                   help_text='Site network id')
>  title = models.CharField(max_length=128, blank=False,
>                           help_text='Site access process title'),
>  process = models.CharField(max_length=2048, blank=False,
>                             help_text='Site access process details'),
>  access_request_lead_time = models.DecimalField(
>      max_digits=32, decimal_places=0,
>      help_text='In hours. How many hours in advance you have to
> request '
>      'access [24, 48, 72 hours].')
>  tracking_id = models.DecimalField(
>      blank=False, max_digits=16, decimal_places=0,
>      help_text='tracking number to avoid concurrency issues. Default
> to 1. '
>      'Increment on update/delete. Will Not be visible to the users')
>

This is hard to parse in email, a better place for this amount of code is
someplace like dpaste.com where it can be formatted properly.  Nevertheless
the problem appears to be the trailing commas you have on the title and
process field definitions.  It isn't immediately apparent to me why, but
this seems to make those fields invisible -- there are no columns for them
created in the database table and as you see you get an error trying to
specify one of them.

This can be replicated with a much simpler model:

class Site(models.Model):
    name = models.CharField(max_length=8),
    network_id = models.AutoField(primary_key=True)

manage.py syncdb on this will create a table with just the 'network_id'
column.  Removing the comma and running manage py reset <app> creates a
table with both 'name' and 'network_id' columns.  Probably it's an extremely
obvious Python thing that I'm missing because it's really too late for me to
be trying to read code...

Karen

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to