I want use a model to save the system setting for a django app, So I want to limit the model can only have one record, how to do the limit?
A:
An easy way is to use the setting's name as the primary key in the settings table. There can't be more of one record with the same primary key, so that will allow both Django and the database to guarantee integrity.
John Feminella
2010-01-21 04:00:54