collect day is unique for a sector (#7683)

This commit is contained in:
Serghei Mihai 2015-06-26 09:24:10 +02:00
parent 8c24a36842
commit 9017316784
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('passerelle_montpellier_encombrants', '0005_street'),
]
operations = [
migrations.AlterUniqueTogether(
name='collectday',
unique_together=set([('sector', 'date')]),
),
]

View File

@ -74,6 +74,7 @@ class CollectDay(models.Model):
class Meta:
ordering = ['date']
unique_together = ('sector', 'date')
def __unicode__(self):
return '%s: %s' % (self.date, self.sector)