[Django] #12188: Nullable numeric and date fields cause ValueError and ValidationError respectively in databrowse

View: New views
1 Messages — Rating Filter:   Alert me  

[Django] #12188: Nullable numeric and date fields cause ValueError and ValidationError respectively in databrowse

by Django-3 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

#12188: Nullable numeric and date fields cause ValueError and ValidationError
respectively in databrowse
--------------------------------------------------------+-------------------
 Reporter:  skyl                                        |       Owner:  nobody    
   Status:  new                                         |   Milestone:            
Component:  django.contrib.databrowse                   |     Version:  1.1      
 Keywords:  databrowse null ValueError ValidationError  |       Stage:  Unreviewed
Has_patch:  0                                           |  
--------------------------------------------------------+-------------------
 I have gender as a SmallPositiveIntegerField.  Databrowse then allows
 "None" as a choice to filter by you can see here:

 http://boss.oswco.net/databrowse/teller/employee/fields/gender/

 ValueError: invalid literal for int() with base 10: 'None'

 Likewise, nullable datefields generate a 'None' choice:

 http://boss.oswco.net/databrowse/teller/employee/fields/birth_date/

 Which results in an error:
 ValidationError: Enter a valid date in YYYY-MM-DD format.

 Maybe there is an easy convention or workaround for dealing with these
 cases.  Sorry if this has already been reported.

--
Ticket URL: <http://code.djangoproject.com/ticket/12188>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django updates" group.
To post to this group, send email to django-updates@...
To unsubscribe from this group, send email to django-updates+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---