On Jan 7, 5:51 am, tofer...@gmail.com wrote:
> On 07.01-09:47, Malcolm Tredinnick wrote:
> [ ... ]
>
> > This thread is about whether blank=True, null=False (the fourth
> > possibility) ever makes sense for non-text fields.
>
> answer is yes for any field type that accepts an empty string as having
> a meaning.  i currently use this for a couple of custom fields that
> are autogenerated but can be set manually, if desired.  it could also
> happen for innumerate other reasons.
>
> or put more simply '-1' for me.
>

I agree with this. I use null=False, blank=True for some ImageFields
and integers. In both cases, I am generated the this content for the
database, but it is not entered. In the case of the ImageField, an
image is uploaded (an original), then I generate a thumbnail, and a
viewable (a standard sized image).  Technically at this point I don't
need blank=True here because users only upload the original image, but
at some point I can allow them to upload an optional thumbnail and
then use that if supplied or generate it if not.

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.

I thought this was a common use case with Django.  So that is a -1 for
me.

Thanks,
John
--~--~---------~--~----~------------~-------~--~----~
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