On Wed, 2007-04-25 at 16:14 +0200, Kai Kuehne wrote: > Hi list, > why can I add a record in the admin where the name field is empty, > when the docs say: > "primary_key=True implies blank=False, null=False and unique=True. > Only one primary key is allowed on an object." > > My code: > name = models.CharField(maxlength=255, primary_key=True, db_index=True) > > There is no other primary_key defined.
Wow .. there's been a lot of response to this without the answer actually appearing: it's a bug! :-) Ticket #3774 is the relevant ticket. I'm very tempted to fix this by actually implementing the documented behaviour, because it makes a lot of sense. My only caution so far has been that it's a backwards compatible change and anybody inadvertently relying on the current behaviour (and you can see from one of my comments in that ticket that I don't consider it completely illogical to allow blanks there, so it's not a crazy assumption) would have to change things. I keep tossing this one around in my head, but it will be fixed one way or another soon, I would expect (either by me or another developer). Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---