from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import gettext_lazy as _
from .models import Neighbourhood,Post,Business,Profile, User


class ProfileAdmin(admin.ModelAdmin):
    model = Profile
    list_display = ['name', 'id']

class CustomUserAdmin(UserAdmin):
    model = User
    fieldsets = (
        (None, {'fields': ('username', 'password', 'neighbourhood')}),
        (_('Personal info'), {'fields': ('first_name', 'last_name', 'email')}),
        (_('Permissions'), {
            'fields': ('is_active', 'is_staff', 'is_superuser', 'groups', 'user_permissions'),
        }),
        (_('Important dates'), {'fields': ('last_login', 'date_joined')})
    )

class NeighbourhoodAdmin(admin.ModelAdmin):
    model = Neighbourhood
    

# Register your models here.
admin.site.register(Neighbourhood)
admin.site.register(Post)
admin.site.register(Business)
admin.site.register(Profile, ProfileAdmin)
admin.site.register(User, CustomUserAdmin)
