• django: Comments from authenticated users

    January 25, 2010

    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 […]

  • get_comment_list reversed

    January 23, 2010

    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 = […]

  • (Русский) Python decorators

    January 10, 2010

    Sorry, this entry is only available in Русский.

  • Make all markers visible

    January 3, 2010

    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)); }

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org