Untitled
raw download clone
PYTHON
views 32
,
size 898 b
def get_fieldsets(self, request, obj=None):

        if request.user.is_superuser:
            fieldsets = [
                ('Empresa',
                 {'fields': ['company', 'type_company', 'fantasy_name', 'company_name', 'cnpj_cpf', 'email',
                             'address_customer', 'open_date', 'closing_date', 'commercial_board', 'commercial_board_state']}),
                ('Responsável', {'fields': ['responsable', 'cpf', 'phone']})
            ]
        else:
            fieldsets = [
                ('Empresa',
                 {'fields': ['type_company', 'fantasy_name', 'company_name', 'cnpj_cpf', 'email', 'address_customer',
                             'open_date', 'closing_date', 'commercial_board', 'commercial_board_state']}),
                ('Responsável', {'fields': ['responsable', 'cpf', 'phone']})
            ]

        return fieldsets
close fullscreen
Login or Register to edit or fork this paste. It's free.