collect day is unique for a sector (#7683)
This commit is contained in:
parent
8c24a36842
commit
9017316784
|
@ -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')]),
|
||||
),
|
||||
]
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue