#9806: GeometryField crashes contrib.gis.admin
-------------------------------------+--------------------------------------
          Reporter:  ingenieroariel  |         Owner:  jbronn                   
            Status:  new             |     Milestone:                           
         Component:  GIS             |       Version:  1.0                      
        Resolution:                  |      Keywords:  admin, gis, GeometryField
             Stage:  Unreviewed      |     Has_patch:  0                        
        Needs_docs:  0               |   Needs_tests:  0                        
Needs_better_patch:  0               |  
-------------------------------------+--------------------------------------
Comment (by ingenieroariel):

 Here is a workaround that makes the admin load up but does not render the
 feature.
 In the following file
 
[http://code.djangoproject.com/browser/django/trunk/django/contrib/gis/admin/options.py#L84
 gs/admin/options.py]

 Before:
 {{{
 params = {
                   ...
                  'geom_type' : OGRGeomType(db_field._geom),
                   ...
 }
 }}}
 After
 {{{
         #OGRGeomType crashes for 'GEOMETRY' type.
         #It'd be better if we found a way to get the geom type of the
 instance, but there
         #does not seem to be an easy way to accomplish that.
         try:
            geom_type=OGRGeomType(db_field._geom)
         except:
            geom_type=OGRGeomType('Unknown')
         params = {
                   ...
                  'geom_type' : geom_type,
                   ...
         }
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9806#comment:2>
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@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to