I'm not sure exactly the nature of the problem you're trying to solve, but it sounds curious like the Google App Engine BigTable Expando .
Expandos allows you to specify and store additional fields for an instance of an object with database support at run time. Quote from the docs:
import datetime from google.appengine.ext import db class Song(db.Expando): title = db.StringProperty() crazy = Song(title='Crazy like a diamond', author='Lucy Sky', publish_date='yesterday', rating=5.0) crazy.last_minute_note=db.Text('Get a train to the station.')
The Google App Engine currently supports both Python and Django. It may be worth a look if this is the best way to express your patterns.
Traditional relational database models do not have the flexibility to add columns. If your data types are simple enough, you can abandon the traditional RDBMS philosophy and hack values into a single column through serialization, as @Ned Batchelder suggests; however, if you need to use an RDBMS, inheriting a Django model is probably the way out. Notably, it will create a one-to-one foreign key relationship for each output level.
cdleary Dec 31 '09 at 7:09 2008-12-31 07:09
source share