Merge pull request #1811 from normanjaeckel/SquishMigrations

Squished all migrations.
This commit is contained in:
Oskar Hahn 2016-01-09 21:04:54 +01:00
commit 2f8138f672
39 changed files with 187 additions and 1356 deletions

View File

@ -1,3 +1,4 @@
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
@ -8,54 +9,53 @@ class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('core', '0001_initial'),
('contenttypes', '0001_initial'),
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
('item_number', models.CharField(blank=True, max_length=255, verbose_name='Number')),
('title', models.CharField(max_length=255, verbose_name='Title', null=True)),
('text', models.TextField(blank=True, verbose_name='Text', null=True)),
('comment', models.TextField(blank=True, verbose_name='Comment', null=True)),
('closed', models.BooleanField(default=False, verbose_name='Closed')),
('type', models.IntegerField(
verbose_name='Type',
default=1,
choices=[(1, 'Agenda item'), (2, 'Organizational item')],
max_length=1)),
('duration', models.CharField(blank=True, max_length=5, null=True)),
('weight', models.IntegerField(default=0, verbose_name='Weight')),
('object_id', models.PositiveIntegerField(blank=True, null=True)),
('speaker_list_closed', models.BooleanField(default=False, verbose_name='List of speakers is closed')),
('content_type', models.ForeignKey(blank=True, to='contenttypes.ContentType', null=True)),
('parent', models.ForeignKey(related_name='children', blank=True, to='agenda.Item', null=True)),
('tags', models.ManyToManyField(blank=True, to='core.Tag')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('item_number', models.CharField(blank=True, max_length=255)),
('comment', models.TextField(null=True, blank=True)),
('closed', models.BooleanField(default=False)),
('type', models.IntegerField(choices=[(1, 'Agenda item'), (2, 'Hidden item')], default=1)),
('duration', models.CharField(null=True, blank=True, max_length=5)),
('weight', models.IntegerField(default=0)),
('object_id', models.PositiveIntegerField(null=True, blank=True)),
('speaker_list_closed', models.BooleanField(default=False)),
('content_type', models.ForeignKey(
on_delete=django.db.models.deletion.SET_NULL, blank=True, null=True, to='contenttypes.ContentType')),
('parent', models.ForeignKey(
related_name='children', blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='agenda.Item')),
],
options={
'permissions': (
('can_see', 'Can see agenda'),
('can_manage', 'Can manage agenda'),
('can_see_orga_items', 'Can see orga items and time scheduling of agenda')),
('can_see', 'Can see agenda'), ('can_manage', 'Can manage agenda'),
('can_see_hidden_items', 'Can see hidden items and time scheduling of agenda')),
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='Speaker',
fields=[
('id', models.AutoField(primary_key=True, serialize=False, auto_created=True, verbose_name='ID')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('begin_time', models.DateTimeField(null=True)),
('end_time', models.DateTimeField(null=True)),
('weight', models.IntegerField(null=True)),
('item', models.ForeignKey(to='agenda.Item')),
('item', models.ForeignKey(related_name='speakers', to='agenda.Item')),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
],
options={
'permissions': (('can_be_speaker', 'Can put oneself on the list of speakers'),),
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.AlterUniqueTogether(
name='item',
unique_together=set([('content_type', 'object_id')]),
),
]

View File

@ -1,16 +0,0 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='item',
name='type',
field=models.IntegerField(verbose_name='Type', choices=[(1, 'Agenda item'), (2, 'Organizational item')], default=1),
),
]

View File

@ -1,15 +0,0 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda', '0002_auto_20150630_0144'),
]
operations = [
migrations.AlterField(
model_name='speaker',
name='item',
field=models.ForeignKey(related_name='speakers', to='agenda.Item'),
),
]

View File

@ -1,46 +0,0 @@
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda', '0003_auto_20150904_1732'),
]
operations = [
migrations.AlterModelOptions(
name='item',
options={
'permissions': (
('can_see', 'Can see agenda'),
('can_manage', 'Can manage agenda'),
('can_see_hidden_items',
'Can see hidden items and time scheduling of agenda'))},
),
migrations.AlterField(
model_name='item',
name='type',
field=models.IntegerField(
choices=[(1, 'Agenda item'), (2, 'Hidden item')],
verbose_name='Type',
default=1),
),
migrations.AlterUniqueTogether(
name='item',
unique_together=set([('content_type', 'object_id')]),
),
migrations.RemoveField(
model_name='item',
name='tags',
),
migrations.RemoveField(
model_name='item',
name='text',
),
migrations.RemoveField(
model_name='item',
name='title',
),
]

View File

@ -1,27 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('agenda', '0004_auto_20151027_1423'),
]
operations = [
migrations.AlterModelOptions(
name='item',
options={
'permissions': (
('can_see', 'Can see agenda'),
('can_manage', 'Can manage agenda'),
('can_see_hidden_items', 'Can see hidden items and time scheduling of agenda')),
'default_permissions': ()},
),
migrations.AlterModelOptions(
name='speaker',
options={'permissions': (('can_be_speaker', 'Can put oneself on the list of speakers'),), 'default_permissions': ()},
),
]

View File

@ -1,26 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-09 11:45
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda', '0005_auto_20151210_0016'),
]
operations = [
migrations.AlterField(
model_name='item',
name='content_type',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='contenttypes.ContentType'),
),
migrations.AlterField(
model_name='item',
name='parent',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='children', to='agenda.Item'),
),
]

