Hi,

I'm using Django 1.0.2, psycopg2 and PgSQL 8.3 on Ubuntu...

I've created a models.py with the following structure to represent a
"party model".  The target for this is a simple CRM system.
Structure:

class Party(models.Model):
        class Meta:
                abstract = True

class Organisation(Party):
        name = models.CharField(max_length=100)

class Person(Party):
        first_name = models.CharField(max_length=50)
        last_name = models.CharField(max_length=50)

This generates two tables (product_organisation + product_person) when
I run syncdb.  According to This Week In Django [1], it states that
the model would be flattened into a single table inheritance model [2]
but it doesn't do this.

>From experience with other ORM platforms (nHibernate, custom built),
I'd expect this to flatten out to a table with approximately the
structure:

create table party (
    party_id bigserial,
    type char(1), -- p = party ... o = organisation
    first_name character varying(50),
    last_name character varying(50),
    name character varying(50),
    ...
)

Is there something I am missing here?

Many Thanks,

Chris Smith

[1] 
http://thisweekindjango.com/articles/2008/jun/17/abstract-base-classes-vs-model-tab/
[2] http://martinfowler.com/eaaCatalog/singleTableInheritance.html


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to