Re: [Django] #10660: GeometryField doesn't honor "required" attribute

2009-04-25 Thread Django
#10660: GeometryField doesn't honor "required" attribute
-+--
  Reporter:  framos  | Owner:  framos
Status:  closed  | Milestone:  1.1   
 Component:  GIS |   Version:  1.0   
Resolution:  fixed   |  Keywords:
 Stage:  Unreviewed  | Has_patch:  0 
Needs_docs:  0   |   Needs_tests:  0 
Needs_better_patch:  0   |  
-+--
Changes (by jbronn):

  * status:  new => closed
  * needs_better_patch:  => 0
  * resolution:  => fixed
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 (In r10634) Fixed #10660 -- GeometryField no longer requires srid/null
 keywords, and now respects required; coordinate transformations now done
 inside gis.forms.GeometryField -- benefit being that OSMGeoAdmin no longer
 requires 900913 entry in spatial_ref_sys thus enabling it to work with
 MySQL/Oracle spatial backends; added tests for geographic forms.

-- 
Ticket URL: 
Django 
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@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



[Django] #10660: GeometryField doesn't honor "required" attribute

2009-03-30 Thread Django
#10660: GeometryField doesn't honor "required" attribute
+---
 Reporter:  framos  |   Owner:  framos
   Status:  new |   Milestone:  1.1   
Component:  GIS | Version:  1.0   
 Keywords:  |   Stage:  Unreviewed
Has_patch:  0   |  
+---
 The Django documentation says that every form field can be left blank or
 not depending on
 
[http://docs.djangoproject.com/en/dev/ref/forms/fields/#django.forms.Field.required
 the required attribute]. However, Django gis' {{{GeometryField}}} doesn't
 honor that attribute, but uses another called ''null'' instead.

 A simple example to see the problem with the current {{{GeometryField}}}:

 {{{
 class MyForm(forms.Form):
 point = GeometryField(required=False)
 }}}

 According to the documentation, the form should validate when the "point"
 field is left blank, but actually it raises {{{ValidationError}}}. The
 offending code is in
 [source:/django/trunk/django/contrib/gis/forms/fields...@8565#l31 line 31
 of /django/trunk/django/contrib/gis/forms/fields.py].

 I suppose (hope) that the use of ''null'' in {{{GeometryField}}} was a
 deliberate decision made for some reason, but I think the standard
 behavior for form fields must be maintained.

 I see two choices for fixing this:

  1. Introduce a backwards-incompatible change so that {{{GeometryField}}}
 doesn't use ''null'', and use ''required'' instead. I don't know if this
 has impact in other parts of Django.
  1. Allow for "null" OR "required". If null is True OR required is False
 then the field should be allowed to be blank. One option would be calling
 the parent class' (Field) clean() method. This should be backwards-
 compatible AFAIK.

 I can submit a patch when a design decision is reached.

 See also [http://groups.google.com/group/django-
 developers/browse_thread/thread/f6177390b1ca109e this discussion at
 Django-developers].

-- 
Ticket URL: 
Django 
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@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---