Ok,

I've updated to the new Model syntax as shown below and I'm still
getting "No sites matched your search criteria" in the admin page when
I put a foreign key in the list_display definition. Everything works
great as soon as I take "thing" out of the list_display.

I've also tried adding db_column='name' to the Entry.thing definition,
but that just throws the following exception:
OperationalError: (1054, "Unknown column 'isg_db_sites.name' in 'field
list'")

I guess a more succinct way to phrase my question would be - How can I
refer to ForeignKeys from a Model instance? All the documentation seems
to tell me that the following should work, but I'm obviously missing
something.
Any assistance is greatly appreciated.

------------------
class Thing(meta.Model):
    name = meta.CharField(maxlength=60, primary_key=True),

class Entry(meta.Model):
    def __repr__(self):
        return self.name

    name = meta.CharField(maxlength=60, primary_key=True),
    thing = meta.ForeignKey(Thing, to_field='name'),

    admin = meta.Admin(
        list_display=('name', 'thing'),
    ) 
------------------

Reply via email to