View File

@ -1,44 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('agenda', '0006_auto_20160109_1145'),
]
operations = [
migrations.AlterField(
model_name='item',
name='closed',
field=models.BooleanField(default=False),
),
migrations.AlterField(
model_name='item',
name='comment',
field=models.TextField(blank=True, null=True),
),
migrations.AlterField(
model_name='item',
name='item_number',
field=models.CharField(max_length=255, blank=True),
),
migrations.AlterField(
model_name='item',
name='speaker_list_closed',
field=models.BooleanField(default=False),
),
migrations.AlterField(
model_name='item',
name='type',
field=models.IntegerField(default=1, choices=[(1, 'Agenda item'), (2, 'Hidden item')]),
),
migrations.AlterField(
model_name='item',
name='weight',
field=models.IntegerField(default=0),
),
]

View File

@ -7,113 +7,102 @@ import openslides.utils.models
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Assignment',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('title', models.CharField(max_length=100, verbose_name='Title')),
('description', models.TextField(blank=True, verbose_name='Description')),
('open_posts', models.PositiveSmallIntegerField(verbose_name='Number of members to be elected')),
('poll_description_default', models.CharField(
blank=True,
max_length=79,
verbose_name='Default comment on the ballot paper')),
('phase', models.IntegerField(
default=0,
choices=[(0, 'Searching for candidates'), (1, 'Voting'), (2, 'Finished')])),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('title', models.CharField(max_length=100)),
('description', models.TextField(blank=True)),
('open_posts', models.PositiveSmallIntegerField()),
('poll_description_default', models.CharField(blank=True, max_length=79)),
('phase', models.IntegerField(choices=[(0, 'Searching for candidates'), (1, 'Voting'), (2, 'Finished')], default=0)),
],
options={
'verbose_name': 'Election',
'permissions': (
('can_see', 'Can see elections'),
('can_nominate_other', 'Can nominate another participant'),
('can_nominate_self', 'Can nominate oneself'),
('can_manage', 'Can manage elections')),
('can_see', 'Can see elections'), ('can_nominate_other', 'Can nominate another participant'),
('can_nominate_self', 'Can nominate oneself'), ('can_manage', 'Can manage elections')),
'verbose_name': 'Election',
'ordering': ('title',),
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='AssignmentOption',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('candidate', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='AssignmentPoll',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('votesvalid', openslides.utils.models.MinMaxIntegerField(null=True, blank=True, verbose_name='Valid votes')),
('votesinvalid', openslides.utils.models.MinMaxIntegerField(
null=True,
blank=True,
verbose_name='Invalid votes')),
('votescast', openslides.utils.models.MinMaxIntegerField(null=True, blank=True, verbose_name='Votes cast')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('votesvalid', openslides.utils.models.MinMaxIntegerField(null=True, blank=True)),
('votesinvalid', openslides.utils.models.MinMaxIntegerField(null=True, blank=True)),
('votescast', openslides.utils.models.MinMaxIntegerField(null=True, blank=True)),
('published', models.BooleanField(default=False)),
('yesnoabstain', models.BooleanField(default=False)),
('description', models.CharField(blank=True, max_length=79, verbose_name='Comment on the ballot paper')),
('description', models.CharField(blank=True, max_length=79)),
('assignment', models.ForeignKey(related_name='polls', to='assignments.Assignment')),
],
options={
'abstract': False,
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='AssignmentRelatedUser',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('status', models.IntegerField(default=1, choices=[(1, 'candidate'), (2, 'elected'), (3, 'blocked')])),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('elected', models.BooleanField(default=False)),
('assignment', models.ForeignKey(related_name='assignment_related_users', to='assignments.Assignment')),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
],
options={
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='AssignmentVote',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('weight', models.IntegerField(null=True, default=1)),
('value', models.CharField(null=True, max_length=255)),
('option', models.ForeignKey(to='assignments.AssignmentOption')),
('option', models.ForeignKey(related_name='votes', to='assignments.AssignmentOption')),
],
options={
'abstract': False,
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.AlterUniqueTogether(
name='assignmentrelateduser',
unique_together=set([('assignment', 'user')]),
),
migrations.AddField(
model_name='assignmentoption',
name='poll',
field=models.ForeignKey(to='assignments.AssignmentPoll'),
preserve_default=True,
field=models.ForeignKey(related_name='options', to='assignments.AssignmentPoll'),
),
migrations.AddField(
model_name='assignment',
name='related_users',
field=models.ManyToManyField(through='assignments.AssignmentRelatedUser', to=settings.AUTH_USER_MODEL),
preserve_default=True,
field=models.ManyToManyField(to=settings.AUTH_USER_MODEL, through='assignments.AssignmentRelatedUser'),
),
migrations.AddField(
model_name='assignment',
name='tags',
field=models.ManyToManyField(blank=True, to='core.Tag'),
preserve_default=True,
),
migrations.AlterUniqueTogether(
name='assignmentrelateduser',
unique_together=set([('assignment', 'user')]),
),
]

View File

@ -1,24 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assignments', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='assignmentoption',
name='poll',
field=models.ForeignKey(to='assignments.AssignmentPoll', related_name='options'),
),
migrations.AlterField(
model_name='assignmentvote',
name='option',
field=models.ForeignKey(to='assignments.AssignmentOption', related_name='votes'),
),
]

