On Aug 2, 2005, at 12:17 PM, raffaele messuti wrote:
class Label(meta.Model):
fields = (
meta.CharField('name', 'name', maxlength=200,
core=True),
meta.URLField('url', 'url', blank=True, core=True),
)
#admin = meta.Admin()
def __repr__(self):
return self.name
class Artist(meta.Model):
fields = (
meta.ForeignKey(Label, edit_inline=True),
meta.CharField('name', maxlength=200),
meta.URLField('url', blank=True)
)
admin = meta.Admin()
def __repr__(self):
return self.name
You've got the admin objects backwards -- if an object is edit_inline
on another object, it should not have its own admin, and the related-
to object needs to have an admin. So, you should do this:
class Label(meta.Model):
fields = (
meta.CharField('name', 'name', maxlength=200,
core=True),
meta.URLField('url', 'url', blank=True, core=True),
)
admin = meta.Admin()
class Artist(meta.Model):
fields = (
meta.ForeignKey(Label, edit_inline=True),
meta.CharField('name', maxlength=200),
meta.URLField('url', blank=True)
)
# Note: no admin!
Jacob