Add unique_together = (('session_id', 'group_from'),)

Brightcells 7 years ago
parent
commit
bf678fc740
2 changed files with 21 additions and 0 deletions
  1. 19 0
      group/migrations/0037_auto_20170821_1600.py
  2. 2 0
      group/models.py

+ 19 - 0
group/migrations/0037_auto_20170821_1600.py

@@ -0,0 +1,19 @@
1
+# -*- coding: utf-8 -*-
2
+# Generated by Django 1.11.3 on 2017-08-21 08:00
3
+from __future__ import unicode_literals
4
+
5
+from django.db import migrations
6
+
7
+
8
+class Migration(migrations.Migration):
9
+
10
+    dependencies = [
11
+        ('group', '0036_groupphotoinfo_has_watermark'),
12
+    ]
13
+
14
+    operations = [
15
+        migrations.AlterUniqueTogether(
16
+            name='groupinfo',
17
+            unique_together=set([('session_id', 'group_from')]),
18
+        ),
19
+    ]

+ 2 - 0
group/models.py

@@ -55,6 +55,8 @@ class GroupInfo(CreateUpdateMixin):
55 55
         verbose_name = _(u'groupinfo')
56 56
         verbose_name_plural = _(u'groupinfo')
57 57
 
58
+        unique_together = (('session_id', 'group_from'),)
59
+
58 60
     def __unicode__(self):
59 61
         return unicode(self.group_id)
60 62