<p class=\"paginator\"> <span class=\"step-links\"> {% if page_obj.has_previous %} <a href=\"?page={{ page_obj.previous_page_number }}\"><</a> {% endif %} <span class=\"current\"> Page <span class=\"this-page\">{{ page }}</span> of {{ paginator.num_pages }} </span> {% if page_obj.has_next %} <a href=\"?page={{ page_obj.next_page_number }}\">></a> {% endif %} </span> </p>"If the results are paginated, the context will contain these extra variables: paginator: An instance of django.core.paginator.Paginator. page_obj: An instance of django.core.paginator.Page." Django Generic views object_list:
Rambling about Django, Python, Ansible and sometimes PHP and Wordpress. I enjoy talking about all technologies, and offer help when I can.
Friday, January 29, 2010
Django | Generic views | Django documentation
Took me forever to figure this out with generi views, but the I just don't read well. Here is an example template:
Thursday, January 28, 2010
Dynamic Inlines Built into Django Admin in 1.2
So I was talking at a Django round table last night and talking about the fixes I did to the dynamic inlines for the admin. And someone mentioned that a)jquery is now included in Django 1.2 and b) dynmaic inlines are built in as well.
/django/trunk/django/contrib/admin/media/js/inlines.js
Sunday, January 24, 2010
Django CMS Photologue plugin with Gallerific
I just made a fork of the django cms photologue plugin with gallerific jquery gallery
Django CMS Photologue plugin with Gallerific
Friday, January 22, 2010
Django snippets: jQuery Double Click Edit ManyToMany in Admin
Take a look at my code on django snippets. Just drop this into your templates/admin/change_form.html and any select for a foreign key or many to many will allow a double click to pop up and edit
Django snippets: jQuery Double Click Edit ManyToMany in Admin
Django snippets: jQuery Double Click Edit ManyToMany in Admin
Thursday, January 14, 2010
Fabric, Django, Git, Apache, mod_wsgi, virtualenv and pip deployment | Morethanseven
Another good example of django deployments with fabric
Saturday, January 09, 2010
Friday, January 08, 2010
How the Washington Post creates and deploys sites fast with virtualenv and Django
Great tutorial for creating and easy process to deploy Django projects.
washingtontimes's django-repositories at master - GitHub
Django App to battle trac ... finally, now if some one can incorporate time tracking and other PM into it that would be sweet, maybe I'll do that in my abundance of spare time.
pyDanny: Picking a Django powered CMS
I picked django-cms but now im second guessing myself :(
Thursday, January 07, 2010
Quick tip: how to convert tables to InnoDB
apt-get install maatkit
mk-find --engine MyISAM --exec "ALTER TABLE %D.%N ENGINE=INNODB" --print
Wednesday, January 06, 2010
Django Dynamic Formset
I posted Previously about this jquery plugin. I have just figured out a very plugable way to get this working in the admin with adding just one form.
Add the following to templates/admin/APP/MODEL/change_form.html and also update the MODEL in the prefix setting.
{% extends "admin/change_form.html" %} {% load i18n admin_modify adminmedia %} {% block extrahead %} {{ block.super }} // Define this so we don't have to bother with the admin jsi18n stuff: function gettext(msgid) { return msgid; } $(function() { $('.inline-related tbody tr').formset({ prefix: 'MODEL_set', addText: 'Add', deleteText: 'Delete', }); }); .add-row { padding-left:18px; background:url({% admin_media_prefix %}img/admin/icon_addlink.gif) no-repeat left center; } .delete-row { float:right; display:block; padding-left:18px; background:url({% admin_media_prefix %}img/admin/icon_deletelink.gif) no-repeat left center; } {% endblock %}
Thanks Stanislaus
Django Dynamic Formset
Tuesday, January 05, 2010
Friday, January 01, 2010
howto:chroot_debian - DNS323Wiki
Installing debian on the DLink DNS323 NAS is really easy, just download and extact the files to the root directory and restart it.
Default password is 12345678 make sure you reset it.
Also update your /etc/apt/source.list to lenny and apt-get update (don't forget to apt-get install debian-archive-keyring)
Files
Instructions
howto:chroot_debian - DNS323Wiki
Subscribe to:
Posts (Atom)