django-polymorphic icon indicating copy to clipboard operation
django-polymorphic copied to clipboard

PolymorphicChildModelAdmin list displays base model of foreignkey fields

Open variable opened this issue 10 years ago • 1 comments

I am aware of the polymorphic_list field in the PolymorphicParentModelAdmin, but I am using PolymorphicChildModelAdmin, and I am wondering if it's possible to display the relationship field to it's child class.

e.g


class Vote(Model):
  #  item can be "Content", "User" which extends "Trackable"
  item = Trackable(..)

When I display the admin list, the item is always displayed as "Trackable"

variable avatar Sep 15 '15 21:09 variable

I'm not sure I get this.. You have a VoteAdmin or TrackableAdmin child? could you post a more complete example? the code you show clearly isn't Django model code, I'd expect it to be:

class Vote(models.Model):
    item = models.ForeignKey(Trackable)

vdboor avatar Oct 01 '15 11:10 vdboor