Tag Archives: django

I recently created custom widget for Django Admin area.


It’s used to edit pickled set of weekly hours range day by day. There is also ability to check a day as closed. Pure client side control was implemented as jQuery plugin for using with Django:

weekly_hours.js, weekly_hours.css

Server side model and widget:,



I use special Auto-changes SQL scripts to control database structure and data of .NET/MSSQL projects. Maybe later I’ll write more about it. Let’s say it’s mostly the set of T-SQL code chunks to provide changes in your local development or live production database or some staging or QA server.

In opposite to this single SQL file way, South DB migration tool for Django framework has separated file per each change. We call such change a migration. It’s not SQL file that change something in DB directly, but python module that provide changes via ORM. It’s ok to run pure SQL statements as well.

Each migration has 2 ways (methods) forward to go to this migration and backward for jumping to previous migration in the sequence.

There is migration sequence may be provided per each Django application.

So, the sense is to create migration and then apply it.

So, there is Django 1.2 in action for now.
First one of improvements I used smart if tag embedded right into Django templates.
I use special custom smart if tag before.

For now it support such cool things like <=, !=, and or not
but it really can’t be used because it doesn’t support parenthesis.
I need to use nested if’s or put that logic to controller layer.
Such things make Django sucks. 😦