# apps/listings/admin.py

# Django modules
from django.contrib import admin

# Locals
from apps.listings.models import Category, Product

# Register your models here.


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


@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
	list_display =('name', 'category', 'slug', 'price', 'available')
	list_filter = ('category', 'available')
	list_editable = ('price', 'available')
	prepopulated_fields = {'slug': ('name',)}
# apps/listings/admin.py

# Django modules
from django.contrib import admin

# Locals
from apps.listings.models import Category, Product

# Register your models here.


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


@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
	list_display =('name', 'category', 'slug', 'price', 'available')
	list_filter = ('category', 'available')
	list_editable = ('price', 'available')
	prepopulated_fields = {'slug': ('name',)}
# apps/listings/admin.py # Django modules # Locals # Register your models here.