-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Расширен функционал для работы с зоной администратора (#19)
Пока убрал Предпочтения в рамках амбассадорства. Если надо будет вернём. Расширил админ зону
- Loading branch information
Showing
4 changed files
with
59 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,59 @@ | ||
from django.contrib import admin | ||
|
||
from .models import (Activity, Ambassador, AmbassadorActivity, | ||
AmbassadorPreference, Content, MerchOnShipping, | ||
MerchShipment, Preference, Venue) | ||
from .models import (Activity, Ambassador, AmbassadorActivity, Content, Merch, | ||
MerchOnShipping, MerchShipment, Venue) | ||
|
||
admin.site.register(Activity) | ||
admin.site.register(Ambassador) | ||
|
||
class AmbassadorActivityInline(admin.TabularInline): | ||
model = AmbassadorActivity | ||
extra = 1 | ||
|
||
|
||
class MerchOnShippingInline(admin.TabularInline): | ||
model = MerchOnShipping | ||
extra = 1 | ||
|
||
|
||
class ActivityAdmin(admin.ModelAdmin): | ||
list_display = ("name",) | ||
empty_value_display = "-пусто" | ||
|
||
|
||
class MerchAdmin(admin.ModelAdmin): | ||
list_display = ("merch_type", "cost") | ||
empty_value_display = "-пусто" | ||
|
||
|
||
class VenueAdmin(admin.ModelAdmin): | ||
list_display = ("name",) | ||
empty_value_display = "-пусто" | ||
|
||
|
||
class MerchShipmentAdmin(admin.ModelAdmin): | ||
list_display = ("curator", "ambassador", "status", "date") | ||
list_filter = ("status", "ambassador", "curator") | ||
inlines = (MerchOnShippingInline,) | ||
empty_value_display = "-пусто" | ||
|
||
|
||
class ContentAdmin(admin.ModelAdmin): | ||
list_display = ("ambassador", "link", "date", "guide_followed") | ||
list_filter = ("ambassador", "venue", "guide_followed") | ||
empty_value_display = "-пусто" | ||
|
||
|
||
class AmbassadorAdmin(admin.ModelAdmin): | ||
list_display = ("fio", "telegram", "promocode", "status") | ||
list_filter = ("fio", "status") | ||
inlines = (AmbassadorActivityInline,) | ||
empty_value_display = "-пусто" | ||
|
||
|
||
admin.site.register(Activity, ActivityAdmin) | ||
admin.site.register(Ambassador, AmbassadorAdmin) | ||
admin.site.register(AmbassadorActivity) | ||
admin.site.register(AmbassadorPreference) | ||
admin.site.register(Content) | ||
admin.site.register(Content, ContentAdmin) | ||
admin.site.register(MerchOnShipping) | ||
admin.site.register(MerchShipment) | ||
admin.site.register(Preference) | ||
admin.site.register(Venue) | ||
admin.site.register(MerchShipment, MerchShipmentAdmin) | ||
admin.site.register(Merch, MerchAdmin) | ||
admin.site.register(Venue, VenueAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters