Ticket #10872: geodjango_widget_list_editable_support2.patch
File geodjango_widget_list_editable_support2.patch, 1.9 KB (added by , 16 years ago) |
---|
-
django/contrib/gis/admin/widgets.py
37 37 38 38 # Constructing the dictionary of the map options. 39 39 self.params['map_options'] = self.map_options() 40 41 # Constructing the JavaScript module name using the ID of 40 41 42 # Constructing the JavaScript module name using the name of 42 43 # the GeometryField (passed in via the `attrs` keyword). 43 self.params['module'] = 'geodjango_%s' % self.params['field_name'] 44 # Use the 'name' attr for the field name (rather than 'field') 45 self.params['name'] = name 46 # note: we must switch out dashes for underscores since js 47 # functions are created using the module variable 48 js_safe_name = self.params['name'].replace('-','_') 44 49 50 self.params['module'] = 'geodjango_%s' % js_safe_name 51 45 52 if value: 46 53 # Transforming the geometry to the projection used on the 47 54 # OpenLayers map. -
django/contrib/gis/templates/gis/admin/openlayers.html
32 32 <div id="{{ id }}_map"{% if LANGUAGE_BIDI %} dir="ltr"{% endif %}></div> 33 33 <a href="javascript:{{ module }}.clearFeatures()">Delete all Features</a> 34 34 {% if display_wkt %}<p> WKT debugging window:</p>{% endif %} 35 <textarea id="{{ id }}" class="vWKTField required" cols="150" rows="10" name="{{ field_name }}">{{ wkt }}</textarea>35 <textarea id="{{ id }}" class="vWKTField required" cols="150" rows="10" name="{{ name }}">{{ wkt }}</textarea> 36 36 <script type="text/javascript">{% block init_function %}{{ module }}.init();{% endblock %}</script> 37 37 </span>