from django.contrib import admin
from .models import Category, Product
# Register your models here.

class CategoryAdmin(admin.ModelAdmin):
    list_display = ('name', 'slug')
    prepopulated_fields = {
        'slug': ('name',)
    }


class ProductAdmin(admin.ModelAdmin):
    list_display = ('name', 'user', 'category')
    list_filter = ('category',)
    prepopulated_fields = {
        'slug': ('name',)
    }
admin.site.register(Category, CategoryAdmin)
admin.site.register(Product, ProductAdmin)