Djano has a beautiful application – django.contrib.comments. And what is even more beautiful that it is customizable! So I’ll describe how to customize it so that only authenticated users are able to leave comments and comments must contain some rating – I will call such comments reviews. First, create an overridden comments application in a […]
Django has comments application and it works fine for me, except that I need comments in the reversed order. I could have used reversed order in the {% for %} tag, but this doesn’t work with pagination as pagination wants already prepared list. So I wrote a separate filter: from django.template import Library register = […]
This code allows you to set map’s bounds so that all markers are visible: function makeRouteVisible(markers) { var bounds = new GLatLngBounds; for (var i = 0; i < markers.length; i++) { bounds.extend(markers[i].getLatLng()); } map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds)); }