View File

@ -1,42 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('assignments', '0002_auto_20151126_2153'),
]
operations = [
migrations.AlterModelOptions(
name='assignment',
options={
'permissions': (
('can_see', 'Can see elections'),
('can_nominate_other', 'Can nominate another participant'),
('can_nominate_self', 'Can nominate oneself'),
('can_manage', 'Can manage elections')),
'ordering': ('title',),
'default_permissions': (),
'verbose_name': 'Election'},
),
migrations.AlterModelOptions(
name='assignmentoption',
options={'default_permissions': ()},
),
migrations.AlterModelOptions(
name='assignmentpoll',
options={'default_permissions': ()},
),
migrations.AlterModelOptions(
name='assignmentrelateduser',
options={'default_permissions': ()},
),
migrations.AlterModelOptions(
name='assignmentvote',
options={'default_permissions': ()},
),
]

View File

@ -1,56 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import openslides.utils.models
class Migration(migrations.Migration):
dependencies = [
('assignments', '0003_auto_20151210_0016'),
]
operations = [
migrations.AlterField(
model_name='assignment',
name='description',
field=models.TextField(blank=True),
),
migrations.AlterField(
model_name='assignment',
name='open_posts',
field=models.PositiveSmallIntegerField(),
),
migrations.AlterField(
model_name='assignment',
name='poll_description_default',
field=models.CharField(max_length=79, blank=True),
),
migrations.AlterField(
model_name='assignment',
name='title',
field=models.CharField(max_length=100),
),
migrations.AlterField(
model_name='assignmentpoll',
name='description',
field=models.CharField(max_length=79, blank=True),
),
migrations.AlterField(
model_name='assignmentpoll',
name='votescast',
field=openslides.utils.models.MinMaxIntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='assignmentpoll',
name='votesinvalid',
field=openslides.utils.models.MinMaxIntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='assignmentpoll',
name='votesvalid',
field=openslides.utils.models.MinMaxIntegerField(blank=True, null=True),
),
]

View File

@ -1,23 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assignments', '0004_auto_20160109_1329'),
]
operations = [
migrations.RemoveField(
model_name='assignmentrelateduser',
name='status',
),
migrations.AddField(
model_name='assignmentrelateduser',
name='elected',
field=models.BooleanField(default=False),
),
]

View File

@ -1,4 +1,7 @@
import uuid
import jsonfield.fields
from django.conf import settings
from django.db import migrations, models
import openslides.utils.models
@ -6,37 +9,61 @@ import openslides.utils.models
def add_default_projector(apps, schema_editor):
"""
Adds default projector, welcome slide and activates clock and welcome
slide.
Adds default projector and activates clock.
"""
# We get the model from the versioned app registry;
# if we directly import it, it will be the wrong version.
CustomSlide = apps.get_model('core', 'CustomSlide')
custom_slide = CustomSlide.objects.create(
title='Welcome to OpenSlides',
weight=-500)
Projector = apps.get_model('core', 'Projector')
projector_config = [
{'name': 'core/clock', 'stable': True},
{'name': 'core/customslide', 'id': custom_slide.id}]
projector_config = {}
projector_config[uuid.uuid4().hex] = {
'name': 'core/clock',
'stable': True}
Projector.objects.create(config=projector_config)
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='CustomSlide',
name='ChatMessage',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
('title', models.CharField(max_length=256, verbose_name='Title')),
('text', models.TextField(blank=True, verbose_name='Text')),
('weight', models.IntegerField(verbose_name='Weight', default=0)),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('message', models.TextField()),
('timestamp', models.DateTimeField(auto_now_add=True)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
],
options={
'permissions': (('can_use_chat', 'Can use the chat'),),
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='ConfigStore',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('key', models.CharField(db_index=True, unique=True, max_length=255)),
('value', jsonfield.fields.JSONField()),
],
options={
'permissions': (('can_manage_config', 'Can manage configuration'),),
'default_permissions': (),
},
),
migrations.CreateModel(
name='CustomSlide',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('title', models.CharField(max_length=256)),
('text', models.TextField(blank=True)),
('weight', models.IntegerField(default=0)),
],
options={
'default_permissions': (),
'ordering': ('weight', 'title'),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
@ -44,42 +71,32 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Projector',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('config', jsonfield.fields.JSONField()),
('scale', models.IntegerField(default=0)),
('scroll', models.IntegerField(default=0)),
],
options={
'permissions': (
('can_see_projector', 'Can see the projector'),
('can_manage_projector', 'Can manage the projector'),
('can_see_dashboard', 'Can see the dashboard'),
('can_use_chat', 'Can use the chat')),
('can_see_projector', 'Can see the projector'), ('can_manage_projector', 'Can manage the projector'),
('can_see_dashboard', 'Can see the dashboard')),
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='Tag',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
('name', models.CharField(max_length=255, verbose_name='Tag', unique=True)),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('name', models.CharField(unique=True, max_length=255)),
],
options={
'ordering': ('name',),
'permissions': (('can_manage_tags', 'Can manage tags'),),
'default_permissions': (),
'ordering': ('name',),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='ConfigStore',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)),
('key', models.CharField(max_length=255, db_index=True, unique=True)),
('value', jsonfield.fields.JSONField()),
],
options={
'permissions': (('can_manage_config', 'Can manage configuration'),),
},
bases=(models.Model,),
),
migrations.RunPython(
code=add_default_projector,
reverse_code=None,

View File

@ -1,35 +0,0 @@
from django.db import migrations
def add_default_projector_2(apps, schema_editor):
"""
Adds default projector, activates countdown.
"""
# We get the model from the versioned app registry;
# if we directly import it, it will be the wrong version.
Projector = apps.get_model('core', 'Projector')
projector = Projector.objects.get()
config = projector.config
config.append({
'name': 'core/countdown',
'stable': True,
'status': 'stop',
'countdown_time': 60,
})
projector.config = config
projector.save()
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.RunPython(
code=add_default_projector_2,
reverse_code=None,
atomic=True,
),
]

