You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

35 lines
910 B

from django.contrib import admin
from cash.models import *
class AccountAdmin(admin.ModelAdmin):
list_display = ('user', 'card_number', 'credit')
class ProductBarcodeInline(admin.TabularInline):
model = ProductBarcode
extra = 1
class ProductAdmin(admin.ModelAdmin):
list_display = ('name', 'category', 'price')
list_filter = ['category']
inlines= [ProductBarcodeInline]
class ProductCategoryAdmin(admin.ModelAdmin):
list_display = ('name', 'comment')
class SalesLogEntryAdmin(admin.ModelAdmin):
list_display = ('account', 'timestamp', 'product', 'count', 'unit_price')
list_filter = ['account', 'timestamp', 'product']
admin.site.register(Account, AccountAdmin)
admin.site.register(Product, ProductAdmin)
admin.site.register(ProductBarcode)
admin.site.register(ProductCategory, ProductCategoryAdmin)
admin.site.register(Transaction)
admin.site.register(SalesLogEntry, SalesLogEntryAdmin)