from django.contrib import admin
from .models import Endereco, Cliente
from .models import Funcionario, Venda
from .models import Mercadoria, Fornecedor, Conta_a_pagar, Conta_a_receber, Compra

from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import Group

from .forms import UserChangeFormAdmin, UserCreationForm

from .models import CustomUser

# Register your models here.

admin.site.register(Endereco)
admin.site.register(Funcionario)
admin.site.register(Mercadoria)
admin.site.register(Fornecedor)
admin.site.register(Compra)
admin.site.register(Conta_a_receber)
admin.site.register(Conta_a_pagar)
admin.site.register(Venda)
admin.site.register(Cliente)


@admin.register(CustomUser)
class UserAdmin(UserAdmin):
    fieldsets = (
        (None, {'fields': ('cpf', 'password')}),
        (u'Informacoes pessoais', {'fields': ('full_name', 'email', 'type')}),
        (u'Permissoes', {'fields': ('is_staff', 'is_active', 'is_superuser',
                                    'groups', 'user_permissions')}),
        ('Datas importantes', {'fields': ('last_login', 'date_joined')})
    )
    add_fieldsets = (
        (None, {
            'classes': ('wide',),
            'fields': ('cpf', 'full_name', 'email', 'type', 'password1', 'password2')
        }),
    )
    form = UserChangeFormAdmin
    add_form = UserCreationForm
    list_display = ('cpf', 'full_name', 'email', 'type', 'is_staff')
    list_filter = ('is_staff', 'is_active')
    search_fields = ('cpf', 'email')
    ordering = ('cpf', 'email')
    filter_horizontal = ('groups', 'user_permissions',)


admin.site.unregister(Group)

70fd529bb45673d8a39afcc2d8b5048fafe00cd6
<mask token>


@admin.register(CustomUser)
class UserAdmin(UserAdmin):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>


<mask token>

<mask token>


@admin.register(CustomUser)
class UserAdmin(UserAdmin):
    fieldsets = (None, {'fields': ('cpf', 'password')}), (
        u'Informacoes pessoais', {'fields': ('full_name', 'email', 'type')}), (
        u'Permissoes', {'fields': ('is_staff', 'is_active', 'is_superuser',
        'groups', 'user_permissions')}), ('Datas importantes', {'fields': (
        'last_login', 'date_joined')})
    add_fieldsets = (None, {'classes': ('wide',), 'fields': ('cpf',
        'full_name', 'email', 'type', 'password1', 'password2')}),
    form = UserChangeFormAdmin
    add_form = UserCreationForm
    list_display = 'cpf', 'full_name', 'email', 'type', 'is_staff'
    list_filter = 'is_staff', 'is_active'
    search_fields = 'cpf', 'email'
    ordering = 'cpf', 'email'
    filter_horizontal = 'groups', 'user_permissions'


<mask token>

<mask token>
admin.site.register(Endereco)
admin.site.register(Funcionario)
admin.site.register(Mercadoria)
admin.site.register(Fornecedor)
admin.site.register(Compra)
admin.site.register(Conta_a_receber)
admin.site.register(Conta_a_pagar)
admin.site.register(Venda)
admin.site.register(Cliente)


@admin.register(CustomUser)
class UserAdmin(UserAdmin):
    fieldsets = (None, {'fields': ('cpf', 'password')}), (
        u'Informacoes pessoais', {'fields': ('full_name', 'email', 'type')}), (
        u'Permissoes', {'fields': ('is_staff', 'is_active', 'is_superuser',
        'groups', 'user_permissions')}), ('Datas importantes', {'fields': (
        'last_login', 'date_joined')})
    add_fieldsets = (None, {'classes': ('wide',), 'fields': ('cpf',
        'full_name', 'email', 'type', 'password1', 'password2')}),
    form = UserChangeFormAdmin
    add_form = UserCreationForm
    list_display = 'cpf', 'full_name', 'email', 'type', 'is_staff'
    list_filter = 'is_staff', 'is_active'
    search_fields = 'cpf', 'email'
    ordering = 'cpf', 'email'
    filter_horizontal = 'groups', 'user_permissions'


admin.site.unregister(Group)

from django.contrib import admin
from .models import Endereco, Cliente
from .models import Funcionario, Venda
from .models import Mercadoria, Fornecedor, Conta_a_pagar, Conta_a_receber, Compra
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import Group
from .forms import UserChangeFormAdmin, UserCreationForm
from .models import CustomUser
admin.site.register(Endereco)
admin.site.register(Funcionario)
admin.site.register(Mercadoria)
admin.site.register(Fornecedor)
admin.site.register(Compra)
admin.site.register(Conta_a_receber)
admin.site.register(Conta_a_pagar)
admin.site.register(Venda)
admin.site.register(Cliente)


@admin.register(CustomUser)
class UserAdmin(UserAdmin):
    fieldsets = (None, {'fields': ('cpf', 'password')}), (
        u'Informacoes pessoais', {'fields': ('full_name', 'email', 'type')}), (
        u'Permissoes', {'fields': ('is_staff', 'is_active', 'is_superuser',
        'groups', 'user_permissions')}), ('Datas importantes', {'fields': (
        'last_login', 'date_joined')})
    add_fieldsets = (None, {'classes': ('wide',), 'fields': ('cpf',
        'full_name', 'email', 'type', 'password1', 'password2')}),
    form = UserChangeFormAdmin
    add_form = UserCreationForm
    list_display = 'cpf', 'full_name', 'email', 'type', 'is_staff'
    list_filter = 'is_staff', 'is_active'
    search_fields = 'cpf', 'email'
    ordering = 'cpf', 'email'
    filter_horizontal = 'groups', 'user_permissions'


admin.site.unregister(Group)

from django.contrib import admin
from .models import Endereco, Cliente
from .models import Funcionario, Venda
from .models import Mercadoria, Fornecedor, Conta_a_pagar, Conta_a_receber, Compra

from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import Group

from .forms import UserChangeFormAdmin, UserCreationForm

from .models import CustomUser

# Register your models here.

admin.site.register(Endereco)
admin.site.register(Funcionario)
admin.site.register(Mercadoria)
admin.site.register(Fornecedor)
admin.site.register(Compra)
admin.site.register(Conta_a_receber)
admin.site.register(Conta_a_pagar)
admin.site.register(Venda)
admin.site.register(Cliente)


@admin.register(CustomUser)
class UserAdmin(UserAdmin):
    fieldsets = (
        (None, {'fields': ('cpf', 'password')}),
        (u'Informacoes pessoais', {'fields': ('full_name', 'email', 'type')}),
        (u'Permissoes', {'fields': ('is_staff', 'is_active', 'is_superuser',
                                    'groups', 'user_permissions')}),
        ('Datas importantes', {'fields': ('last_login', 'date_joined')})
    )
    add_fieldsets = (
        (None, {
            'classes': ('wide',),
            'fields': ('cpf', 'full_name', 'email', 'type', 'password1', 'password2')
        }),
    )
    form = UserChangeFormAdmin
    add_form = UserCreationForm
    list_display = ('cpf', 'full_name', 'email', 'type', 'is_staff')
    list_filter = ('is_staff', 'is_active')
    search_fields = ('cpf', 'email')
    ordering = ('cpf', 'email')
    filter_horizontal = ('groups', 'user_permissions',)


admin.site.unregister(Group)
