How to change field location in Django?

Asked

Viewed 14 times

1

When we register our models on admin.py from Django they are shown as follows::

@admin.register(Beneficio)
class BeneficioAdmin(admin.ModelAdmin):
    list_display = ('nome', 'situacao')

They will be shown this way:

inserir a descrição da imagem aqui

In the image in question, I have all apps registered, Pessoa and Vaga, and they have some fields that I would like them to be in a separate session, rather than being shown where they are. Ex: A named section configuração where I can put Beneficios and Setors. I tried to create an App called configuration only for test purposes and added this following snippet of code on admin.py his:

from django.contrib import admin
from vaga.models import Beneficio


@admin.register(Beneficio)
class BeneficioAdmin(admin.ModelAdmin):
    list_display = ('nome', 'situacao')

However, the benefit is still shown next to Vaga, so it didn’t solve my problem.

Notice that Beneficios and Setor are from different apps, but because of organization I would like them to be close to each other, because there will be a user who will change them frequently.

how this can be done on Django?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.