admin.py 846 Bytes
Newer Older
1
# core django imports
2
from django.contrib import admin
3
# imports from your apps
4
from .models import Bid, Listing, Flag, Rating
5

Daniel W Bond's avatar
Daniel W Bond committed
6

7
8
@admin.register(Bid)
class BidAdmin(admin.ModelAdmin):
Daniel W Bond's avatar
Daniel W Bond committed
9
10
11
12
    list_display = ('id', 'created', 'modified', 'bidder', 'listing',
                    'price', 'text')
    list_filter = ('created', 'modified', 'bidder', 'price')

13
14
15

@admin.register(Listing)
class ListingAdmin(admin.ModelAdmin):
Daniel W Bond's avatar
Daniel W Bond committed
16
17
    list_display = ('id', 'created', 'modified', 'title', 'author', 'isbn',
                    'year', 'edition', 'condition', 'description',
18
19
                    'price', 'exchanged', 'cancelled', 'winning_bid',
                    'date_closed')
20
    list_filter = ('created', 'modified', 'poster', 'condition',
Daniel W Bond's avatar
Daniel W Bond committed
21
                   'price', 'cancelled')
Daniel W Bond's avatar
Daniel W Bond committed
22

Daniel W Bond's avatar
Daniel W Bond committed
23
# expand this later
Daniel W Bond's avatar
Daniel W Bond committed
24
admin.site.register(Flag)
25
admin.site.register(Rating)