summaryrefslogtreecommitdiff
path: root/chimere/main/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/main/models.py')
-rw-r--r--chimere/main/models.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/chimere/main/models.py b/chimere/main/models.py
index 5744529..6aaad66 100644
--- a/chimere/main/models.py
+++ b/chimere/main/models.py
@@ -136,7 +136,7 @@ class SubCategory(models.Model):
name = models.CharField(_("Name"), max_length=150)
available = models.BooleanField(_("Available"))
areas = models.ManyToManyField('Area', related_name='areas',
- blank=True, null=True, db_table=u'subcategory_areas')
+ db_table=u'subcategory_areas')
icon = models.ForeignKey(Icon, verbose_name=_("Icon"))
color_theme = models.ForeignKey(ColorTheme, verbose_name=_("Color theme"),
blank=True, null=True)
@@ -185,7 +185,7 @@ class Marker(models.Model):
'''Marker for a POI
'''
name = models.CharField(_("Name"), max_length=150)
- subcategory = models.ForeignKey(SubCategory, verbose_name=_("Subcategory"))
+ categories = models.ManyToManyField(SubCategory)
point = PointField(_("Localisation"), srid=settings.EPSG_DISPLAY_PROJECTION)
picture = models.ImageField(_("Image"), upload_to='upload', blank=True,
null=True, height_field='height', width_field='width')
@@ -204,7 +204,7 @@ class Marker(models.Model):
return self.name
class Meta:
- ordering = ('subcategory__category', 'subcategory', 'status', 'name')
+ ordering = ('status', 'name')
verbose_name = _("Point of interest")
def getLatitude(self):
@@ -255,7 +255,7 @@ class Route(models.Model):
'''Route on the map
'''
name = models.CharField(_("Name"), max_length=150)
- subcategory = models.ForeignKey(SubCategory, verbose_name=_("Subcategory"))
+ categories = models.ManyToManyField(SubCategory)
route = RouteField(_("Route"), srid=settings.EPSG_DISPLAY_PROJECTION)
picture = models.ImageField(_("Image"), upload_to='upload', blank=True,
null=True, height_field='height', width_field='width')
@@ -274,7 +274,7 @@ class Route(models.Model):
return self.name
class Meta:
- ordering = ('subcategory__category', 'subcategory', 'status', 'name')
+ ordering = ('status', 'name')
verbose_name = _("Route")
def getProperty(self, propertymodel, safe=None):