add subtitle for LocationGroup
This commit is contained in:
parent
1f4c22e113
commit
f018315db2
1 changed files with 5 additions and 0 deletions
|
@ -5,6 +5,7 @@ from django.core.cache import cache
|
|||
from django.db import models
|
||||
from django.utils.functional import cached_property
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext_lazy
|
||||
|
||||
from c3nav.mapdata.fields import JSONField
|
||||
from c3nav.mapdata.lastupdate import get_last_mapdata_update
|
||||
|
@ -87,6 +88,10 @@ class LocationGroup(LocationModelMixin, MapItem):
|
|||
def location_id(self):
|
||||
return 'g:'+self.name
|
||||
|
||||
@property
|
||||
def subtitle(self):
|
||||
return ungettext_lazy('%d location', '%d locations') % self.arealocations.count()
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue