summaryrefslogtreecommitdiff
path: root/chimere/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/models.py')
-rw-r--r--chimere/models.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/chimere/models.py b/chimere/models.py
index 52cd9eb..39fe95a 100644
--- a/chimere/models.py
+++ b/chimere/models.py
@@ -881,6 +881,7 @@ class GeographicItem(models.Model):
search=SearchVector(
'categories__name',
'categories__keywords',
+ 'categories__category__name',
config=settings.CHIMERE_SEARCH_LANGUAGE
))
search_vectors.append(q.all()[0].search)
@@ -1741,9 +1742,9 @@ post_save.connect(route_post_save, sender=Route)
def getDateCondition():
- '''
+ """
Return an SQL condition for apparition of dates
- '''
+ """
if not settings.CHIMERE_DAYS_BEFORE_EVENT:
return ""
now = datetime.datetime.now().strftime('%Y-%m-%d')
@@ -1759,9 +1760,9 @@ def getDateCondition():
class AggregatedRoute(models.Model):
- '''
+ """
Database view for aggregated routes
- '''
+ """
route = models.MultiLineStringField()
subcategory = models.ForeignKey(SubCategory)
status = models.CharField(_("Status"), max_length=1, choices=STATUS)
@@ -1771,8 +1772,9 @@ class AggregatedRoute(models.Model):
db_table = 'chimere_aggregated_routes'
def getGeoJSON(self, color="#000"):
- '''Return a GeoJSON string
- '''
+ """
+ Return a GeoJSON string
+ """
if '#' not in color:
color = '#' + color
try: