Re: Fields validating as optional

2010-06-22 Thread Jonathan Hayward
Thanks, Dan and Daniel. On Tue, Jun 22, 2010 at 3:45 PM, Daniel Roseman wrote: > On Jun 22, 9:11 pm, Jonathan Hayward > wrote: > > What is the preferred way to make e.g. a TextField that will pass > validation > > if it is left empty? I've seen two approaches apparently referenced in > the > > d

Re: Fields validating as optional

2010-06-22 Thread Daniel Roseman
On Jun 22, 9:11 pm, Jonathan Hayward wrote: > What is the preferred way to make e.g. a TextField that will pass validation > if it is left empty? I've seen two approaches apparently referenced in the > documentation: > >     additional_comments = models.TextField(required = False) > >     addition

Re: Fields validating as optional

2010-06-22 Thread Dan Harris
Jonathan, I think what you are running into is the differences between how models are declared vs how forms are declared. In models you declare the fields as blank=True and/or null=True to specify that the data stored in the database can be left blank. Something like this: class MyModel(models.Mo

Fields validating as optional

2010-06-22 Thread Jonathan Hayward
What is the preferred way to make e.g. a TextField that will pass validation if it is left empty? I've seen two approaches apparently referenced in the documentation: additional_comments = models.TextField(required = False) additional_comments = models.TextField(blank = True) and run int