Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16740 closed New feature (invalid)

"Derived Class"

Reported by: anonymous Owned by: nobody
Component: Database layer (models, ORM) Version: 1.3
Severity: Normal Keywords: Derived class, models
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

A feature you can create derived classes.
For example:

Class ClassA(models.Model):
    name = models.CharField()
    age  = models.IntergerField()

class ClassB(models.Model):
    serial = models.CharField()

class DerivedClass(models.Model):
    class Meta:
        derived = (ClassA, ClassB)
    name = models.CharField(derived = ClassA, attr = name)
    serial = models.CharField(derived = ClassB, attr = serial)

Change History (2)

comment:1 by Russell Keith-Magee, 13 years ago

Resolution: invalid
Status: newclosed

It seems to me that you've come up with a very complex notation as an alternative to model inheritance (which is already supported in Django):

class ClassA(models.Model):
    name = models.CharField()
    age  = models.IntergerField()

class ClassB(models.Model):
    serial = models.CharField()

class DerivedClass(ClassA, ClassB):
    pass

If I've missed something here, feel free to reopen and elaborate on what it is you're trying to achieve.

comment:2 by Jacob, 13 years ago

milestone: 1.4

Milestone 1.4 deleted

Note: See TracTickets for help on using tickets.
Back to Top