View File

@ -1,39 +0,0 @@
import uuid
from django.db import migrations
def add_default_projector_3(apps, schema_editor):
"""
Adds UUIDs to projector config.
"""
# We get the model from the versioned app registry;
# if we directly import it, it will be the wrong version.
Projector = apps.get_model('core', 'Projector')
projector = Projector.objects.get()
def add_uuid(self):
"""
Adds an UUID to every element.
"""
for element in self.config:
if element.get('uuid') is None:
element['uuid'] = uuid.uuid4().hex
add_uuid(projector)
projector.save()
class Migration(migrations.Migration):
dependencies = [
('core', '0002_countdown'),
]
operations = [
migrations.RunPython(
code=add_default_projector_3,
reverse_code=None,
atomic=True,
),
]

View File

@ -1,42 +0,0 @@
import uuid
from django.db import migrations
def clear_all_and_make_it_new(apps, schema_editor):
"""
Clear all elements and them write new.
"""
# We get the model from the versioned app registry;
# if we directly import it, it will be the wrong version.
Projector = apps.get_model('core', 'Projector')
projector = Projector.objects.get()
projector.config = {}
projector.config[uuid.uuid4().hex] = {
'name': 'core/clock',
'stable': True}
projector.config[uuid.uuid4().hex] = {
'name': 'core/customslide',
'id': 1} # TODO: Use ID from model here. Do not guess.
projector.config[uuid.uuid4().hex] = {
'name': 'core/countdown',
'stable': True,
'status': 'stop',
'countdown_time': 60,
'visible': False}
projector.save()
class Migration(migrations.Migration):
dependencies = [
('core', '0003_uuid'),
]
operations = [
migrations.RunPython(
code=clear_all_and_make_it_new,
reverse_code=None,
atomic=True,
),
]

View File

@ -1,35 +0,0 @@
from django.conf import settings
from django.db import migrations, models
import openslides.utils.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('core', '0004_clear_all_and_make_it_new'),
]
operations = [
migrations.CreateModel(
name='ChatMessage',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True, serialize=False)),
('message', models.TextField(verbose_name='Message')),
('timestamp', models.DateTimeField(auto_now_add=True)),
('user', models.ForeignKey(verbose_name='User', to=settings.AUTH_USER_MODEL)),
],
options={
'permissions': (('can_use_chat', 'Can use the chat'),),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.AlterModelOptions(
name='projector',
options={'permissions': (
('can_see_projector', 'Can see the projector'),
('can_manage_projector', 'Can manage the projector'),
('can_see_dashboard', 'Can see the dashboard'))},
),
]

View File

@ -1,21 +0,0 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_add_chat_message_model'),
]
operations = [
migrations.AddField(
model_name='projector',
name='scale',
field=models.IntegerField(default=0),
),
migrations.AddField(
model_name='projector',
name='scroll',
field=models.IntegerField(default=0),
),
]

View File

@ -1,36 +0,0 @@
import uuid
from django.db import migrations
def clear_all_and_make_it_new_2(apps, schema_editor):
"""
Clear all projector elements and them write new.
"""
# We get the model from the versioned app registry;
# if we directly import it, it will be the wrong version.
Projector = apps.get_model('core', 'Projector')
projector = Projector.objects.get()
projector.config = {}
projector.config[uuid.uuid4().hex] = {
'name': 'core/clock',
'stable': True}
projector.config[uuid.uuid4().hex] = {
'name': 'core/customslide',
'id': 1} # TODO: Use ID from model here. Do not guess.
projector.save()
class Migration(migrations.Migration):
dependencies = [
('core', '0006_auto_20150914_2232'),
]
operations = [
migrations.RunPython(
code=clear_all_and_make_it_new_2,
reverse_code=None,
atomic=True,
),
]

View File

@ -1,39 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0007_clear_default_countdown'),
]
operations = [
migrations.AlterModelOptions(
name='chatmessage',
options={'permissions': (('can_use_chat', 'Can use the chat'),), 'default_permissions': ()},
),
migrations.AlterModelOptions(
name='configstore',
options={'permissions': (('can_manage_config', 'Can manage configuration'),), 'default_permissions': ()},
),
migrations.AlterModelOptions(
name='customslide',
options={'ordering': ('weight', 'title'), 'default_permissions': ()},
),
migrations.AlterModelOptions(
name='projector',
options={
'permissions': (
('can_see_projector', 'Can see the projector'),
('can_manage_projector', 'Can manage the projector'),
('can_see_dashboard', 'Can see the dashboard')),
'default_permissions': ()},
),
migrations.AlterModelOptions(
name='tag',
options={'permissions': (('can_manage_tags', 'Can manage tags'),), 'ordering': ('name',), 'default_permissions': ()},
),
]

