Django Aware

Database API Revisions

OneToOne Fields And The Primary Key Issue

Monday, June 23rd, 2008

Django provides one-many ForeignKey, many-many ManyToManyField, and one-one OneToOneField options for defining table relationships. The OneToOneField specifically has recently been the topic of heated debates and ideas. Unlike the other options this field is by always constrained to be a “Primary Key”. The restriction implies that each table may ONLY have one [...]

Django Deserializer Bug On Foreign Key When None

Monday, February 18th, 2008

THis is more for myself than anyone else but remind me to submit this to the bug list. Or at least check if it exists already. When deserializing a model with a foreign key whose value is set to None I get the following exeption:
The Bug

File “/home2/pkenjora/lib/python2.4/django/core/serializers/python.py”, line 82, in Deserializer
[...]

Modify Django To Support Group By Query Function

Sunday, September 9th, 2007

Group by is used extensively in many day to day SQL queries. Although most often it is used for counting sometimes group by comes in handy for creating an artificial unique constraint. For example say you have a list of URLS that are described by a checksum and you wish to query a [...]

Modify Django To Support Binary Order By

Monday, August 20th, 2007

Binary order by is different from simple order by in that it is case sensitive. Python’s string comparison operators are also case sensitive. So for any order_by query on a string column in MySQL the results are not in the order Python expects. This leads to serious problems when you try to [...]