Karen Tracey wrote: > On Wed, Jan 7, 2009 at 10:51 AM, Jeff Anderson > <jeffe...@programmerq.net>wrote: > > >> varikin wrote: >> >>> I agree with this. I use null=False, blank=True for some ImageFields >>> and integers. >>> >> I'm interested in how a blank integer looks in a MySQL database. Can you >> provide an example > I believe the further description a bit later in the email covered this: > > In the case of an integer, I use it for order of the images. So if a number > >> is given for an image, it is used, otherwise auto assign the order number. >> > > > That is, blank is not actually stored in the DB but rather the lack of a > user-provided value triggers creation of an auto-assigned value. > But that is code that could/should belong in the form/validation code. The models define how things are to be setup and stored in the database backend.
A blank value in a webpage does not translate to a blank value in the database, so blank=True is incorrect in this case, as an auto-assigned value isn't actually blank, because a non-blank value will be stored in the database. Jeff Anderson
signature.asc
Description: OpenPGP digital signature