34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from django.contrib import admin
|
|
|
|
from .models import Item, ItemNote, ItemPhoto, ItemTemplate, PriceEstimate
|
|
|
|
|
|
@admin.register(ItemTemplate)
|
|
class ItemTemplateAdmin(admin.ModelAdmin):
|
|
list_display = ("name", "category", "is_active", "updated_at")
|
|
search_fields = ("name", "category", "description")
|
|
list_filter = ("is_active", "category")
|
|
|
|
|
|
@admin.register(Item)
|
|
class ItemAdmin(admin.ModelAdmin):
|
|
list_display = ("title", "category", "status", "purchase_price", "sold_price", "created_by", "created_at")
|
|
search_fields = ("title", "brand", "category", "notes", "created_by__username")
|
|
list_filter = ("status", "category", "created_by")
|
|
|
|
|
|
@admin.register(PriceEstimate)
|
|
class PriceEstimateAdmin(admin.ModelAdmin):
|
|
list_display = ("item", "source", "estimated_price", "retrieved_at")
|
|
search_fields = ("item__title", "source", "notes")
|
|
|
|
|
|
@admin.register(ItemNote)
|
|
class ItemNoteAdmin(admin.ModelAdmin):
|
|
list_display = ("item", "created_by", "created_at")
|
|
|
|
|
|
@admin.register(ItemPhoto)
|
|
class ItemPhotoAdmin(admin.ModelAdmin):
|
|
list_display = ("item", "uploaded_at")
|