make it easier to distinguish villaged

This commit is contained in:
Thomas Steen Rasmussen 2017-03-30 09:36:47 +02:00
parent ff76c3e98e
commit 9d75bb6d9d
2 changed files with 3 additions and 1 deletions

View file

@ -7,11 +7,13 @@ from .models import Village
class VillageAdmin(admin.ModelAdmin):
list_display = [
'name',
'camp',
'private',
'deleted',
]
list_filter = [
'camp',
'private',
'deleted',
]

View file

@ -31,7 +31,7 @@ class Village(UUIDModel, CampRelatedModel):
objects = VillageQuerySet.as_manager()
def __str__(self):
return self.name
return "%s (%s)" % (self.name, self.camp.title)
def get_absolute_url(self):
return reverse_lazy('village_detail', kwargs={'camp_slug': self.camp.slug, 'slug': self.slug})