jschrewe/django-genericadmin — pull request #5 by respondcreate (2012-02-24 22:58:54+00:00)
Title: Altered code to enable truly polymorphic inlines and have persistent lookup_text.

Hey jschrewe!

I'm working on a django site that needed to have true polymorphic relationships (generic in both directions) between models. Writing the models was easy but, as I'm sure you're well acquainted with, Django's default admin UI was unsatisfactory for managing them. I came across and installed your excellent repo and found that it worked super-well if my inlines were linked to the parent model via a foreign key but, if I had a generic relationship linking it to the parent model and wanted to create a generic relationship moving in the other direction, the javascript failed to find the s and 'kick-in'.

I dove into the javascript to enable this to happen and, while I was in there, also rewrote some code so that the #lookup_text spans were persistent.

I also added some new text to the bottom of the README with an example of the polymorphic model I needed to write and how django-genericadmin enables a great UI for managing it.

Thanks so much for sharing your code...it was a lifesaver! Hopefully these additions/changes will help make it even better.

Cheers!