On Nov 18, 10:50 pm, Wayne <wayneshen...@gmail.com> wrote:
> Thanks for your reply.
>
> My situation is a little bit more tricky. I have table A and table B.
> Table B has several columns, two of which are tableID and resourceID.
> Table B is related to table A in the following way:
> select * from table B where b.tableID= (table A) and b.resourceID=
> (primary key of table A). There is no composite foreign key support in
> Django and the database can not be changed. Is there a way to still
> relate those two objects and display them in the Django provided
> inline admin interface?
>
> Wayne

You may be in luck. The table structure you describe is almost exactly
how generic relations[1] are implemented in Django - and there is a
GenericInlineModelAdmin class which allows you to use generic
relations as inlines in the admin. So it looks like all you'd need to
do would be to set up the generic relation using your tableID and
resourceID fields instead of the default object_id and content_type,
populate the ContentTypes table with the tableID values, set up the
generic inline, and you should be in business.
--
DR.

[1]:http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.


Reply via email to