Guest User

Untitled

a guest
Dec 11th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. from django.contrib import admin
  2. from .models import *
  3.  
  4.  
  5. class AuctionAdmin(admin.ModelAdmin):
  6. list_display = ['title', 'current_bid_display', 'bid_count', 'expiry_date', 'active']
  7.  
  8. def current_bid_display(self, obj):
  9. return "£{0}".format(obj.current_bid)
  10.  
  11.  
  12. class BidAdmin(admin.ModelAdmin):
  13. list_display = ['auction', 'value', 'owner', 'created_at']
  14. list_filter = (
  15. ('auction',)
  16. )
  17.  
  18.  
  19. admin.site.register(Auction, AuctionAdmin)
  20. admin.site.register(Bid, BidAdmin)
Add Comment
Please, Sign In to add comment