fix error with CampRelatedModel

This commit is contained in:
Stephan Telling 2017-03-08 00:24:14 +01:00
parent f7b1f040bb
commit 656536974b
4 changed files with 6 additions and 6 deletions

View file

@ -3,7 +3,7 @@ from utils.models import CreatedUpdatedModel, CampRelatedModel
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
class InfoCategory(CreatedUpdatedModel, CampRelatedModel): class InfoCategory(CampRelatedModel):
class Meta: class Meta:
ordering = ['weight', 'headline'] ordering = ['weight', 'headline']
unique_together = (('anchor', 'camp'), ('headline', 'camp')) unique_together = (('anchor', 'camp'), ('headline', 'camp'))
@ -38,7 +38,7 @@ class InfoCategory(CreatedUpdatedModel, CampRelatedModel):
return '%s (%s)' % (self.headline, self.camp) return '%s (%s)' % (self.headline, self.camp)
class InfoItem(CreatedUpdatedModel, CampRelatedModel): class InfoItem(CampRelatedModel):
class Meta: class Meta:
ordering = ['weight', 'headline'] ordering = ['weight', 'headline']
unique_together = (('anchor', 'category'), ('headline', 'category')) unique_together = (('anchor', 'category'), ('headline', 'category'))

View file

@ -39,7 +39,7 @@ class UserSubmittedModel(CampRelatedModel):
) )
class EventLocation(CreatedUpdatedModel, CampRelatedModel): class EventLocation(CampRelatedModel):
""" The places where stuff happens """ """ The places where stuff happens """
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
slug = models.SlugField() slug = models.SlugField()
@ -106,7 +106,7 @@ class Event(UserSubmittedModel):
return reverse_lazy('event_detail', kwargs={'camp_slug': self.camp.slug, 'slug': self.slug}) return reverse_lazy('event_detail', kwargs={'camp_slug': self.camp.slug, 'slug': self.slug})
class EventInstance(CreatedUpdatedModel, CampRelatedModel): class EventInstance(CampRelatedModel):
""" An instance of an event """ """ An instance of an event """
event = models.ForeignKey('program.event', related_name='instances') event = models.ForeignKey('program.event', related_name='instances')
when = DateTimeRangeField() when = DateTimeRangeField()

View file

@ -47,7 +47,7 @@ class CreatedUpdatedModel(CleanedModel):
updated = models.DateTimeField(auto_now=True) updated = models.DateTimeField(auto_now=True)
class CampRelatedModel(CleanedModel): class CampRelatedModel(CreatedUpdatedModel):
class Meta: class Meta:
abstract = True abstract = True

View file

@ -5,7 +5,7 @@ from utils.models import CreatedUpdatedModel, UUIDModel, CampRelatedModel
from .managers import VillageQuerySet from .managers import VillageQuerySet
class Village(CreatedUpdatedModel, UUIDModel, CampRelatedModel): class Village(UUIDModel, CampRelatedModel):
class Meta: class Meta:
ordering = ['name'] ordering = ['name']