I have the following class as one of my model classes:

class OrderDetail(meta.Model):
    item_group = meta.OneToOneField(itemgroups.ItemGroup)
    parents_names = meta.CharField(maxlength=100)
    birth_date = meta.CharField(maxlength=100)
    birth_time = meta.CharField(maxlength=100)
    birth_weight = meta.CharField(maxlength=100)
    birth_length = meta.CharField(maxlength=100)
    announcement_text = meta.CharField(maxlength=100)
    other_instructions = meta.CharField(maxlength=100)
    color = meta.CharField(maxlength=100)
    copyright_release = meta.CharField(maxlength=100)
    def __repr__(self):
        return self.parents_names
    class META:
        admin = meta.Admin()

When I try to view the admin page for this class, I get:

OperationalError at /admin/store/orderdetails/
(1109, "Unknown table 'store_itemgroups' in order clause")
Request Method:         GET
Request URL:    http://localhost:8000/admin/store/orderdetails/
Exception Type:         OperationalError
Exception Value:        (1109, "Unknown table 'store_itemgroups' in order 
clause")
Exception Location: /usr/local/apps/python2.4/lib/python2.4/site-packages/MySQL_python-1.2.0-py2.4-linux-i686.egg/MySQLdb/connections.py in defaulterrorhandler, line 32



It's complaining about the store_itemgroups table not existing, but it exists. Here is the class definition:

class ItemGroup(meta.Model):
    #product_group_name = meta.CharField(maxlength=100)
    product_group = meta.ForeignKey(ProductGroup)
    customer_order = meta.ForeignKey(CustomerOrder)
    def __repr__(self):
        return self.get_product_group().name
        #return self.product_group_name
    class META:
        admin = meta.Admin()

and I can see it in PhpMyAdmin and have inserted data into it through Django. This may not be a big deal since I'm probably going to tie these two classes to one parent class, but I'd still be interested in seeing this work as I think it ought to.

- jmj

Reply via email to