• django: Comments from authenticated users

    Январь 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

    Январь 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

    Январь 10, 2010

    Неплохая статья про декораторы на питоне: http://www.ibm.com/developerworks/ru/library/l-cpdecor/index.html В то же время, crystalbit на своём delphi блоге программирует, делится и обсуждает все тонкости delphi.

  • Make all markers visible

    Январь 3, 2010

    Следующий код позволяет настроить границы карты таким образом, чтобы необходимые маркеры были в зоне видимости: 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