views:

12

answers:

0

I want to use the django admin app to connect two records (as a parent and child).

Using the admin actions guide here: http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/ I have wrote a function which almost does this by utilises the actions dropdown (on the list view). What I have is the user ticks two records and then selects make connection from the dropdown which triggers my custom function to make the connection between the two (setting the foreignkey of one record to be the other).

However since it is a parent and child relationship the order is important so what I'd like is 2 rows of tickboxes one saying parent and the other saying child. The user would then tick one in each row then then running the function.

So what I'd like to know is what is the best way to do this using the django admin?