: Glenn Tenney <[EMAIL PROTECTED]>
To: django-users@googlegroups.com
Subject: Re: null=True conditionally
Message-ID: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL
PROTECTED]>
Mime-Version: 1.0
Content-Type: t
May 2006 05:43:43 + (UTC)
From: "qhfgva" <[EMAIL PROTECTED]>
To: "Django users"
Subject: Re: null=True conditionally
Date: Sun, 21 May 2006 05:43:43 -
Message-ID: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]>
<
On Sat, 2006-05-20 at 22:15 +, qhfgva wrote:
> Thanks for your response, I'm not having luck with this. It seems like
> the admin interface is requiring ForeignKey fields even when marked as
> null=True.
OK, this problem bites everybody once. It's documented, but easy enough
to miss in all t
Thanks for your response, I'm not having luck with this. It seems like
the admin interface is requiring ForeignKey fields even when marked as
null=True.
My validator that I wrote seems to be working, but since the fk field
is being required it defeats the purpose.
Here is my model. Is there an
On Thu, 2006-05-18 at 04:51 +, qhfgva wrote:
> Class Foo(Model):
> blah = CharField(maxlength=20)
> bar = ForeignKey(Qwerty) # requred field
> baz = CharField(maxlength=20, null=False)
>
> In the above class I'd like to make baz a required field if bar is of a
> certain value oth
Perhaps more generally, how can I constrain baz to a certain subset of
values as a function of bar?
bar = ('qwe','wer','ert','rty')
baz = ('w1','w2','t1','t2')
E.g if bar's value has a 'w' in it then baz must be w1 or w2.
Otherwise it must be t2 or t2.
--~--~-~--~~~
Class Foo(Model):
blah = CharField(maxlength=20)
bar = ForeignKey(Qwerty) # requred field
baz = CharField(maxlength=20, null=False)
In the above class I'd like to make baz a required field if bar is of a
certain value otherwise it can be blank. If there a way to accomplish
this?
Th
7 matches
Mail list logo