E
E
Elena Stepanova2015-04-09 15:32:48
Django
Elena Stepanova, 2015-04-09 15:32:48

How to properly organize the api of an extensible application according to the django.contrib.admin type?

The task is essentially this - a basic application with a type template that displays data

<body>
    <header>{%blok head%}SomeData{%endblok%}</header>
     <div class="wrapper">
          <aside>{%blok sidebar%}Somedata{%endblok%}</aside>
         <div class="content">{%blok content%}SomeData{%endblok%}</div>
      </div>
</body>

It is necessary that it picks up data from other INSTALLED_APPS and supplements After looking at the sources of admin_tools, grapelli
In principle, it is essentially clear - we make base classes like BaseSideBar, BaseHead with the necessary parameters, etc. we look for and register their successors in applications and make template tags for output, but maybe there is some more specific documentation and / or examples on this topic?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anatoly Scherbakov, 2015-04-10
@Altaisoft

The question is not at all clear.
- First, block , not blok .
- Second, it's not at all necessary that you actually need to make classes for things like the header or the sidebar. Actually, there is no such thing in django.contrib.admin , as far as I remember. There are other classes there - AdminSite , ModelAdmin , TabularInline , StackedInline , ChangeList , etc.
- Thirdly, how are you going to "register" your classes somewhere else, and where?
You are overcomplicating.

E
Elena Stepanova, 2015-04-10
@Insolita

https://github.com/sehmaschine/django-grappelli/bl... - registrar
https://github.com/sehmaschine/django-grappelli/bl... - the base class
is that application 1 registers its items in the sidebar, css in the header, etc. Appendix 2 - own points, and when you enter, all srau should be displayed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question