I have one model that looks like this: class Position(models.Model): base = models.ManyToManyField("Base", through="PosBase", blank=True) [...]
class PosBase(models.Model): position = models.ForeignKey("Position") base = models.ForeignKey("Base") class Base(models.Model): name = models.CharField(max_length=32) Pretty straightforward... Then I have another three-way object, but it's connected to the PosBase object like so: class Route(models.Model): posbase = models.ManyToManyField("PosBase", through="RouteBase", blank=True) [...] class RouteBase(models.Model): position = models.ForeignKey("Position") base = models.ForeignKey("Base") class Base(models.Model): name = models.CharField(max_length=32 I have an Inline set up so I can add/edit PosBase objects in the Position admin page. I also have an inline set up to add/edit Route objects from the PosBase admin page. I would like it so the Route inline shows up under the Posbase inline on the Position page, but I think thats asking too much. Is it indeed possible? If it's impossible, then I would at least like to find out if theres a way to set up a sane __unicode__ function for PosBase. The only really important thing that I need displayed is the position name and the base name. Both of those attributes are connected via a join, which means I need to run a query, correct? I tried this: def __unicode__(self): p = PosBase.object.get(pk=self.pk) b = p.base.identifier return u"%s - %s" ("pb", "b") But it don't work. Help! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---