summaryrefslogtreecommitdiff
path: root/bak/unused_apps/stuff/admin.py
blob: 135b17bead7e9f6710b4d668c23c03027cca9c92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from django.contrib import admin
from .models import Item


@admin.register(Item)
class ItemAdmin(admin.ModelAdmin):
    list_display = (
        'title',
        'admin_thumbnail',
        'item_type',
        'creator',
        'purchase_price',
        'item_format',
        'isbn'
    )
    list_filter = ['item_format', 'item_type']

    fieldsets = (
        ('Item', {
            'fields': (
                'title',
                ('date_purchased', 'date_added'),
                'item_format',
                'purchase_price',
                'image',
                'item_type',
                'creator',
                'serial_number',
                'isbn',
            ),
            'classes': (
                'show',
                'extrapretty',
                'wide'
            )
        }
        ),
        ('Extra', {
            'fields': (
                'creator_sort_last_name',
                'creator_sort_first_name',
                'current_price',
                'retail_price',
                'amazon_url',
                'image_url',
            ),
            'classes': (
                'collapse',
                'extrapretty',
                'wide'
            )
        }),
    )

    class Media:
        js = ('image-loader.js', 'next-prev-links.js')