On Tuesday 31 January 2006 16:59, kggroups wrote: > I'm considering building my next web app in either Django or Rails > because I'm sick of php. Before I jump in though, I was wondering > how django handles multicolumn keys.
If you need to, you can specify constraints using unique_together - see http://www.djangoproject.com/documentation/model_api/ The Django ORM basically assumes a third normal form database design. It half enforces this by adding a primary key to every table (if you don't specify one yourself), and only allows one field to be a primary key in the class definition. However, there is nothing to stop you adding other constraints (using unique_together or directly on the database), and effectively using that as your primary key. The automatic primary key is needed for things like the admin interface to work i.e. you need a simple way of being able to specify an object to delete. Luke -- "Ineptitude: If you can't learn to do something well, learn to enjoy doing it poorly." (despair.com) Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/ -- "Ineptitude: If you can't learn to do something well, learn to enjoy doing it poorly." (despair.com) Luke Plant || L.Plant.98 (at) cantab.net || http://lukeplant.me.uk/