Model Revisions
OneToOne Fields And The Primary Key Issue
Monday, June 23rd, 2008Django 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 [...]
Authenticating Using Email vs Username
Sunday, May 18th, 2008A few weeks back I posted the full source for user logins and password recovery under Everything A Django Developer Needs To Create Logins. There was a little bit of flack from some very passionate and smart individuals (James Bennet) insisting that this middle ware already exists in "contrib.auth;". On the other hand [...]
Adding Custom Actions To Django Admin Change Forms
Wednesday, November 7th, 2007I recently had a problem where I needed to add a custom action next to "History" and "View on site" in the Django admin change form for a specific model. Normally I would overload the admin template. Problem is I wanted to retain "History" and "View". The approach I took was to [...]
Connecting To Oracle Directly (Without settings.py)
Tuesday, October 23rd, 2007I recently ran into an situation where I needed to connect to both an Oracle DB and my local DB simultaneously in Django. I was porting data between the two. After spending an hour online hunting around for how to use cx_Oracle I finally found a working example. I first got things [...]