>
> Model inheritance is not the same as object inheritance.
>
> If you are doing non abstract inheritance, then there is no difference
> between a derived model, and a model that has a foreign key to the
> parent class. In a derived model, the foreign key is a OneToOneField,
> with null=False
On Thu, Apr 18, 2013 at 5:11 AM, M Hill wrote:
> I've searched this group for threads related to multitable inheritance. The
> one most similar to my query so far was titled "multiple children in
> multitable inheritance", from Apr. 2008. Like the original poster, I'd
> thought of Bar as a possi
Ok looks reazonable. But be something like:
p = Person(name='test')
s = Student(person=p, course='test course')
or
s = Student(parent=p)
is desirable and easy to implement a copy data from Person instance to
Student.
On Jan 3, 1:02 am, Malcolm Tredinnick
wrote:
> On Fri, 2009-01-02 at 16:29
On Fri, 2009-01-02 at 16:29 -0800, carlopires wrote:
> Hi,
>
> I'm trying Multi Table Inheritance with:
>
> class Person(models.Model):
>name = CharField(max_length=30)
>
> class Student(Person):
>course = CharField(max_length=30)
>
> on db shell:
>
> p = Person(name='Carlo')
> p.save
4 matches
Mail list logo