Pages

18 March, 2013

Automatically add all fields to django admin with links between models

Solution is exactly what is written in a title. But a little background. I am always tired with adding all the fields to admin classes (and even classes for new models). And this process is always the same -- easily scriptable thing. It is based on a snippet from djangosnippets.org.

Solution:

Links are not working very well with generic relations.

2 comments:

  1. should i make any change in this code? if no , it doesn't worked

    ReplyDelete
    Replies
    1. I am using now https://github.com/Mimino666/django-admin-autoregister it works much better than my solution.

      Delete