2020-12-27 01:33:07 +01:00
|
|
|
from django.contrib import admin
|
|
|
|
from .models import Offer, Offer_Category, Image_offer
|
|
|
|
|
|
|
|
# Register your models here.
|
|
|
|
class OfferALlDetail(admin.StackedInline):
|
|
|
|
model = Image_offer
|
|
|
|
can_delete = True
|
|
|
|
verbose_name = 'Image'
|
|
|
|
|
|
|
|
class OfferAdmin(admin.ModelAdmin):
|
|
|
|
model = Offer
|
|
|
|
inlines = [OfferALlDetail]
|
2021-01-08 22:23:52 +01:00
|
|
|
list_display = ('id','title','category','date_added','status',)
|
|
|
|
order = 'date_added'
|
|
|
|
|
2020-12-27 01:33:07 +01:00
|
|
|
admin.site.register(Offer,OfferAdmin)
|
|
|
|
admin.site.register(Offer_Category)
|