Friday, April 29, 2011

.save() works with no (custom, not 'id') primary key specified?

How is this possible based on the model below?

d = Device()
d.save()
# no errors

class Device(models.Model):

    propertyno      = models.CharField('Property Number',
                                       max_length=10,
                                       primary_key=True)

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment