On Jan 12, 5:32 am, Mike Thon <[email protected]> wrote: > I have an object in my model that has a OneToOne relationship with an > object in another app. I would like to customize the way my object is > displayed in the admin interface by subclassing ModelAdmin as shown in > the tutorial. I'm not sure how to reference fields across the > OneToOne relationship - i.e. I want to show fields from the object > referenced by the OneToOne relationship in the admin interface. Is > there any way to do this? > Thanks > Mike
If you're talking about the add/edit view, you can't show fields from a OneToOne relationship directly in the main editing area. What you can do is define the related model as an inline, so all its fields appear in a separate box underneath the main model. See http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#inlinemodeladmin-objects - the document shows an example with ForeignKey fields, but it works just as well with OneToOnes. -- DR.
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

