Skip to content

Commit e0e60ef

Browse files
committed
[soc2009/admin-ui] merging trunk up to r11153 into my branch
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/admin-ui@11154 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent 2ae6ac5 commit e0e60ef

File tree

51 files changed

+1097
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1097
-295
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ answer newbie questions, and generally made Django that much better:
226226
Ian G. Kelly <ian.g.kelly@gmail.com>
227227
Ryan Kelly <ryan@rfk.id.au>
228228
Thomas Kerpe <thomas@kerpe.net>
229+
Wiley Kestner <wiley.kestner@gmail.com>
229230
Ossama M. Khayat <okhayat@yahoo.com>
230231
Ben Khoo <khoobks@westnet.com.au>
231232
Garth Kidd <http://www.deadlybloodyserious.com/>

django/contrib/admindocs/templates/admin_doc/model_index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ <h2>Model groups</h2>
3636
<ul>
3737
{% regroup models by app_label as grouped_models %}
3838
{% for group in grouped_models %}
39-
<li><a href="#{{ group.grouper }}">{{ group.grouper|capfirst }}</a></li>
39+
<li><a href="#app-{{ group.grouper }}">{{ group.grouper|capfirst }}</a></li>
4040
{% endfor %}
4141
</ul>
4242
</div>

django/contrib/admindocs/views.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,22 @@ def model_detail(request, app_label, model_name):
214214
'help_text': field.help_text,
215215
})
216216

217+
# Gather many-to-many fields.
218+
for field in opts.many_to_many:
219+
data_type = related_object_name = field.rel.to.__name__
220+
app_label = field.rel.to._meta.app_label
221+
verbose = _("related `%(app_label)s.%(object_name)s` objects") % {'app_label': app_label, 'object_name': data_type}
222+
fields.append({
223+
'name': "%s.all" % field.name,
224+
"data_type": 'List',
225+
'verbose': utils.parse_rst(_("all %s") % verbose , 'model', _('model:') + opts.module_name),
226+
})
227+
fields.append({
228+
'name' : "%s.count" % field.name,
229+
'data_type' : 'Integer',
230+
'verbose' : utils.parse_rst(_("number of %s") % verbose , 'model', _('model:') + opts.module_name),
231+
})
232+
217233
# Gather model methods.
218234
for func_name, func in model.__dict__.items():
219235
if (inspect.isfunction(func) and len(inspect.getargspec(func)[0]) == 1):
@@ -233,7 +249,7 @@ def model_detail(request, app_label, model_name):
233249
})
234250

