mods to django admin
This commit is contained in:
@@ -5,18 +5,19 @@ 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')
|
||||
list_display = ('name', 'category', 'sourcing_date', 'company_name', 'active' )
|
||||
list_filter = ('company', 'tags', 'category', 'attributes')
|
||||
search_fields = ('name', 'sku', 'description')
|
||||
|
||||
def company_name(self, product):
|
||||
return product.company.company_name
|
||||
|
||||
'''
|
||||
class ProductInline(admin.TabularInline):
|
||||
model = models.Product
|
||||
form = forms.ProductTagForm
|
||||
'''
|
||||
|
||||
admin.site.register(models.Product, ProductAdmin)
|
||||
admin.site.register(models.TreeTag)
|
||||
|
||||
Reference in New Issue
Block a user