Re: Primary key field can be empty

2007-04-26 Thread Kai Kuehne
Hi, On 4/26/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > 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,

Re: Primary key field can be empty

2007-04-26 Thread Malcolm Tredinnick
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 =

Re: Primary key field can be empty

2007-04-25 Thread Jason McVetta
On 4/25/07, Ramiro Morales <[EMAIL PROTECTED]> wrote: > > Try adding blank=False explicitely because it works > at the admin UI level so it doesn't know about database > primary keys and such. I have experienced the same bug. I have a model that sets its primary key like this:

Re: Primary key field can be empty

2007-04-25 Thread Kai Kuehne
Hi, On 4/25/07, Ramiro Morales <[EMAIL PROTECTED]> wrote: > Try adding blank=False explicitely because it works > at the admin UI level so it doesn't know about database > primary keys and such. I thoght "implies" means "automatically added". Well, I will try add it manually... seems like a

Re: Primary key field can be empty

2007-04-25 Thread Ramiro Morales
On 4/25/07, Kai Kuehne <[EMAIL PROTECTED]> wrote: > > Argh, sorry... I made a mistake: >primary_key implies blank=False and null=False. > > Now it should be correct. :) Oh, I kept reading that as "why can't I add..." Try adding blank=False explicitely because it works at the admin UI level

Re: Primary key field can be empty

2007-04-25 Thread Kai Kuehne
Argh, sorry... I made a mistake: primary_key implies blank=False and null=False. Now it should be correct. :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Primary key field can be empty

2007-04-25 Thread Kai Kuehne
Hola, On 4/25/07, Ramiro Morales <[EMAIL PROTECTED]> wrote: > Sorry, I don't understand what you are asking.then.The > first paragraph of your message was: Second try: primary_key=True implies blank=True and null=True. This means that you cannot add an entry where the name (in my case) is

Re: Primary key field can be empty

2007-04-25 Thread Ramiro Morales
On 4/25/07, Kai Kuehne <[EMAIL PROTECTED]> wrote: > > Hi, > > On 4/25/07, Ramiro Morales <[EMAIL PROTECTED]> wrote: > > > Hi list, > > > why can I add a record in the admin where the name field is empty, > > > > Because, as you wrote, blank and null are False? > > blank=False means that a blank

Re: Primary key field can be empty

2007-04-25 Thread Kai Kuehne
Hi, On 4/25/07, Ramiro Morales <[EMAIL PROTECTED]> wrote: > > Hi list, > > why can I add a record in the admin where the name field is empty, > > Because, as you wrote, blank and null are False? blank=False means that a blank field ISN'T allowed. Kai

Re: Primary key field can be empty

2007-04-25 Thread Ramiro Morales
On 4/25/07, Kai Kuehne <[EMAIL PROTECTED]> wrote: > > Hi list, > why can I add a record in the admin where the name field is empty, Because, as you wrote, blank and null are False? -- Ramiro Morales --~--~-~--~~~---~--~~ You received this message because you

Primary key field can be empty

2007-04-25 Thread Kai Kuehne
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