#10114: spaces are inserted for 'blank' fields
------------------------------------------+---------------------------------
 Reporter:  wmstudio                      |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  1.0       
 Keywords:                                |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 I have a model in which several fields are specified as follows:

     lat_dec = models.FloatField(blank=True, null=True)
     lon_dec = models.FloatField(blank=True, null=True)
     lat_dms = models.CharField(max_length=9, blank=True, null=True)
     lon_dms = models.CharField(max_length=10, blank=True, null=True)

 In case of the CharFields, spaces are inserted into the database
 (PostgreSQL) when in the admin form the entry-fields are left blank. I
 found that out because I made some trigger procedures which update lat_dec
 and lon_dec when lat_dms and lon_dms (see model) are specified and vice
 versa. Now I made a workaround by adjusting the trigger procedure so it
 sets the fields to NULL when containing only spaces.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10114>
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to