2017-12-26 17:46:27 +01:00
|
|
|
from django.contrib import admin
|
|
|
|
|
|
|
|
# Register your models here.
|
|
|
|
from .models.locale import Language, Continent, Country, SPR, City
|
2018-01-24 05:15:14 +01:00
|
|
|
from .models.profiles import UserProfile, Organization, Team, Member
|
2017-12-26 17:46:27 +01:00
|
|
|
from .models.search import Searchable
|
2018-01-24 05:15:14 +01:00
|
|
|
from .models.events import Place, Event, Attendee
|
2017-12-26 17:46:27 +01:00
|
|
|
|
|
|
|
admin.site.register(Language)
|
|
|
|
admin.site.register(Continent)
|
|
|
|
admin.site.register(Country)
|
|
|
|
|
|
|
|
class SPRAdmin(admin.ModelAdmin):
|
|
|
|
raw_id_fields = ('country',)
|
2018-01-04 05:44:27 +01:00
|
|
|
list_filter =('country',)
|
|
|
|
search_fields = ('name', 'country__name')
|
2017-12-26 17:46:27 +01:00
|
|
|
admin.site.register(SPR, SPRAdmin)
|
|
|
|
|
|
|
|
class CityAdmin(admin.ModelAdmin):
|
|
|
|
raw_id_fields = ('spr',)
|
2018-01-04 05:44:27 +01:00
|
|
|
list_filter =('spr__country',)
|
|
|
|
search_fields = ('name', 'spr__name')
|
2017-12-26 17:46:27 +01:00
|
|
|
admin.site.register(City, CityAdmin)
|
|
|
|
|
|
|
|
admin.site.register(UserProfile)
|
2018-01-04 05:44:27 +01:00
|
|
|
|
|
|
|
class OrgAdmin(admin.ModelAdmin):
|
|
|
|
list_display = ('name', 'site')
|
|
|
|
admin.site.register(Organization, OrgAdmin)
|
2017-12-26 17:46:27 +01:00
|
|
|
|
|
|
|
class TeamAdmin(admin.ModelAdmin):
|
|
|
|
raw_id_fields = ('country', 'spr', 'city', 'owner_profile', 'admin_profiles', 'contact_profiles')
|
|
|
|
admin.site.register(Team, TeamAdmin)
|
|
|
|
|
|
|
|
admin.site.register(Searchable)
|
|
|
|
|
|
|
|
class PlaceAdmin(admin.ModelAdmin):
|
|
|
|
raw_id_fields = ('city',)
|
|
|
|
admin.site.register(Place, PlaceAdmin)
|
|
|
|
|
|
|
|
class EventAdmin(admin.ModelAdmin):
|
|
|
|
raw_id_fields = ('place', 'created_by')
|
|
|
|
admin.site.register(Event, EventAdmin)
|
|
|
|
|
2018-01-24 05:15:14 +01:00
|
|
|
admin.site.register(Member)
|
2018-01-24 05:52:42 +01:00
|
|
|
admin.site.register(Attendee)
|
2018-01-24 05:15:14 +01:00
|
|
|
|
2017-12-26 17:46:27 +01:00
|
|
|
|