View File

@ -1,45 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0008_auto_20151210_0016'),
]
operations = [
migrations.AlterField(
model_name='chatmessage',
name='message',
field=models.TextField(),
),
migrations.AlterField(
model_name='chatmessage',
name='user',
field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='customslide',
name='text',
field=models.TextField(blank=True),
),
migrations.AlterField(
model_name='customslide',
name='title',
field=models.CharField(max_length=256),
),
migrations.AlterField(
model_name='customslide',
name='weight',
field=models.IntegerField(default=0),
),
migrations.AlterField(
model_name='tag',
name='name',
field=models.CharField(max_length=255, unique=True),
),
]

View File

@ -1,3 +1,4 @@
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
@ -14,23 +15,16 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Mediafile',
fields=[
('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)),
('mediafile', models.FileField(upload_to='file', verbose_name='File')),
('title', models.CharField(unique=True, verbose_name='Title', max_length=255)),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('mediafile', models.FileField(upload_to='file')),
('title', models.CharField(blank=True, unique=True, max_length=255)),
('timestamp', models.DateTimeField(auto_now_add=True)),
('filetype', models.CharField(editable=False, max_length=255)),
('is_presentable', models.BooleanField(
default=False,
help_text='If checked, this file can be presented on the projector. '
'Currently, this is only possible for PDFs.',
verbose_name='Is Presentable')),
('uploader', models.ForeignKey(to=settings.AUTH_USER_MODEL, blank=True, verbose_name='Uploaded by', null=True)),
('uploader', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, null=True, to=settings.AUTH_USER_MODEL)),
],
options={
'permissions': (
('can_see', 'Can see the list of files'),
('can_upload', 'Can upload files'),
('can_manage', 'Can manage files')),
('can_see', 'Can see the list of files'), ('can_upload', 'Can upload files'), ('can_manage', 'Can manage files')),
'default_permissions': (),
'ordering': ['title'],
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),

View File

@ -1,20 +0,0 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mediafiles', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='mediafile',
name='is_presentable',
),
migrations.AlterField(
model_name='mediafile',
name='title',
field=models.CharField(max_length=255, null=True, unique=True, blank=True, verbose_name='Title'),
),
]

View File

@ -1,20 +0,0 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mediafiles', '0002_auto_20150906_1246'),
]
operations = [
migrations.RemoveField(
model_name='mediafile',
name='filetype',
),
migrations.AlterField(
model_name='mediafile',
name='title',
field=models.CharField(unique=True, verbose_name='Title', max_length=255, default='', blank=True),
preserve_default=False,
),
]

View File

@ -1,24 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('mediafiles', '0003_auto_20150917_1226'),
]
operations = [
migrations.AlterModelOptions(
name='mediafile',
options={
'permissions': (
('can_see', 'Can see the list of files'),
('can_upload', 'Can upload files'),
('can_manage', 'Can manage files')),
'ordering': ['title'],
'default_permissions': ()},
),
]

View File

@ -1,27 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-09 11:45
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mediafiles', '0004_auto_20151210_0016'),
]
operations = [
migrations.AlterField(
model_name='mediafile',
name='uploader',
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to=settings.AUTH_USER_MODEL,
verbose_name='Uploaded by'),
),
]

View File

@ -1,31 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mediafiles', '0005_auto_20160109_1145'),
]
operations = [
migrations.AlterField(
model_name='mediafile',
name='mediafile',
field=models.FileField(upload_to='file'),
),
migrations.AlterField(
model_name='mediafile',
name='title',
field=models.CharField(max_length=255, blank=True, unique=True),
),
migrations.AlterField(
model_name='mediafile',
name='uploader',
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, to=settings.AUTH_USER_MODEL, null=True),
),
]

View File

