Migration fix and seed_data.py modified

remotes/origin/setup
ArturBaybulatov 10 years ago
parent ed753ba1f4
commit ce2293657b
  1. 14
      archilance/management/commands/seed_data.py
  2. 25
      projects/migrations/0001_initial.py
  3. 31
      projects/migrations/0002_answer.py
  4. 35
      projects/migrations/0002_auto_20160519_1022.py
  5. 23
      projects/migrations/0003_auto_20160518_1132.py
  6. 2
      specializations/migrations/0001_initial.py
  7. 13
      users/migrations/0001_initial.py
  8. 27
      users/migrations/0002_auto_20160519_0807.py
  9. 5
      users/models.py

@ -1,10 +1,8 @@
# from cms_pages.models import Menu, CmsPage
# from django.contrib import sites
# from django.core.files import File
from django.core.management import BaseCommand
# from django.db import connection
# from django.db.models import Q
from django.utils import timezone
# from pprint import pprint, pformat
# from wagtail.wagtailcore.models import Page
# import copy
@ -13,10 +11,13 @@ from django.utils import timezone
# import itertools
# import json
# import os
import pydash as _; _.map = _.map_; _.filter = _.filter_
import random
# import requests
# import util
from django.core.management import BaseCommand
from django.utils import timezone
import pydash as _; _.map = _.map_; _.filter = _.filter_
import random
from django.contrib.auth.models import Group
from users.models import User
@ -71,7 +72,10 @@ class Command(BaseCommand):
is_active=_.sample((True, False)),
)
users = _.times(create_user, 100)
Group.objects.create(name='Исполнители')
Group.objects.create(name='Заказчики')
users = _.times(create_user, 50)
for user in users:
user.set_password('123')

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-18 16:08
# Generated by Django 1.9.6 on 2016-05-19 10:22
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
@ -12,18 +11,30 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('specializations', '__first__'),
]
operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('cost', models.DecimalField(decimal_places=2, max_digits=10)),
('cost_type', models.CharField(choices=[('RUR', 'rur'), ('USD', 'usd'), ('EUR', 'eur')], default='RUR', max_length=5)),
('text', models.TextField()),
('term', models.DecimalField(decimal_places=2, max_digits=10)),
('term_type', models.CharField(choices=[('HOUR', 'hour'), ('DAY', 'day'), ('MONTH', 'month')], default='hour', max_length=10)),
],
options={
'verbose_name': 'Ответ к проекту',
'verbose_name_plural': 'Ответы к проектам',
},
),
migrations.CreateModel(
name='Portfolio',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('description', models.TextField()),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
@ -41,12 +52,10 @@ class Migration(migrations.Migration):
('name', models.CharField(max_length=255)),
('price', models.DecimalField(decimal_places=2, max_digits=10)),
('text', models.TextField(blank=True)),
('specialization', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='specializations.Specialization')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='projects', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name_plural': 'Проекты',
'verbose_name': 'Проект',
'verbose_name_plural': 'Проекты',
},
),
]

@ -1,31 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-19 08:44
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('projects', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('cost', models.DecimalField(decimal_places=2, max_digits=10)),
('cost_type', models.CharField(choices=[('RUR', 'rur'), ('USD', 'usd'), ('EUR', 'eur')], default='RUR', max_length=5)),
('text', models.TextField()),
('term', models.DecimalField(decimal_places=2, max_digits=10)),
('term_type', models.CharField(choices=[('HOUR', 'hour'), ('DAY', 'day'), ('MONTH', 'month')], default='hour', max_length=10)),
('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answers', to='projects.Project')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answers', to=settings.AUTH_USER_MODEL)),
],
),
]

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-19 10:22
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('projects', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='portfolio',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='answer',
name='project',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answers', to='projects.Project'),
),
migrations.AddField(
model_name='answer',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answers', to=settings.AUTH_USER_MODEL),
),
]

@ -1,23 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-18 11:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0002_auto_20160517_0903'),
]
operations = [
migrations.RemoveField(
model_name='project',
name='specialization',
),
migrations.RemoveField(
model_name='project',
name='user',
),
]

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-18 16:08
# Generated by Django 1.9.6 on 2016-05-19 10:22
from __future__ import unicode_literals
from django.db import migrations, models

@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-18 16:08
# Generated by Django 1.9.6 on 2016-05-19 10:22
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
@ -30,7 +31,8 @@ class Migration(migrations.Migration):
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'abstract': False,
'verbose_name': 'Пользователь',
'verbose_name_plural': 'Пользователи',
},
),
migrations.CreateModel(
@ -38,7 +40,12 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('users', models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL)),
('owner', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='team', to=settings.AUTH_USER_MODEL)),
('users', models.ManyToManyField(blank=True, related_name='teams', to=settings.AUTH_USER_MODEL)),
],
options={
'verbose_name': 'Команда',
'verbose_name_plural': 'Команды',
},
),
]

@ -1,27 +0,0 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-19 08:07
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='team',
name='owner',
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='team', to=settings.AUTH_USER_MODEL),
),
migrations.AlterField(
model_name='team',
name='users',
field=models.ManyToManyField(blank=True, related_name='teams', to=settings.AUTH_USER_MODEL),
),
]

@ -67,12 +67,7 @@ class Team(models.Model):
def __str__(self):
return self.name
<<<<<<< HEAD
class Meta:
verbose_name = 'Команда'
verbose_name_plural = 'Команды'
=======
>>>>>>> f73c8cbb03160dbcba5094bb2be837d43d1e5f31

Loading…
Cancel
Save