2012-07-28 21:05:01 +00:00
|
|
|
from django.contrib import admin
|
|
|
|
|
2016-02-27 22:38:27 +00:00
|
|
|
from reversion.admin import VersionAdmin
|
2012-07-28 21:05:01 +00:00
|
|
|
|
|
|
|
from symposion.teams.models import Team, Membership
|
|
|
|
|
2020-11-29 04:36:56 +00:00
|
|
|
|
|
|
|
class TeamAdmin(admin.ModelAdmin):
|
|
|
|
prepopulated_fields={"slug": ("name",)}
|
|
|
|
filter_horizontal = ('permissions', 'manager_permissions',)
|
|
|
|
|
|
|
|
|
|
|
|
admin.site.register(Team, TeamAdmin)
|
2012-07-28 21:05:01 +00:00
|
|
|
|
|
|
|
|
2016-02-27 22:38:27 +00:00
|
|
|
class MembershipAdmin(VersionAdmin):
|
2012-07-28 21:05:01 +00:00
|
|
|
list_display = ["team", "user", "state"]
|
2017-10-14 02:25:36 +00:00
|
|
|
list_filter = ["team","state"]
|
2012-07-28 21:05:01 +00:00
|
|
|
search_fields = ["user__username"]
|
|
|
|
|
2017-04-17 12:51:48 +00:00
|
|
|
|
2012-07-28 21:05:01 +00:00
|
|
|
admin.site.register(Membership, MembershipAdmin)
|