On Mon, Mar 9, 2009 at 7:17 AM, Reiner <mr.squ...@googlemail.com> wrote:

>
> Hi,
>
> have a look at the documentation of field options in models:
> http://docs.djangoproject.com/en/dev/ref/models/fields/#blank
>
> class Foo(models.Model):
>    this_is_required = models.CharField(...)
>    this_not = models.CharField(..., blank=True)
>
> Regards,
> Reiner
>
> On Mar 9, 8:37 am, khsing <khsing...@gmail.com> wrote:
> > I want create a model that contain two field and there is one of two
> > field can not be blank.
> >
> > how to do it?
> >
> > thanks.
> >
> > --
> > A man live in jail and want to break.http://blog.khsing.net
> >
>
Are you saying there are 2 fields and one has to have a value, but it can be
either one(users decision)?  If so you'll need to make them both nullable
and just set the one you want, in terms of validation you'll have to write
some for whatever the data entry mechanism is, usually forms, either for
your views or the admin.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

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

Reply via email to