<reponame>JimmyButler25/receipe-api
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
""" converting strings to human readable text """
from django.utils.translation import gettext as _ 
from core import models 

# Extend baseuser admin
class UserAdmin(BaseUserAdmin):
    ordering = ['id']
    list_display = ['email', 'name']
    fieldsets = (
        # we need to find the sections for the field set
        (None, {'fields': ('email', 'password')}),
        (_('Personal Info'), {'fields': ('name',)}),
        (
            _('Permissions'),
            {
                'fields': ('is_active', 'is_staff', 'is_superuser')
            }
        ),
        # add important dates
        (_('Important dates'), {'fields': ('last_login',)})
    )

    # from django admin doc
    """ we need to customize filter to include our email, password """
    add_fieldsets = [
        # title of section
        (None, {
            'classes': ('wide', ),
            'fields': ('email', '<PASSWORD>', '<PASSWORD>')
        }),
    ]
    # run the test


# register the user
admin.site.register(models.User, UserAdmin)
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
""" converting strings to human readable text """
from django.utils.translation import gettext as _ 
from core import models 

# Extend baseuser admin
class UserAdmin(BaseUserAdmin):
    ordering = ['id']
    list_display = ['email', 'name']
    fieldsets = (
        # we need to find the sections for the field set
        (None, {'fields': ('email', 'password')}),
        (_('Personal Info'), {'fields': ('name',)}),
        (
            _('Permissions'),
            {
                'fields': ('is_active', 'is_staff', 'is_superuser')
            }
        ),
        # add important dates
        (_('Important dates'), {'fields': ('last_login',)})
    )

    # from django admin doc
    """ we need to customize filter to include our email, password """
    add_fieldsets = [
        # title of section
        (None, {
            'classes': ('wide', ),
            'fields': ('email', '<PASSWORD>', '<PASSWORD>')
        }),
    ]
    # run the test


# register the user
admin.site.register(models.User, UserAdmin)
converting strings to human readable text # Extend baseuser admin # we need to find the sections for the field set # add important dates # from django admin doc we need to customize filter to include our email, password # title of section # run the test # register the user