Re: single-row database tables for properties

2006-09-21 Thread [EMAIL PROTECTED]
Here's my example then: class Property(models.Model): class Admin: pass showGone = models.BooleanField(default=False) goneGroup = models.CharField(maxlength=100) def save(self): """ save, but set id to 1 """ self.id=1 super(Property, self).save()

Re: single-row database tables for properties

2006-09-21 Thread Ned Batchelder
[EMAIL PROTECTED] wrote: > No you dont need a different table for each property, one table stores > all the properties that you want to collect together. > > The problem with the (name,value) approach is that all the values have > to be the same type, so you cant present some properties as text, s

Re: single-row database tables for properties

2006-09-21 Thread [EMAIL PROTECTED]
No you dont need a different table for each property, one table stores all the properties that you want to collect together. The problem with the (name,value) approach is that all the values have to be the same type, so you cant present some properties as text, some as boolean, and some as drop-d

Re: single-row database tables for properties

2006-09-20 Thread Ned Batchelder
[EMAIL PROTECTED] wrote: > I wanted a way to store 'properties' - single values over an app (or > project) that control the apps behaviour, for example a title to appear > on the page, or whether to display threads expanded or not in a forum. > I thought it would be nice to have these settings con

single-row database tables for properties

2006-09-20 Thread [EMAIL PROTECTED]
I wanted a way to store 'properties' - single values over an app (or project) that control the apps behaviour, for example a title to appear on the page, or whether to display threads expanded or not in a forum. I thought it would be nice to have these settings configurable from the Admin interfac