Execute the following with the following models table
pi = PlayableItem(funfactor=33,code='PS2',description='Play station 2')
You'll get the error back
TypeError: 'code' is an invalid keyword argument for this function
models.py is
from django.db import models
import datetime
class BaseModel(models.Model):
"""Abstract class used for some common fields"""
created_at = models.DateTimeField(blank=True, default=datetime.datetime.now)
modified_at = models.DateTimeField(blank=True, default=datetime.datetime.now)
class Meta:
abstract = True
class Item(BaseModel):
"""Everything in the system - multi table inheritance"""
code = models.CharField(blank=True, max_length=15) # A shortname
description = models.CharField(blank=True, max_length=50)
class ValuedItem(Item):
"""This is an abstract base class for stuff with a value"""
value = models.FloatField(default=0.0)
class Meta:
abstract = True
class PlayableItem(ValuedItem):
"""Inheriting from our abstract ValuedItem class"""
funfactor = models.IntegerField(blank=True, null=True) # Amount of fun
This is a simplified mockup of something I was trying to do for real with various abstract and multi table classes. I made this test version just to reproduce and report the error. Having enquired in django-users was advised to file a bug report.
This is with checkout from svn - Revision: 7811. psycopg2 backend. python2.5