[socal-piggies] Django vs. TG

Titus Brown titus at caltech.edu
Thu Nov 30 22:27:31 PST 2006


On Thu, Nov 30, 2006 at 01:07:10PM -0800, Steve Wedig wrote:
-> Interesting comparison that was sent out toe the django user list...
-> 
-> 
-> 2. Inheritance for tables in DB. Structure of the information in
-> the project allows to organize it in a set of tables related by
-> inheritance. PostgreSQL has this inheritance in declaration of
-> tables. Similar inheritance is implemented in TurboGears (both
-> in SQLObject and SQLAlchemy). Django also has inheritance
-> in the class declaration corresponding to the tables, but use
-> of it leads to creation of separate, unconnected tables, so that
-> the derived table has all columns of the parent table plus
-> columns declared in the derived class itself. What can be
-> used in Django to build similar structure is OneToOneField.
-> But the implementation of the manipulators lies on the
-> programmer. A minor complication is the name of
-> OneToOneField. It should be not id (as all other primary key
-> columns are) but parent_id, where parent is the name of the
-> related table. Probably, this is forced by some reasons for
-> other usages of the field, but in simulating inheritance in the
-> desired sense this needs special care.
-> This point is definitely won by TurboGears.

After skimming/reading the whole thing, I came to the conclusion that
*this* was the deciding issue.  Interesting.

--titus




More information about the socal-piggies mailing list