|
setup
SetupFor using Grappelli, you have to follow some rules when it comes to your projects setup. Registering ModelsNote: This is only relevant if you use different Admin Site Objects. Grappelli assumes, that every Model is registered with your Main Admin Site. This is necessary, because with the Original Django Admin-Interface, the Links for Related Lookups are relative. This means that you have to register every Related Model within every Admin Site Object (which is senseless, from my point of view). In order to avoid rewriting/customizing dozens of templates, we changed the Links for the Related Lookups to point to your Main Admin Site. So, what actually is your Main Admin Site? It´s the Admin Site Object where all your Models are registered, usually done with admin.autodiscover(). It´s important that you change ADMIN_URL within the Grappelli setttings accordingly. Defining Generic RelationsIn order to use Visual Generic Relationships, you have to use the names content_type and object_id for defining generic relations, see Generic Relationships for more on this issue. |
Sign in to add a comment