23 lines
598 B
Python
23 lines
598 B
Python
from django.contrib import admin
|
|
|
|
from . import models
|
|
from . import forms
|
|
|
|
# Register your models here.
|
|
|
|
|
|
def model_admin_callable(co):
|
|
return co.company_name
|
|
|
|
class ProductAdmin(admin.ModelAdmin):
|
|
form = forms.ProductTagForm
|
|
list_display = ('name', 'category', 'sourcing_date', 'company', 'active' )
|
|
list_filter = ('company', 'tags', 'category', 'attributes')
|
|
search_fields = ('name', 'sku', 'description')
|
|
|
|
|
|
admin.site.register(models.Product, ProductAdmin)
|
|
admin.site.register(models.TreeTag)
|
|
admin.site.register(models.CategoryTag)
|
|
admin.site.register(models.AttributeTag)
|