forked from abidibo/aidsbank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.py
67 lines (51 loc) · 1.31 KB
/
admin.py
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
57
58
59
60
61
62
63
64
65
66
67
from django.contrib import admin
from aidsbank.models import Manager, Applicant, Centre, AidType, Aid, Asset, Movement, Loan
"""
Manager
"""
class ManagerAdmin(admin.ModelAdmin):
list_display = ('user', 'get_centres_display',)
admin.site.register(Manager, ManagerAdmin)
"""
Applicant
"""
class ApplicantAdmin(admin.ModelAdmin):
list_display = ('user',)
admin.site.register(Applicant, ApplicantAdmin)
"""
Centre
"""
class CentreAdmin(admin.ModelAdmin):
list_display = ('name',)
admin.site.register(Centre, CentreAdmin)
"""
AidType
"""
class AidTypeAdmin(admin.ModelAdmin):
list_display = ('name',)
admin.site.register(AidType, AidTypeAdmin)
"""
Aid
"""
class AidAdmin(admin.ModelAdmin):
list_display = ('name', 'code', 'type', )
prepopulated_fields = {"slug": ("name",)}
admin.site.register(Aid, AidAdmin)
"""
Asset
"""
class AssetAdmin(admin.ModelAdmin):
list_display = ('code', 'aid', 'centre', 'vendor', 'price',)
admin.site.register(Asset, AssetAdmin)
"""
Loan
"""
class LoanAdmin(admin.ModelAdmin):
list_display = ('asset', 'applicant', 'place', 'reservation_date', 'loan_date', 'status', )
admin.site.register(Loan, LoanAdmin)
"""
Movement
"""
class MovementAdmin(admin.ModelAdmin):
list_display = ('asset', 'manager', 'date', 'status', )
admin.site.register(Movement, MovementAdmin)