235251
# Gather related objects
236-
for rel in opts.get_all_related_objects():
252+
for rel in opts.get_all_related_objects() + opts.get_all_related_many_to_many_objects():
237253
verbose = _("related `%(app_label)s.%(object_name)s` objects") % {'app_label': rel.opts.app_label, 'object_name': rel.opts.object_name}
238254
accessor = rel.get_accessor_name()
239255
fields.append({

django/contrib/comments/views/comments.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def post_comment(request, next=None):
3737
if not data.get('email', ''):
3838
data["email"] = request.user.email
3939

40+
# Check to see if the POST data overrides the view's next argument.
41+
next = data.get("next", next)
42+
4043
# Look up the object we're trying to comment about
4144
ctype = data.get("content_type")
4245
object_pk = data.get("object_pk")

django/contrib/gis/admin/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class GeoModelAdmin(ModelAdmin):
3232
map_height = 400
3333
map_srid = 4326
3434
map_template = 'gis/admin/openlayers.html'
35-
openlayers_url = 'http://openlayers.org/api/2.7/OpenLayers.js'
35+
openlayers_url = 'http://openlayers.org/api/2.8/OpenLayers.js'
3636
point_zoom = num_zoom - 6
3737
wms_url = 'http://labs.metacarta.com/wms/vmap0'
3838
wms_layer = 'basic'

django/contrib/gis/db/models/sql/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def resolve_columns(self, row, fields=()):
225225
values.append(self.convert_values(value, field))
226226
else:
227227
values.extend(row[index_start:])
228-
return values
228+
return tuple(values)
229229

230230
def convert_values(self, value, field):
231231
"""

django/contrib/gis/maps/google/gmap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class GoogleMap(object):
2121
def __init__(self, key=None, api_url=None, version=None,
2222
center=None, zoom=None, dom_id='map',
2323
kml_urls=[], polylines=None, polygons=None, markers=None,
24-
template='gis/google/google-single.js',
24+
template='gis/google/google-map.js',
2525
js_module='geodjango',
2626
extra_context={}):
2727

@@ -162,7 +162,7 @@ def __init__(self, *args, **kwargs):
162162

163163
# This is the template used to generate the GMap load JavaScript for
164164
# each map in the set.
165-
self.map_template = kwargs.pop('map_template', 'gis/google/google-map.js')
165+
self.map_template = kwargs.pop('map_template', 'gis/google/google-single.js')
166166

167167
# Running GoogleMap.__init__(), and resetting the template
168168
# value with default obtained above.

django/contrib/gis/templates/gis/google/google-base.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

django/contrib/gis/templates/gis/google/google-map.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
{% autoescape off %}
2+
{% block vars %}var geodjango = {};{% for icon in icons %}
3+
var {{ icon.varname }} = new GIcon(G_DEFAULT_ICON);
4+
{% if icon.image %}{{ icon.varname }}.image = "{{ icon.image }}";{% endif %}
5+
{% if icon.shadow %}{{ icon.varname }}.shadow = "{{ icon.shadow }}";{% endif %} {% if icon.shadowsize %}{{ icon.varname }}.shadowSize = new GSize({{ icon.shadowsize.0 }}, {{ icon.shadowsize.1 }});{% endif %}
6+
{% if icon.iconanchor %}{{ icon.varname }}.iconAnchor = new GPoint({{ icon.iconanchor.0 }}, {{ icon.iconanchor.1 }});{% endif %} {% if icon.iconsize %}{{ icon.varname }}.iconSize = new GSize({{ icon.iconsize.0 }}, {{ icon.iconsize.1 }});{% endif %}
7+
{% if icon.infowindowanchor %}{{ icon.varname }}.infoWindowAnchor = new GPoint({{ icon.infowindowanchor.0 }}, {{ icon.infowindowanchor.1 }});{% endif %}{% endfor %}
8+
{% endblock vars %}{% block functions %}
29
{% block load %}{{ js_module }}.{{ dom_id }}_load = function(){
310
if (GBrowserIsCompatible()) {
411
{{ js_module }}.{{ dom_id }} = new GMap2(document.getElementById("{{ dom_id }}"));
512
{{ js_module }}.{{ dom_id }}.setCenter(new GLatLng({{ center.1 }}, {{ center.0 }}), {{ zoom }});
6-
{% block controls %}{{ js_module }}.{{ dom_id }}.addControl(new GSmallMapControl());
7-
{{ js_module }}.{{ dom_id }}.addControl(new GMapTypeControl());{% endblock %}
13+
{% block controls %}{{ js_module }}.{{ dom_id }}.setUIToDefault();{% endblock %}
814
{% if calc_zoom %}var bounds = new GLatLngBounds(); var tmp_bounds = new GLatLngBounds();{% endif %}
915
{% for kml_url in kml_urls %}{{ js_module }}.{{ dom_id }}_kml{{ forloop.counter }} = new GGeoXml("{{ kml_url }}");
1016
{{ js_module }}.{{ dom_id }}.addOverlay({{ js_module }}.{{ dom_id }}_kml{{ forloop.counter }});{% endfor %}
@@ -26,4 +32,4 @@
2632
alert("Sorry, the Google Maps API is not compatible with this browser.");
2733
}
2834
}
29-
{% endblock %}{% endautoescape %}
35+
{% endblock load %}{% endblock functions %}{% endautoescape %}

django/contrib/gis/templates/gis/google/google-multi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% extends "gis/google/google-base.js" %}
1+
{% extends "gis/google/google-map.js" %}
22
{% block functions %}
33
{{ load_map_js }}
44
{{ js_module }}.load = function(){

0 commit comments

Comments
 (0)