Hi Michael,

On Tue, 08 Mar 2011 11:05:40 +0100, Michael Radziej <m...@spieleck.de> wrote:

Hi Martin!

Args--you're right. Stupid fingers :-)

I meant

.../admin/appname/booltest/?completed__exact=0

Does it work that way for you with 0 instead of False?


Yes, if I rewrite URL to ?completed__exact=0, then I get Completed with `no` choice.


This link is called after I click on `no` in filter category `By
completed`.

Hmm. I see a 0 here. I don't know the reason for the difference, I
checked it on a django 1.1 system. I vaguely remember a change.

What database and which version of Django are you using?



I have Django 1.2.5. But when I change choices definition from:


NO = False
YES = True
YES_NO_CHOICES = (
    (NO, 'no'),
    (YES, 'yes')
)

to


NO = 0
YES = 1
YES_NO_CHOICES = (
    (NO, 'no'),
    (YES, 'yes')
)

Then I get 0 or 1 for filter instead of True or False and it works. I think that the admin takes the True/False parameter in URL as string and does't convert it to bool.

Kind regards

Michael


Kind regads,
Martin

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