MASSIVE UPDATE:
bounty board feature buyers to see bounty boards seller profile page (like have theme chooser) Have the game and set name be filters. Add cards to vault manually update card inventory add to have the autocomplete for the card - store analytics, clicks, views, link to store (url/QR code) bulk item inventory creation -- Make the banner feature flag driven so I can have a beta site setup like the primary site don't use primary key values in urls - update to use uuid4 values site analytics. tianji is being sent item potent on the mtg and lorcana populate scripts Card item images for specific listings check that when you buy a card it is in the vault Buys should be able to search on store inventories More pie charts for the seller! post bounty board is slow to load seller reviews/ratings - show a historgram - need a way for someone to rate Report a seller feature for buyer to report Make sure the stlying is consistent based on the theme choosen smart minimum order quantity and shipping amounts (defined by the store itself) put virtual packs behind a feature flag like bounty board proxy service feature flag Terms of Service new description for TCGKof store SSN, ITIN, and EIN optomize for SEO
This commit is contained in:
@@ -1,3 +1,91 @@
|
||||
from django.contrib import admin
|
||||
from .models import Seller, Game, Set, Card, CardListing, PackListing, VirtualPack, Order, OrderItem, Cart, Bounty, VaultItem
|
||||
|
||||
# Register your models here.
|
||||
@admin.register(Seller)
|
||||
class SellerAdmin(admin.ModelAdmin):
|
||||
list_display = ['store_name', 'user', 'slug', 'created_at']
|
||||
search_fields = ['store_name', 'user__username']
|
||||
|
||||
@admin.register(Game)
|
||||
class GameAdmin(admin.ModelAdmin):
|
||||
list_display = ['name', 'slug']
|
||||
|
||||
@admin.register(Set)
|
||||
class SetAdmin(admin.ModelAdmin):
|
||||
list_display = ['name', 'game', 'code', 'release_date']
|
||||
list_select_related = ['game']
|
||||
search_fields = ['name', 'code']
|
||||
list_filter = ['game']
|
||||
|
||||
class CardListingInline(admin.StackedInline):
|
||||
model = CardListing
|
||||
extra = 0
|
||||
autocomplete_fields = ['seller']
|
||||
|
||||
@admin.register(Card)
|
||||
class CardAdmin(admin.ModelAdmin):
|
||||
list_display = ['name', 'set', 'rarity', 'collector_number', 'scryfall_id', 'uuid']
|
||||
list_select_related = ['set', 'set__game']
|
||||
search_fields = ['name', 'set__name', 'collector_number', 'uuid']
|
||||
list_filter = ['set__game', 'rarity']
|
||||
inlines = [CardListingInline]
|
||||
|
||||
@admin.register(CardListing)
|
||||
class CardListingAdmin(admin.ModelAdmin):
|
||||
list_display = ['card', 'seller', 'condition', 'price', 'status', 'quantity', 'uuid']
|
||||
list_select_related = ['card', 'card__set', 'seller']
|
||||
list_filter = ['status', 'condition', 'is_foil']
|
||||
autocomplete_fields = ['card', 'seller']
|
||||
|
||||
@admin.register(PackListing)
|
||||
class PackListingAdmin(admin.ModelAdmin):
|
||||
list_display = ['name', 'game', 'seller', 'listing_type', 'price', 'uuid']
|
||||
list_select_related = ['game', 'seller']
|
||||
list_filter = ['listing_type', 'game']
|
||||
autocomplete_fields = ['seller']
|
||||
|
||||
@admin.register(VirtualPack)
|
||||
class VirtualPackAdmin(admin.ModelAdmin):
|
||||
list_display = ['listing', 'owner', 'status', 'created_at', 'uuid']
|
||||
list_select_related = ['listing', 'owner', 'owner__user']
|
||||
list_filter = ['status']
|
||||
raw_id_fields = ['owner'] # Buyer might not have search_fields set up yet, safer to use raw_id or just autocomplete if Buyer has search
|
||||
|
||||
@admin.register(Order)
|
||||
class OrderAdmin(admin.ModelAdmin):
|
||||
list_display = ['id', 'uuid', 'buyer_info', 'status', 'total_price', 'created_at']
|
||||
list_select_related = ['buyer', 'buyer__user']
|
||||
list_filter = ['status', 'created_at']
|
||||
|
||||
def buyer_info(self, obj):
|
||||
return obj.buyer.user.username
|
||||
buyer_info.short_description = 'Buyer'
|
||||
|
||||
@admin.register(OrderItem)
|
||||
class OrderItemAdmin(admin.ModelAdmin):
|
||||
list_display = ['order', 'item_description', 'price_at_purchase', 'quantity']
|
||||
list_select_related = ['order', 'listing', 'listing__card', 'pack_listing']
|
||||
|
||||
def item_description(self, obj):
|
||||
if obj.pack_listing:
|
||||
return obj.pack_listing.name
|
||||
return obj.listing.card.name if obj.listing else "Deleted Listing"
|
||||
|
||||
@admin.register(Cart)
|
||||
class CartAdmin(admin.ModelAdmin):
|
||||
list_display = ['buyer', 'created_at', 'insurance']
|
||||
list_select_related = ['buyer', 'buyer__user']
|
||||
|
||||
@admin.register(Bounty)
|
||||
class BountyAdmin(admin.ModelAdmin):
|
||||
list_display = ['card', 'target_price', 'quantity_wanted', 'is_active', 'uuid']
|
||||
list_select_related = ['card', 'card__set']
|
||||
autocomplete_fields = ['card']
|
||||
|
||||
@admin.register(VaultItem)
|
||||
class VaultItemAdmin(admin.ModelAdmin):
|
||||
list_display = ['buyer', 'card', 'quantity', 'added_at']
|
||||
list_select_related = ['buyer', 'buyer__user', 'card', 'card__set']
|
||||
autocomplete_fields = ['card']
|
||||
raw_id_fields = ['buyer']
|
||||
|
||||
Reference in New Issue
Block a user