Re: How to specify NULL as the default of a model field.

2010-10-11 Thread David De La Harpe Golden
On 09/10/10 08:06, Tim Diggins wrote: > It may seem odd but I want to explicitly specify NULL as the default > for a particular field / column. (This is so that South picks up that > the default value is null, rather than there being no default > specified, which is what happens if you specify "nul

Re: How to specify NULL as the default of a model field.

2010-10-10 Thread Ɓukasz Rekucki
Are you adding the field to the model or is the field is already there and you're just adding null=True to it's definition. In the second case, the *backwards* migration will require a default value for instances that have NULL value. On 10 October 2010 00:49, Tim Diggins wrote: > Yes I'm setting

Re: How to specify NULL as the default of a model field.

2010-10-09 Thread Masklinn
On 2010-10-10, at 00:49 , Tim Diggins wrote: > I would normally guess None, but that won't help in this instance Why not? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsu

Re: How to specify NULL as the default of a model field.

2010-10-09 Thread Shawn Milochik
If the field isn't a required field, I don't think South would complain about no default being set. What type of field is it? What version of Django, and what version of South? Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: How to specify NULL as the default of a model field.

2010-10-09 Thread Tim Diggins
Yes I'm setting blank=True and null=True. But, when I migrate using South (I've added this field to an existing model), South complains that the field has no default value... In this instance, it isn't that important, but just wondering how I specify "NULL" in python in future (I would normally gue

Re: How to specify NULL as the default of a model field.

2010-10-09 Thread Shawn Milochik
What are you trying to accomplish? If you set blank = True and null = True then they'll be null in the database after the migration and if left blank by the user. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, se

How to specify NULL as the default of a model field.

2010-10-09 Thread Tim Diggins
It may seem odd but I want to explicitly specify NULL as the default for a particular field / column. (This is so that South picks up that the default value is null, rather than there being no default specified, which is what happens if you specify "null=True" any thoughts (or it may just be impos