yes.
On Mar 16, 2012 8:07 PM, "Mike Dewhirst" <mi...@dewhirst.com.au> wrote:

> On 17/03/2012 11:02am, Ben wrote:
>
>> I have a NullBooleanField that I would like to show up in my admin
>> interface as radio buttons with unknown selected by default.
>>
>> # I have the following simplified files
>>
>> ## models.py ##
>> class Value(models.Model):
>>     presence = models.NullBooleanField(**default=False)
>>
>
> Have you tried
>
>    presence = models.NullBooleanField(**default=None)
>
>
> ??
>
>
>
>> ## admin.py ##
>> PRESENCE_CHOICES = ((True, 'True'), (False, 'False'), (None, 'None') )
>> class ValueAdmin(admin.ModelAdmin):
>>     formfield_overrides = {
>>         models.NullBooleanField: {'widget':
>> RadioSelect(choices=PRESENCE_**CHOICES)}
>>     }
>> admin.site.register(Value, ValueAdmin)
>>
>> This behaves very closely to what I desire, but I don't know what I
>> could replace the False with in:
>> presence = models.NullBooleanField(**default=False)
>> in order to make it behave as I would like.
>>
>> Thanks so much for your time,
>> Ben R.
>>
>>
> --
> 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+unsubscribe@**
> googlegroups.com <django-users%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
> .
>
>

-- 
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