mirror of https://gitlab.crans.org/bde/nk20
Activity admin site was missing
This commit is contained in:
parent
cc04fa5555
commit
36f1a3f0d4
|
@ -3,9 +3,11 @@
|
||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
from .models import Activity, ActivityType, Guest
|
from note_kfet.admin import admin_site
|
||||||
|
from .models import Activity, ActivityType, Guest, Entry
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(Activity, site=admin_site)
|
||||||
class ActivityAdmin(admin.ModelAdmin):
|
class ActivityAdmin(admin.ModelAdmin):
|
||||||
"""
|
"""
|
||||||
Admin customisation for Activity
|
Admin customisation for Activity
|
||||||
|
@ -19,6 +21,7 @@ class ActivityAdmin(admin.ModelAdmin):
|
||||||
ordering = ['-date_start']
|
ordering = ['-date_start']
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(ActivityType, site=admin_site)
|
||||||
class ActivityTypeAdmin(admin.ModelAdmin):
|
class ActivityTypeAdmin(admin.ModelAdmin):
|
||||||
"""
|
"""
|
||||||
Admin customisation for ActivityType
|
Admin customisation for ActivityType
|
||||||
|
@ -26,7 +29,17 @@ class ActivityTypeAdmin(admin.ModelAdmin):
|
||||||
list_display = ('name', 'can_invite', 'guest_entry_fee')
|
list_display = ('name', 'can_invite', 'guest_entry_fee')
|
||||||
|
|
||||||
|
|
||||||
# Register your models here.
|
@admin.register(Guest, site=admin_site)
|
||||||
admin.site.register(Activity, ActivityAdmin)
|
class GuestAdmin(admin.ModelAdmin):
|
||||||
admin.site.register(ActivityType, ActivityTypeAdmin)
|
"""
|
||||||
admin.site.register(Guest)
|
Admin customisation for Guest
|
||||||
|
"""
|
||||||
|
list_display = ('last_name', 'first_name', 'activity', 'inviter')
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(Entry, site=admin_site)
|
||||||
|
class EntryAdmin(admin.ModelAdmin):
|
||||||
|
"""
|
||||||
|
Admin customisation for Entry
|
||||||
|
"""
|
||||||
|
list_display = ('note', 'activity', 'time', 'guest')
|
||||||
|
|
|
@ -99,6 +99,9 @@ class Activity(models.Model):
|
||||||
verbose_name=_('open'),
|
verbose_name=_('open'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _("activity")
|
verbose_name = _("activity")
|
||||||
verbose_name_plural = _("activities")
|
verbose_name_plural = _("activities")
|
||||||
|
@ -234,6 +237,9 @@ class Guest(models.Model):
|
||||||
|
|
||||||
return super().save(force_insert, force_update, using, update_fields)
|
return super().save(force_insert, force_update, using, update_fields)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.first_name + " " + self.last_name
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _("guest")
|
verbose_name = _("guest")
|
||||||
verbose_name_plural = _("guests")
|
verbose_name_plural = _("guests")
|
||||||
|
|
Loading…
Reference in New Issue