On Tue, Jul 15, 2014 at 11:16 PM, G Z <[email protected]> wrote: > Tom, > > It fails with both autofield and bigintergerfield > > class License(models.Model): > license_id = models.AutoField(primary_key = True, editable = False, > db_column='license_id') > license_authority_id = models.ForeignKey(License_authoritie, on_delete = > models.PROTECT, db_column='license_authority_id') > product = models.CharField(max_length = 20) > > class Meta: > managed = False
Two things: Auto increment is a property set at the time you create the table, so changing the code changes nothing unless you recreate the table/migrations. Secondly, you have told django you are managing that table yourself. If you want that field auto increment, make it so. Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1Jt%2BpAxLx1q%2BgyDVce%2BbA%2BvcZqiStE6SRdjApB-jw6YPw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

