Issue
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?
Solution
An easy way is to use the setting's name as the primary key in the settings table. There can't be more than one record with the same primary key, so that will allow both Django and the database to guarantee integrity.
Answered By - John Feminella
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.