@ -9,20 +9,21 @@ import openslides.utils.models
class Migration(migrations.Migration):
dependencies = [
('mediafiles', '__first__'),
('core', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('mediafiles', '0001_initial'),
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('name', models.CharField(max_length=255, verbose_name='Category name')),
('prefix', models.CharField(blank=True, max_length=32, verbose_name='Prefix')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('prefix', models.CharField(blank=True, max_length=32)),
],
options={
'default_permissions': (),
'ordering': ['prefix'],
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
@ -30,31 +31,31 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Motion',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('identifier', models.CharField(null=True, blank=True, max_length=255, unique=True)),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('identifier', models.CharField(null=True, unique=True, blank=True, max_length=255)),
('identifier_number', models.IntegerField(null=True)),
],
options={
'permissions': (
('can_see', 'Can see motions'),
('can_create', 'Can create motions'),
('can_support', 'Can support motions'),
('can_manage', 'Can manage motions')),
'ordering': ('identifier',),
('can_see', 'Can see motions'), ('can_create', 'Can create motions'),
('can_support', 'Can support motions'), ('can_manage', 'Can manage motions')),
'verbose_name': 'Motion',
'ordering': ('identifier',),
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='MotionLog',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('message_list', jsonfield.fields.JSONField()),
('time', models.DateTimeField(auto_now=True)),
('motion', models.ForeignKey(related_name='log_messages', to='motions.Motion')),
('person', models.ForeignKey(null=True, to=settings.AUTH_USER_MODEL)),
('person', models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to=settings.AUTH_USER_MODEL)),
],
options={
'default_permissions': (),
'ordering': ['-time'],
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
@ -62,65 +63,63 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='MotionOption',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
],
options={
'abstract': False,
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='MotionPoll',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('votesvalid', openslides.utils.models.MinMaxIntegerField(null=True, blank=True, verbose_name='Valid votes')),
('votesinvalid', openslides.utils.models.MinMaxIntegerField(
null=True,
blank=True,
verbose_name='Invalid votes')),
('votescast', openslides.utils.models.MinMaxIntegerField(null=True, blank=True, verbose_name='Votes cast')),
('poll_number', models.PositiveIntegerField(default=1)),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('votesvalid', openslides.utils.models.MinMaxIntegerField(null=True, blank=True)),
('votesinvalid', openslides.utils.models.MinMaxIntegerField(null=True, blank=True)),
('votescast', openslides.utils.models.MinMaxIntegerField(null=True, blank=True)),
('motion', models.ForeignKey(related_name='polls', to='motions.Motion')),
],
options={
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='MotionVersion',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('version_number', models.PositiveIntegerField(default=1)),
('title', models.CharField(max_length=255, verbose_name='Title')),
('text', models.TextField(verbose_name='Text')),
('reason', models.TextField(null=True, blank=True, verbose_name='Reason')),
('title', models.CharField(max_length=255)),
('text', models.TextField()),
('reason', models.TextField(null=True, blank=True)),
('creation_time', models.DateTimeField(auto_now=True)),
('motion', models.ForeignKey(related_name='versions', to='motions.Motion')),
],
options={
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='MotionVote',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('weight', models.IntegerField(null=True, default=1)),
('value', models.CharField(null=True, max_length=255)),
('option', models.ForeignKey(to='motions.MotionOption')),
],
options={
'abstract': False,
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='State',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('action_word', models.CharField(max_length=255)),
('icon', models.CharField(max_length=255)),
('css_class', models.CharField(default='primary', max_length=255)),
('required_permission_to_see', models.CharField(blank=True, max_length=255)),
('allow_support', models.BooleanField(default=False)),
('allow_create_poll', models.BooleanField(default=False)),
@ -131,90 +130,77 @@ class Migration(migrations.Migration):
('next_states', models.ManyToManyField(to='motions.State')),
],
options={
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.CreateModel(
name='Workflow',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
('id', models.AutoField(auto_created=True, serialize=False, primary_key=True, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('first_state', models.OneToOneField(to='motions.State', null=True, related_name='+')),
('first_state', models.OneToOneField(
related_name='+', null=True, on_delete=django.db.models.deletion.SET_NULL, to='motions.State')),
],
options={
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),
migrations.AddField(
model_name='state',
name='workflow',
field=models.ForeignKey(to='motions.Workflow'),
preserve_default=True,
),
migrations.AlterUniqueTogether(
name='motionversion',
unique_together=set([('motion', 'version_number')]),
),
migrations.AlterUniqueTogether(
name='motionpoll',
unique_together=set([('motion', 'poll_number')]),
field=models.ForeignKey(related_name='states', to='motions.Workflow'),
),
migrations.AddField(
model_name='motionoption',
name='poll',
field=models.ForeignKey(to='motions.MotionPoll'),
preserve_default=True,
),
migrations.AddField(
model_name='motion',
name='active_version',
field=models.ForeignKey(
to='motions.MotionVersion',
on_delete=django.db.models.deletion.SET_NULL,
null=True,
related_name='active_version'),
preserve_default=True,
related_name='active_version', null=True, on_delete=django.db.models.deletion.SET_NULL, to='motions.MotionVersion'),
),
migrations.AddField(
model_name='motion',
name='attachments',
field=models.ManyToManyField(to='mediafiles.Mediafile'),
preserve_default=True,
field=models.ManyToManyField(blank=True, to='mediafiles.Mediafile'),
),
migrations.AddField(
model_name='motion',
name='category',
field=models.ForeignKey(to='motions.Category', null=True, blank=True),
preserve_default=True,
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, blank=True, null=True, to='motions.Category'),
),
migrations.AddField(
model_name='motion',
name='parent',
field=models.ForeignKey(to='motions.Motion', null=True, blank=True, related_name='amendments'),
preserve_default=True,
field=models.ForeignKey(
related_name='amendments', blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='motions.Motion'),
),
migrations.AddField(
model_name='motion',
name='state',
field=models.ForeignKey(null=True, to='motions.State'),
preserve_default=True,
field=models.ForeignKey(on_delete=django.db.models.deletion.SET_NULL, null=True, to='motions.State'),
),
migrations.AddField(
model_name='motion',
name='submitters',
field=models.ManyToManyField(related_name='motion_submitters', to=settings.AUTH_USER_MODEL),
preserve_default=True,
field=models.ManyToManyField(related_name='motion_submitters', blank=True, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='motion',
name='supporters',
field=models.ManyToManyField(related_name='motion_supporters', to=settings.AUTH_USER_MODEL),
preserve_default=True,
field=models.ManyToManyField(related_name='motion_supporters', blank=True, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='motion',
name='tags',
field=models.ManyToManyField(to='core.Tag'),
preserve_default=True,
field=models.ManyToManyField(blank=True, to='core.Tag'),
),
migrations.AlterUniqueTogether(
name='motionversion',
unique_together=set([('motion', 'version_number')]),
),
]

View File

@ -1,32 +0,0 @@
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('motions', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='motion',
name='attachments',
field=models.ManyToManyField(blank=True, to='mediafiles.Mediafile'),
),
migrations.AlterField(
model_name='motion',
name='submitters',
field=models.ManyToManyField(blank=True, related_name='motion_submitters', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='motion',
name='supporters',
field=models.ManyToManyField(blank=True, related_name='motion_supporters', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='motion',
name='tags',
field=models.ManyToManyField(blank=True, to='core.Tag'),
),
]

View File

@ -1,19 +0,0 @@
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('motions', '0002_auto_20150904_1448'),
]
operations = [
migrations.AlterUniqueTogether(
name='motionpoll',
unique_together=set([]),
),
migrations.RemoveField(
model_name='motionpoll',
name='poll_number',
),
]

View File

@ -1,29 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('motions', '0003_auto_20150904_2029'),
]
operations = [
migrations.RenameField(
model_name='state',
old_name='icon',
new_name='css_class',
),
migrations.AlterField(
model_name='state',
name='css_class',
field=models.CharField(max_length=255, default='primary'),
),
migrations.AlterField(
model_name='state',
name='workflow',
field=models.ForeignKey(to='motions.Workflow', related_name='states'),
),
]

View File

@ -1,58 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('motions', '0004_auto_20151105_2312'),
]
operations = [
migrations.AlterModelOptions(
name='category',
options={'ordering': ['prefix'], 'default_permissions': ()},
),
migrations.AlterModelOptions(
name='motion',
options={
'ordering': ('identifier',),
'verbose_name': 'Motion',
'default_permissions': (),
'permissions': (
('can_see', 'Can see motions'),
('can_create', 'Can create motions'),
('can_support', 'Can support motions'),
('can_manage', 'Can manage motions'))},
),
migrations.AlterModelOptions(
name='motionlog',
options={'ordering': ['-time'], 'default_permissions': ()},
),
migrations.AlterModelOptions(
name='motionoption',
options={'default_permissions': ()},
),
migrations.AlterModelOptions(
name='motionpoll',
options={'default_permissions': ()},
),
migrations.AlterModelOptions(
name='motionversion',
options={'default_permissions': ()},
),
migrations.AlterModelOptions(
name='motionvote',
options={'default_permissions': ()},
),
migrations.AlterModelOptions(
name='state',
options={'default_permissions': ()},
),
migrations.AlterModelOptions(
name='workflow',
options={'default_permissions': ()},
),
]

