On Fri, Nov 28, 2008 at 12:07 PM, dbee <[EMAIL PROTECTED]> wrote:

>
> So django is supposed to be auto incrementing id when i insert a new
> value. Instead though, I get ...
>
> ERROR:  null value in column "id" violates not-null constraint
>
> INSERT INTO "mobi1_campaigns" ("userProfile_id", "name",
> "description", "send_date", "create_date", "campaign_hash",
> "sms_campaign", "direct_mail_campaign", "newsletter_campaign",
> "newsletter_message", "sms_message", "mail_list_size", "mail_notes",
> "status", "campaign_sent", "timestamp", "charge") VALUES (30, 'Great
> New Band Lineup', 'Great music nights for the spring. Let the music
> fans know about this offer ...', '2009-01-06', '2008-11-28',
> 'ntxqf8iqkhzsya2z', True, True, True, '', '', 0, NULL, 0, False, 0,
> '0.00')
>
>
> # Store the campaign
> info
> class Campaigns (models.Model):
>        # Which client does this correspond
> to ?
>        userProfile = models.ForeignKey(UserProfile)
>        groups = models.ManyToManyField(Groups, blank=True, null=True)
>        name = models.CharField( max_length=40 )
>        description = models.TextField( max_length=1600 )
>         ............
>
> This really sucks and only happens in the production server running
> django 1.0 / python 2.3. Not in the dev server running django 1.0 /
> python 2.5 ....
>
> Can anyone offer a possible explanation for django refusing to auto
> increment like that ?
>
>
How was the table created?  It looks as though it is the DB table that does
not consider the column to be auto_increment, not Django.

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