Hi all,

I'm having some problems and I've isolated them in a small example. I
have the following data model:

class Currency(meta.Model):
    name = meta.CharField(maxlength=5)

    def __repr__(self):
        return self.name

    class META:
        admin = meta.Admin()

class CustomData(meta.Model):
    amount = meta.IntegerField()
    loan = meta.IntegerField()
    currency = meta.ForeignKey(Currency, to_field='name')

    def __repr__(self):
        return self.amount

    class META:
        admin = meta.Admin(
            list_display = ('amount', 'loan', 'currency'),
        )

Now, addinga a currency works fine. Trying to add a customdata, when
saving, yelds a template exception. I've read on this group that this
might be because something's wrong in the model. Any ideas?

The other problem is that with the current list_display in CustomData,
there is no listing of the items. Just "3 custom datas". Once I remove
'currency' from list_display, I get them listed ok. This is driving me
mad. I'm probably doing something wrong, but I can't figure out what.

Thanks,
Andu

Reply via email to