View File

@ -1,47 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-09 11:45
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('motions', '0005_auto_20151210_0019'),
]
operations = [
migrations.AlterField(
model_name='motion',
name='category',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='motions.Category'),
),
migrations.AlterField(
model_name='motion',
name='parent',
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name='amendments',
to='motions.Motion'),
),
migrations.AlterField(
model_name='motion',
name='state',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='motions.State'),
),
migrations.AlterField(
model_name='motionlog',
name='person',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='workflow',
name='first_state',
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='motions.State'),
),
]

View File

@ -1,56 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import openslides.utils.models
class Migration(migrations.Migration):
dependencies = [
('motions', '0006_auto_20160109_1145'),
]
operations = [
migrations.AlterField(
model_name='category',
name='name',
field=models.CharField(max_length=255),
),
migrations.AlterField(
model_name='category',
name='prefix',
field=models.CharField(max_length=32, blank=True),
),
migrations.AlterField(
model_name='motionpoll',
name='votescast',
field=openslides.utils.models.MinMaxIntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='motionpoll',
name='votesinvalid',
field=openslides.utils.models.MinMaxIntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='motionpoll',
name='votesvalid',
field=openslides.utils.models.MinMaxIntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='motionversion',
name='reason',
field=models.TextField(blank=True, null=True),
),
migrations.AlterField(
model_name='motionversion',
name='text',
field=models.TextField(),
),
migrations.AlterField(
model_name='motionversion',
name='title',
field=models.CharField(max_length=255),
),
]

View File

