"Fossies" - the Fresh Open Source Software Archive

Member "taiga-back-5.0.6/taiga/projects/votes/migrations/0001_initial.py" (15 Jan 2020, 1873 Bytes) of package /linux/www/taiga-back-5.0.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "0001_initial.py" see the Fossies "Dox" file reference documentation.

    1 # -*- coding: utf-8 -*-
    2 from __future__ import unicode_literals
    3 
    4 from django.db import models, migrations
    5 from django.conf import settings
    6 
    7 
    8 class Migration(migrations.Migration):
    9 
   10     dependencies = [
   11         migrations.swappable_dependency(settings.AUTH_USER_MODEL),
   12         ('contenttypes', '0001_initial'),
   13     ]
   14 
   15     operations = [
   16         migrations.CreateModel(
   17             name='Vote',
   18             fields=[
   19                 ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
   20                 ('object_id', models.PositiveIntegerField()),
   21                 ('content_type', models.ForeignKey(to='contenttypes.ContentType')),
   22                 ('user', models.ForeignKey(verbose_name='votes', to=settings.AUTH_USER_MODEL, related_name='votes')),
   23             ],
   24             options={
   25                 'verbose_name': 'Vote',
   26                 'verbose_name_plural': 'Votes',
   27             },
   28             bases=(models.Model,),
   29         ),
   30         migrations.CreateModel(
   31             name='Votes',
   32             fields=[
   33                 ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
   34                 ('object_id', models.PositiveIntegerField()),
   35                 ('count', models.PositiveIntegerField(default=0)),
   36                 ('content_type', models.ForeignKey(to='contenttypes.ContentType')),
   37             ],
   38             options={
   39                 'verbose_name': 'Votes',
   40                 'verbose_name_plural': 'Votes',
   41             },
   42             bases=(models.Model,),
   43         ),
   44         migrations.AlterUniqueTogether(
   45             name='votes',
   46             unique_together=set([('content_type', 'object_id')]),
   47         ),
   48         migrations.AlterUniqueTogether(
   49             name='vote',
   50             unique_together=set([('content_type', 'object_id', 'user')]),
   51         ),
   52     ]