@ -1,4 +1,3 @@
import django.utils.timezone
from django.db import migrations, models
import openslides.utils.models
@ -7,69 +6,43 @@ import openslides.utils.models
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
('auth', '0006_require_contenttypes_0002'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(default=django.utils.timezone.now, verbose_name='last login')),
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
('password', models.CharField(verbose_name='password', max_length=128)),
('last_login', models.DateTimeField(verbose_name='last login', null=True, blank=True)),
('is_superuser', models.BooleanField(
default=False,
verbose_name='superuser status',
help_text='Designates that this user has all permissions without explicitly assigning them.')),
('username', models.CharField(max_length=255, blank=True, verbose_name='Username', unique=True)),
('first_name', models.CharField(max_length=255, blank=True, verbose_name='First name')),
('last_name', models.CharField(max_length=255, blank=True, verbose_name='Last name')),
('structure_level', models.CharField(
default='',
max_length=255,
blank=True,
verbose_name='Structure level',
help_text='Will be shown after the name.')),
('title', models.CharField(
default='',
max_length=50,
blank=True,
verbose_name='Title',
help_text='Will be shown before the name.')),
('about_me', models.TextField(default='', blank=True, verbose_name='About me', help_text='Your profile text')),
('comment', models.TextField(default='', blank=True, verbose_name='Comment', help_text='Only for notes.')),
('default_password', models.CharField(default='', max_length=100, blank=True, verbose_name='Default password')),
('is_active', models.BooleanField(
default=True,
verbose_name='active',
help_text='Designates whether this user should be treated as '
'active. Unselect this instead of deleting accounts.')),
('is_present', models.BooleanField(
default=False,
verbose_name='present',
help_text='Designates whether this user is in the room or not.')),
help_text='Designates that this user has all permissions without explicitly assigning them.',
verbose_name='superuser status', default=False)),
('username', models.CharField(max_length=255, blank=True, unique=True)),
('first_name', models.CharField(max_length=255, blank=True)),
('last_name', models.CharField(max_length=255, blank=True)),
('structure_level', models.CharField(blank=True, max_length=255, default='')),
('title', models.CharField(blank=True, max_length=50, default='')),
('about_me', models.TextField(blank=True, default='')),
('comment', models.TextField(blank=True, default='')),
('default_password', models.CharField(blank=True, max_length=100, default='')),
('is_active', models.BooleanField(default=True)),
('is_present', models.BooleanField(default=False)),
('groups', models.ManyToManyField(
blank=True,
verbose_name='groups',
related_query_name='user',
related_name='user_set',
to='auth.Group',
help_text='The groups this user belongs to. A user will get '
'all permissions granted to each of his/her group.')),
help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.',
verbose_name='groups', blank=True, to='auth.Group', related_query_name='user')),
('user_permissions', models.ManyToManyField(
blank=True,
verbose_name='user permissions',
related_query_name='user',
related_name='user_set',
to='auth.Permission',
help_text='Specific permissions for this user.')),
related_name='user_set', help_text='Specific permissions for this user.', verbose_name='user permissions',
blank=True, to='auth.Permission', related_query_name='user')),
],
options={
'permissions': (
('can_see_name', 'Can see names of users'),
('can_see_extra_data', 'Can see extra data of users'),
('can_see_name', 'Can see names of users'), ('can_see_extra_data', 'Can see extra data of users'),
('can_manage', 'Can manage users')),
'ordering': ('last_name',),
'ordering': ('last_name', 'first_name', 'username'),
'default_permissions': (),
},
bases=(openslides.utils.models.RESTModelMixin, models.Model),
),

View File

@ -1,28 +0,0 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='user',
name='groups',
field=models.ManyToManyField(
verbose_name='groups',
related_query_name='user',
to='auth.Group',
related_name='user_set',
help_text='The groups this user belongs to. A user will get all '
'permissions granted to each of their groups.',
blank=True),
),
migrations.AlterField(
model_name='user',
name='last_login',
field=models.DateTimeField(verbose_name='last login', blank=True, null=True),
),
]

View File

@ -1,38 +0,0 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0002_auto_20150630_0143'),
]
operations = [
migrations.AlterModelOptions(
name='user',
options={
'ordering': ('last_name', 'first_name', 'username'),
'permissions': (
('can_see_name', 'Can see names of users'),
('can_see_extra_data', 'Can see extra data of users'),
('can_manage', 'Can manage users'))},
),
migrations.AlterField(
model_name='user',
name='about_me',
field=models.TextField(blank=True, help_text='Profile text.', default='', verbose_name='About me'),
),
migrations.AlterField(
model_name='user',
name='is_active',
field=models.BooleanField(
help_text='Designates whether this user should be treated as active. Unselect this instead of deleting the account.',
default=True,
verbose_name='Active'),
),
migrations.AlterField(
model_name='user',
name='is_present',
field=models.BooleanField(help_text='Designates whether this user is in the room or not.', default=False, verbose_name='Present'),
),
]

View File

@ -1,24 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0003_auto_20151021_2320'),
]
operations = [
migrations.AlterModelOptions(
name='user',
options={
'permissions': (
('can_see_name', 'Can see names of users'),
('can_see_extra_data', 'Can see extra data of users'),
('can_manage', 'Can manage users')),
'ordering': ('last_name', 'first_name', 'username'),
'default_permissions': ()},
),
]

View File

@ -1,64 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0004_auto_20151210_0016'),
]
operations = [
migrations.AlterField(
model_name='user',
name='about_me',
field=models.TextField(default='', blank=True),
),
migrations.AlterField(
model_name='user',
name='comment',
field=models.TextField(default='', blank=True),
),
migrations.AlterField(
model_name='user',
name='default_password',
field=models.CharField(default='', max_length=100, blank=True),
),
migrations.AlterField(
model_name='user',
name='first_name',
field=models.CharField(max_length=255, blank=True),
),
migrations.AlterField(
model_name='user',
name='is_active',
field=models.BooleanField(default=True),
),
migrations.AlterField(
model_name='user',
name='is_present',
field=models.BooleanField(default=False),
),
migrations.AlterField(
model_name='user',
name='last_name',
field=models.CharField(max_length=255, blank=True),
),
migrations.AlterField(
model_name='user',
name='structure_level',
field=models.CharField(default='', max_length=255, blank=True),
),
migrations.AlterField(
model_name='user',
name='title',
field=models.CharField(default='', max_length=50, blank=True),
),
migrations.AlterField(
model_name='user',
name='username',
field=models.CharField(max_length=255, blank=True, unique=True),
),
]