diff --git a/api/views.py b/api/views.py index 48ccbe5..8aaeff2 100755 --- a/api/views.py +++ b/api/views.py @@ -39,11 +39,10 @@ class MessageViewSet(ModelViewSet): search_param = self.request.query_params.get('operand', None) recipent_id = self.request.query_params.get('recipent_id', None) sender_id = self.request.query_params.get('sender_id', None) - # queryset = queryset.filter(Q(sender=self.request.user.pk) | Q(recipent=self.request.user.pk)) - # import code; code.interact(local=dict(globals(), **locals())) if search_param: # import code; code.interact(local=dict(globals(), **locals())) - queryset = queryset.filter(Q(sender=self.request.user.pk) | Q(recipent=self.request.user.pk)) + if search_param == 'in': + queryset = queryset.filter(Q(sender__in=[sender_id,recipent_id]),Q(recipent__in=[sender_id,recipent_id])).order_by('created') return queryset diff --git a/chat/migrations/0001_initial.py b/chat/migrations/0001_initial.py new file mode 100644 index 0000000..8eba38a --- /dev/null +++ b/chat/migrations/0001_initial.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-07 14:55 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('projects', '0017_auto_20160606_1659'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Message', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('text', models.TextField()), + ('created', models.DateTimeField(default=django.utils.timezone.now)), + ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='projects.Order')), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to=settings.AUTH_USER_MODEL)), + ], + ), + ] diff --git a/chat/migrations/0002_auto_20160608_1555.py b/chat/migrations/0002_auto_20160608_1555.py new file mode 100644 index 0000000..d990d75 --- /dev/null +++ b/chat/migrations/0002_auto_20160608_1555.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-08 12:55 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('chat', '0001_initial'), + ] + + operations = [ + migrations.AlterModelOptions( + name='message', + options={'verbose_name': 'Сообщение', 'verbose_name_plural': 'Сообщения'}, + ), + ] diff --git a/chat/migrations/0003_auto_20160629_1914.py b/chat/migrations/0003_auto_20160629_1914.py new file mode 100644 index 0000000..571da68 --- /dev/null +++ b/chat/migrations/0003_auto_20160629_1914.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-29 16:14 +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), + ('chat', '0002_auto_20160608_1555'), + ] + + operations = [ + migrations.RemoveField( + model_name='message', + name='user', + ), + migrations.AddField( + model_name='message', + name='recipent', + field=models.ForeignKey(default=5, on_delete=django.db.models.deletion.CASCADE, related_name='recipent_messages', to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + migrations.AddField( + model_name='message', + name='sender', + field=models.ForeignKey(default=4, on_delete=django.db.models.deletion.CASCADE, related_name='sender_messages', to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + migrations.AlterField( + model_name='message', + name='order', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_messages', to='projects.Order'), + ), + ] diff --git a/chat/migrations/0004_auto_20160630_1204.py b/chat/migrations/0004_auto_20160630_1204.py new file mode 100644 index 0000000..9604c3e --- /dev/null +++ b/chat/migrations/0004_auto_20160630_1204.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-30 09:04 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('chat', '0003_auto_20160629_1914'), + ] + + operations = [ + migrations.AddField( + model_name='message', + name='private_type', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='message', + name='order', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='order_messages', to='projects.Order'), + ), + ] diff --git a/chat/migrations/0005_notes.py b/chat/migrations/0005_notes.py new file mode 100644 index 0000000..fea1d07 --- /dev/null +++ b/chat/migrations/0005_notes.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-04 11:44 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('chat', '0004_auto_20160630_1204'), + ] + + operations = [ + migrations.CreateModel( + name='Notes', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('text', models.TextField()), + ], + options={ + 'verbose_name_plural': 'Сообщения', + 'verbose_name': 'Сообщение', + }, + ), + ] diff --git a/chat/migrations/0006_auto_20160704_1811.py b/chat/migrations/0006_auto_20160704_1811.py new file mode 100644 index 0000000..6df4f18 --- /dev/null +++ b/chat/migrations/0006_auto_20160704_1811.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-04 15:11 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0037_auto_20160704_1444'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('chat', '0005_notes'), + ] + + operations = [ + migrations.AlterModelOptions( + name='notes', + options={'verbose_name': 'Заметка', 'verbose_name_plural': 'Заметки'}, + ), + migrations.AddField( + model_name='notes', + name='created', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + migrations.AddField( + model_name='notes', + name='order', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='order_notes', to='projects.Order'), + ), + migrations.AddField( + model_name='notes', + name='recipent', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='recipent_notes', to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + migrations.AddField( + model_name='notes', + name='sender', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='sender_notes', to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + ] diff --git a/chat/migrations/__init__.py b/chat/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/chat/templates/chat_contractor.html b/chat/templates/chat_contractor.html index 1ac5f6f..2f27655 100644 --- a/chat/templates/chat_contractor.html +++ b/chat/templates/chat_contractor.html @@ -1,482 +1,512 @@ {% extends 'partials/base.html' %} {% load staticfiles %} +{% load thumbnail %} {% block content %} -{% include 'partials/header.html' %} -
-
-
-

Чат {{ request.user }}

-
-
-
-
-
- +
+
+
+
+
+
+
+

Контакты

+ {% for contact in contacts_users %} +
+
+ {% thumbnail contact.avatar "60x60" crop="center" as im %} + mess-image + {% endthumbnail %} +
+

+ + {{ contact.username }}{{ contact.username }}{{ contact.first_name }} {{ contact.last_name }} +

+ Контакты + + 0 + + Удалить контакт + +
+ {% endfor %} + +
+
+
+
+ +
+ + + + + +
+
+

Прикрепить файл

Не более 10 файлов с общим объемом 500мб -
- - отправить - -
- - -
-
-
-

Контакты

- -
-
-
- Начало: - Срок сдачи: -
-
- 13.0.2016 - 13.0.2016 -
-
-
-

Входящие документы

-
    -
  • - Архитерурное 2.jpg - 7мб -
    -
  • - -
- - Распечатать с помощью ресурса - -
-
-

Для заметок

- - сохранить -
- - -
-
-
-
- -
-

Заказы

- {% for order in orders %} -
- -

- {{ order }} -

-
-

- Испонитель: {{ request.user.get_full_name }} -

-

- Чаты: Иванов, Петров, Пенкин -

- - - Полное описание заказа - -
-
- {% endfor%} -
- -
-
-
- {% for msg in chat_messages %} -
-
-

{{ msg.sender.get_full_name }}

- {{ msg.created }} -
-

{{ msg }}

-
- {% endfor %} +
+ + отправить + +
+ + +
+
+
+

Контакты

+ +
+
+
+ Начало: + Срок сдачи: +
+
+ 13.0.2016 + 13.0.2016 +
+
+
+

Входящие документы

+
    +
  • + Архитерурное 2.jpg + 7мб +
    +
  • + +
+ + Распечатать с помощью ресурса + +
+
+

Для заметок

+ + сохранить +
+ + +
-
- - - - - -
-
-

Прикрепить файл

+
+
+ +
+

Заказы

+ {% for order in orders %} +
+ +

+ {{ order }} +

+
+

+ Испонитель: {{ request.user.get_full_name }} +

+

+ Чаты: Иванов, Петров, Пенкин +

+ + + Полное описание заказа + +
+
+ {% endfor %} +
+ +
+
+
+ {# {% for msg in chat_messages %}#} + {#
#} + {#
#} + {#

{{ msg.sender.get_full_name }}

#} + {# {{ msg.created }}#} + {#
#} + {#

{{ msg }}

#} + {#
#} + {# {% endfor %}#} +
+ + + + + + +
+
+

Прикрепить файл

Не более 10 файлов с общим объемом 500мб -
- отправить -
- -
-
-
-

Для заметок

- - сохранить -
- -
-
-
-
-
-

Заказы

-
- -

- Дизай-проект квартиры на набережной 200 m2 -

-
-

- Заказчик: Группа Икс -

-
    -
  • Иванов Петр Иванович
  • -
  • Сергей Пенкин
  • -
- - - Полное описание заказа - -
-
-
- -

- Дизай-проект квартиры на набережной 200 m2 -

-
-

- Заказчик: Группа Икс -

-
    -
  • Иванов Петр Иванович
  • -
  • Сергей Пенкин
  • -
- - - Полное описание заказа - -
-
-
-
-
-
-
-

- Иванов Петр Иванович -

+
+ отправить +
+ +
+
+
+

Для заметок

+ + сохранить +
+ +
+
+
+
+
+

Заказы

+
+ +

+ Дизай-проект квартиры на набережной 200 m2 +

+
+

+ Заказчик: Группа Икс +

+
    +
  • Иванов Петр Иванович
  • +
  • Сергей Пенкин
  • +
+ + + Полное описание заказа + +
+
+
+ +

+ Дизай-проект квартиры на набережной 200 m2 +

+
+

+ Заказчик: Группа Икс +

+
    +
  • Иванов Петр Иванович
  • +
  • Сергей Пенкин
  • +
+ + + Полное описание заказа + +
+
+
+
+
+
+
+

+ Иванов Петр Иванович +

13.0.2016 / 21:05 -
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit

-
-
-
-

- Вы -

+
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit

+
+
+
+

+ Вы +

13.0.2016 / 21:05 -
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit.

-
- -
-
-

Прикрепить файл

+
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit.

+
+ +
+
+

Прикрепить файл

Не более 10 файлов с общим объемом 500мб -
- отправить -
-
-
-

Этапы работы

-
-

1 / Согласование условий

-

- Обсуджение задания и условий выполнения работы. Подтверждение заказа исполнителем. -

-
-
-
-

- Этап 1Название этапа -

-

- Результаты этапа: Готовый чертеж 1 -

-
-

до 16.03.2015

- 30 000 -
-
-
-
-
-

- Этап 2Название этапа -

-

- Результаты этапа: Готовый чертеж 1 -

-
-

до 16.03.2015

- 30 000 -
-
-
- -
-

2 / Резервирование

-

- Резервирование заказчиком суммы оплаты по заказ. Деньги перечисляются и хранятся на сайте. -

-
    -
  • Сумма еще не зарезервирована
  • -
  • Сумма за этап1, Зарезервирована
  • -
-
-
-

3 / Выполнение работы

-

- Процесс выполнения задания в заказе до получения заказчиком итогового результата работы. -

-
-
-
-
- {% include 'partials/footer.html' %} -
-
+
+ отправить + + +
+

Этапы работы

+
+

1 / Согласование условий

+

+ Обсуджение задания и условий выполнения работы. Подтверждение заказа исполнителем. +

+
+
+
+

+ Этап 1Название этапа +

+

+ Результаты этапа: Готовый чертеж 1 +

+
+

до 16.03.2015

+ 30 000 +
+
+
+
+
+

+ Этап 2Название этапа +

+

+ Результаты этапа: Готовый чертеж 1 +

+
+

до 16.03.2015

+ 30 000 +
+
+
+
+ согласовать +
+
+

2 / Резервирование

+

+ Резервирование заказчиком суммы оплаты по заказ. Деньги перечисляются и хранятся на + сайте. +

+ +
+
+

3 / Выполнение работы

+

+ Процесс выполнения задания в заказе до получения заказчиком итогового результата работы. +

+
+
+ + + {% include 'partials/footer.html' %} + + {% endblock %} {% block js_block %} -{# #} - #} + + }); + {% endblock %} diff --git a/chat/templates/chat_customer.html b/chat/templates/chat_customer.html index aab3ae6..8e2c2d9 100644 --- a/chat/templates/chat_customer.html +++ b/chat/templates/chat_customer.html @@ -1,326 +1,421 @@ {% extends 'partials/base.html' %} {% load staticfiles %} +{% load thumbnail %} {% block content %} -{% include 'partials/header.html' %} -
-
-
-

Чат

-
-
-
-
- -
-
-
-
-
-
-

Контакты

- {% for contact in customer_contacts %} - - - {% endfor %} + {% include 'partials/header.html' %} +
+
+
+

Чат

+
+
+
+
+ +
+
+
+
+
+
+

Контакты

+ {% for contact in contacts_users %} +
+
+ {% thumbnail contact.avatar "60x60" crop="center" as im %} + mess-image + {% endthumbnail %} +
+

+ {{ contact.username }} {{ contact.username }} +

+ Контакты + 0 + + Удалить контакт + +
+ {% endfor %} -
-
-
-
-
-
- - - - -
-
-

Прикрепить файл

+
+
+
+
+
+ + + + + +
+
+

Прикрепить файл

Не более 10 файлов с общим объемом 500мб -
+
- отправить + отправить -
-
- -
-
-
-

Контакты

- -
-
-
- Начало: - Срок сдачи: -
-
- 13.0.2016 - 13.0.2016 -
-
-
-

Входящие документы

-
    -
  • - Архитерурное 2.jpg - 7мб -
    -
  • -
- - Распечатать с помощью ресурса - -
-
-

Для заметок

- - сохранить -
- - -
-
-
-
- -
-

Заказы

- {% for order in orders %} -
- -

- {{ order }} -

-
-

- Испонитель: {{ order.order.contractor.get_full_name }} -

-{#

#} -{# Чаты: Иванов, Петров, Пенкин#} -{#

#} - - - Полное описание заказа - -
-
- {% endfor%} -
+
+ -
-
-
- {% for msg in chat_messages %} -{#
#} -{#
#} -{#

{{ msg.sender.get_full_name }}

#} -{# {{ msg.created }}#} -{#
#} -{#

{{ msg }}

#} -{#
#} - {% endfor %} +
+
+
+

Контакты

+ +
+
+
+ Начало: + Срок сдачи: +
+
+ 13.0.2016 + 13.0.2016 +
+
+
+

Входящие документы

+
    +
  • + Архитерурное 2.jpg + 7мб +
    +
  • +
+ + Распечатать с помощью ресурса + +
+
+

Для заметок

+ + сохранить +
+ + +
-
- - - - -
-
-

Прикрепить файл

+
+
+ +
+

Заказы

+ {% for order in orders %} +
+ +

+ {{ order }} +

+
+

+ Испонитель: {{ order.order.contractor.get_full_name }} +

+ {#

#} + {# Чаты: Иванов, Петров, Пенкин#} + {#

#} + + + Полное описание заказа + +
+
+ {% endfor %} +
+ +
+
+
+ {% for msg in chat_messages %} + {#
#} + {#
#} + {#

{{ msg.sender.get_full_name }}

#} + {# {{ msg.created }}#} + {#
#} + {#

{{ msg }}

#} + {#
#} + {% endfor %} +
+ + + + + +
+
+

Прикрепить файл

Не более 10 файлов с общим объемом 500мб +
+ отправить +
+ +
+
+

Этапы работы

+
+

1 / Согласование условий

+

+ Обсуджение задания и условий выполнения работы. Подтверждение заказа исполнителем. +

+
+
+
+

+ Этап 1 +

+
+
+ + + + +
+ + сохранить +
+
- отправить
- -
-
-
-

Для заметок

- - сохранить +
+
+

+ Этап 2Название этапа +

+

+ Результаты этапа: Готовый чертеж 1 +

+
+

до 16.03.2015

+ 30 000 +
+
- -
-
- {% include 'partials/footer.html' %} -
-
+ +
+

Для заметок

+ + сохранить +
+ +
+
+
+ {% include 'partials/footer.html' %} +
+
{% endblock %} {% block js_block %} + {% endblock %} diff --git a/chat/testapp.py b/chat/testapp.py index 401abf0..f8e5fa7 100644 --- a/chat/testapp.py +++ b/chat/testapp.py @@ -56,10 +56,8 @@ class TutorialHandler(websocket.WebSocketHandler): waiters = set() def open(self, *args, **kwargs): - self.waiters.add(self) - # print(dir(self)) - print(self.patch) - # print(self.waiters) + self.user_id = kwargs.get('user_id',1) + self.waiters.add((self.user_id, self)) # @gen.coroutine def on_message(self, message): @@ -70,13 +68,16 @@ class TutorialHandler(websocket.WebSocketHandler): if parsed['format_type'] == 'add_message_contact': self.add_message_for_contact(parsed['data']['chat_message'], parsed['data']['sender_id'], parsed['data']['recipent_id']) + elif parsed['format_type'] == 'add_message_order': + self.add_message_for_order(parsed['data']['chat_message'], parsed['data']['sender_id'], + parsed['data']['recipent_id'], parsed['data']['order_id']) elif parsed['format_type'] == 'order_message': self.get_messages_from_order_chat(parsed['order_id']) else: self.get_messages_from_order(parsed['user_id']) def on_close(self): - self.waiters.remove(self) + self.waiters.remove((self.user_id, self)) # insert_sql = "INSERT INTO chat_message (id,text,created,order_id, user_id) VALUES (DEFAULT,'{0}',NOW(),6,4)".format(str(parsed['message'])) # yield self.db.execute(insert_sql) @@ -91,9 +92,19 @@ class TutorialHandler(websocket.WebSocketHandler): insert_sql = "INSERT INTO chat_message (id,text,created,order_id, sender_id,recipent_id, private_type) " \ "VALUES (DEFAULT,'{0}',NOW(),NULL,{1},{2},'true')".format(message, sender_id, recipent_id) yield self.db.execute(insert_sql) - for waiter in self.waiters: + waiters = tuple(w for c, w in self.waiters if c == recipent_id) + for waiter in waiters: waiter.write_message({'msg': message, 'answer_type': 'add_contact'}) + @gen.coroutine + def add_message_for_order(self, message, sender_id,recipent_id, order_id): + insert_sql = "INSERT INTO chat_message (id,text,created,order_id, sender_id,recipent_id, private_type) " \ + "VALUES (DEFAULT,'{0}',NOW(),{1},{2},{3},'false')".format(message,order_id, sender_id, recipent_id) + yield self.db.execute(insert_sql) + waiters = tuple(w for c, w in self.waiters if c == recipent_id) + for waiter in waiters: + waiter.write_message({'msg': message, 'answer_type': 'add_order'}) + @gen.coroutine def get_messages_from_order(self, order_id): sql = "SELECT text FROM chat_message WHERE recipent_id=" + order_id @@ -119,7 +130,7 @@ class TutorialHandler(websocket.WebSocketHandler): class Application(web.Application): def __init__(self): handlers = [ - (r"/chat", TutorialHandler), + (r"/chat/(?P\d+)/", TutorialHandler), (r"/test", TestHandler), ] super().__init__(handlers=handlers, **settings) diff --git a/chat/views.py b/chat/views.py index 9bae005..e1d3b70 100644 --- a/chat/views.py +++ b/chat/views.py @@ -3,6 +3,7 @@ from django.views.generic import View from django.db.models import Q from .models import Message +from users.models import User class ChatUserView(View): @@ -10,25 +11,40 @@ class ChatUserView(View): def get(self, request, *args, **kwargs): if request.user.is_authenticated() and request.user.is_customer(): - customer_contacts = Message.objects.values('sender_id','recipent_id').\ - filter(Q(recipent_id=request.user.pk)| Q(sender_id=request.user.pk)).distinct() + customer_contacts = Message.objects.values_list('sender_id', 'recipent_id'). \ + filter(Q(recipent_id=request.user.pk) | Q(sender_id=request.user.pk)).distinct() + + users_ids = [] + for msg in customer_contacts: + a, b = msg + if a != request.user.pk: + users_ids.append(a) + if b != request.user.pk: + users_ids.append(b) + contacts_users = User.objects.filter(pk__in=users_ids) + chat_messages = Message.objects.filter(Q(sender=request.user.pk) | Q(recipent=request.user.pk)) orders = request.user.projects.select_related('order').all() self.template_name = 'chat_customer.html' - return render(request, self.template_name, {'customer_contacts': customer_contacts, + return render(request, self.template_name, {'contacts_users': contacts_users, 'chat_messages': chat_messages, 'orders': orders}) else: orders = request.user.orders.all() - # contractor_contacts = request.user.sender_messages.values('recipent_id').distinct('recipent_id').\ - # values('recipent_id__email', 'recipent_id__first_name', 'recipent_id__last_name', 'recipent_id__id') - contractor_contacts = Message.objects.values('sender_id','recipent_id').\ - filter(Q(recipent_id=request.user.pk)| Q(sender_id=request.user.pk)).distinct() - - chat_messages = Message.objects.filter(Q(sender=request.user.pk) | Q(recipent=request.user.pk)).order_by('created') + contractor_contacts = Message.objects.values_list('sender_id', 'recipent_id').filter( + Q(recipent_id=request.user.pk) | Q(sender_id=request.user.pk)).distinct() + users_ids = [] + for msg in contractor_contacts: + a, b = msg + if a != request.user.pk: + users_ids.append(a) + if b != request.user.pk: + users_ids.append(b) + contacts_users = User.objects.filter(pk__in=users_ids) + chat_messages = Message.objects.filter(Q(sender=request.user.pk) | Q(recipent=request.user.pk)).order_by( + 'created') self.template_name = 'chat_contractor.html' return render(request, self.template_name, {'orders': orders, - 'contractor_contacts': contractor_contacts, - 'chat_messages': chat_messages}) - - + 'contacts_users': contacts_users, + 'chat_messages': chat_messages + }) diff --git a/common/migrations/0001_initial.py b/common/migrations/0001_initial.py new file mode 100644 index 0000000..38ffe2f --- /dev/null +++ b/common/migrations/0001_initial.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-07-21 15:08 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import django.db.models.manager +import mptt.fields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Location', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=50)), + ('type', models.CharField(choices=[('_root', 'Корень'), ('country', 'Страна'), ('region', 'Регион'), ('town', 'Город')], max_length=20)), + ('lft', models.PositiveIntegerField(db_index=True, editable=False)), + ('rght', models.PositiveIntegerField(db_index=True, editable=False)), + ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)), + ('level', models.PositiveIntegerField(db_index=True, editable=False)), + ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='common.Location')), + ], + options={ + 'verbose_name': 'Местоположение', + 'verbose_name_plural': 'Местоположения', + }, + managers=[ + ('_default_manager', django.db.models.manager.Manager()), + ], + ), + migrations.CreateModel( + name='MainPage', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('contractor_text', models.TextField()), + ('customer_text', models.TextField()), + ('video_code', models.TextField()), + ], + options={ + 'verbose_name': 'Главная страница', + }, + ), + migrations.CreateModel( + name='Settings', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('time_notification', models.IntegerField(default=180)), + ], + options={ + 'verbose_name': 'Настройки сайта', + 'verbose_name_plural': 'Настройки сайта', + }, + ), + ] diff --git a/common/migrations/0002_auto_20160615_1625.py b/common/migrations/0002_auto_20160615_1625.py new file mode 100644 index 0000000..cbdd8cd --- /dev/null +++ b/common/migrations/0002_auto_20160615_1625.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-15 13:25 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0001_initial'), + ] + + operations = [ + migrations.RemoveField( + model_name='city', + name='country', + ), + migrations.AlterField( + model_name='location', + name='type', + field=models.CharField(choices=[('_root', 'Корень'), ('country', 'Страна'), ('region', 'Регион'), ('town', 'Город')], default=None, max_length=20), + preserve_default=False, + ), + migrations.DeleteModel( + name='City', + ), + migrations.DeleteModel( + name='Country', + ), + ] diff --git a/common/migrations/0003_mainpage.py b/common/migrations/0003_mainpage.py new file mode 100644 index 0000000..c92a300 --- /dev/null +++ b/common/migrations/0003_mainpage.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-05 07:25 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0002_auto_20160615_1625'), + ] + + operations = [ + migrations.CreateModel( + name='MainPage', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('contractor_text', models.TextField()), + ('customer_text', models.TextField()), + ('video_code', models.TextField()), + ], + options={ + 'verbose_name': 'Главная страница', + }, + ), + ] diff --git a/common/migrations/0004_settings.py b/common/migrations/0004_settings.py new file mode 100644 index 0000000..eb89b59 --- /dev/null +++ b/common/migrations/0004_settings.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-07-13 09:17 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0003_mainpage'), + ] + + operations = [ + migrations.CreateModel( + name='Settings', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('time_notification', models.IntegerField(default=180)), + ], + options={ + 'verbose_name': 'Настройки сайта', + }, + ), + ] diff --git a/common/migrations/__init__.py b/common/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/projects/migrations/0001_initial.py b/projects/migrations/0001_initial.py new file mode 100644 index 0000000..6eb2ceb --- /dev/null +++ b/projects/migrations/0001_initial.py @@ -0,0 +1,176 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-07-21 15:08 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone +import mptt.fields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('common', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Answer', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('budget', models.DecimalField(decimal_places=0, max_digits=10)), + ('created', models.DateTimeField(default=django.utils.timezone.now)), + ('currency', models.CharField(choices=[('rur', 'RUR'), ('usd', 'USD'), ('eur', 'EUR')], default='rur', max_length=5)), + ('term', models.IntegerField(default=0)), + ('term_type', models.CharField(choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=10)), + ('text', models.TextField()), + ], + options={ + 'verbose_name': 'Ответ к проекту', + 'ordering': ('-created',), + 'verbose_name_plural': 'Ответы к проектам', + }, + ), + migrations.CreateModel( + name='BuildingClassfication', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ], + options={ + 'verbose_name': 'Тип здания', + 'verbose_name_plural': 'Типы зданий', + }, + ), + migrations.CreateModel( + name='Candidate', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('status', models.BooleanField(default=False)), + ], + options={ + 'verbose_name': 'Кандидат', + 'verbose_name_plural': 'Кандидаты', + }, + ), + migrations.CreateModel( + name='ConstructionType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ], + options={ + 'verbose_name': 'Вид строительства', + 'verbose_name_plural': 'Виды строительства', + }, + ), + migrations.CreateModel( + name='Order', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created', models.DateTimeField(default=django.utils.timezone.now)), + ('secure', models.BooleanField(default=False)), + ('status', models.BooleanField(default=False)), + ], + 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')), + ('budget', models.DecimalField(blank=True, decimal_places=0, default=0, max_digits=10, null=True)), + ('currency', models.CharField(blank=True, choices=[('rur', 'RUR'), ('usd', 'USD'), ('eur', 'EUR')], default='rur', max_length=20, null=True)), + ('description', models.TextField()), + ('name', models.CharField(max_length=255)), + ('term', models.IntegerField(blank=True, default=0, null=True)), + ('term_type', models.CharField(blank=True, choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=20, null=True)), + ('worksell', models.BooleanField(default=False)), + ], + options={ + 'verbose_name': 'Портфолио', + 'verbose_name_plural': 'Портфолио', + }, + ), + migrations.CreateModel( + name='PortfolioPhoto', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('img', models.ImageField(upload_to='projects/portfolio')), + ], + options={ + 'verbose_name': 'Фото портфолио', + 'verbose_name_plural': 'Фото портфолио', + }, + ), + migrations.CreateModel( + name='Project', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('budget', models.DecimalField(decimal_places=0, max_digits=10)), + ('budget_by_agreement', models.BooleanField(default=False)), + ('created', models.DateTimeField(default=django.utils.timezone.now)), + ('cro', models.BooleanField(default=False)), + ('currency', models.CharField(choices=[('rur', 'RUR'), ('usd', 'USD'), ('eur', 'EUR')], default='rur', max_length=20)), + ('deal_type', models.CharField(choices=[('secure_deal', 'Безопасная сделка (с резервированием бюджета) '), ('direct_payment', 'Прямая оплата Исполнителю на его кошелек/счет')], default='secure_deal', max_length=20)), + ('name', models.CharField(max_length=255)), + ('price_and_term_required', models.BooleanField(default=False)), + ('state', models.CharField(choices=[('active', 'Активный'), ('trashed', 'В корзине'), ('deleted', 'Удален')], default='active', max_length=20)), + ('term', models.IntegerField(default=0)), + ('term_type', models.CharField(choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=20)), + ('text', models.TextField(blank=True)), + ('work_type', models.IntegerField(choices=[(1, 'Проектирование'), (2, 'Техническое сопровождение')], default=1)), + ], + options={ + 'verbose_name': 'Проект', + 'verbose_name_plural': 'Проекты', + }, + ), + migrations.CreateModel( + name='ProjectFile', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('file', models.FileField(upload_to='projects/project_files')), + ], + options={ + 'verbose_name': 'Файл проекта', + 'verbose_name_plural': 'Файлы проектов', + }, + ), + migrations.CreateModel( + name='Realty', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('building_classification', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='realties', to='projects.BuildingClassfication')), + ('construction_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='realties', to='projects.ConstructionType')), + ('location', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='realties', to='common.Location')), + ], + options={ + 'verbose_name': 'Объект', + 'verbose_name_plural': 'Объекты', + }, + ), + migrations.CreateModel( + name='Stage', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('cost', models.DecimalField(decimal_places=0, max_digits=10)), + ('cost_type', models.CharField(choices=[('rur', 'RUR'), ('usd', 'USD'), ('eur', 'EUR')], default='rur', max_length=5)), + ('name', models.CharField(max_length=255)), + ('result', models.CharField(max_length=255)), + ('term', models.IntegerField(default=0)), + ('term_type', models.CharField(choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=10)), + ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stages', to='projects.Order')), + ], + options={ + 'verbose_name': 'Этап', + 'verbose_name_plural': 'Этапы', + }, + ), + ] diff --git a/projects/migrations/0002_auto_20160519_1022.py b/projects/migrations/0002_auto_20160519_1022.py new file mode 100644 index 0000000..a2bcea9 --- /dev/null +++ b/projects/migrations/0002_auto_20160519_1022.py @@ -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), + ), + ] diff --git a/projects/migrations/0003_auto_20160519_1312.py b/projects/migrations/0003_auto_20160519_1312.py new file mode 100644 index 0000000..098a86d --- /dev/null +++ b/projects/migrations/0003_auto_20160519_1312.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-19 13:12 +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 = [ + ('specializations', '0001_initial'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('projects', '0002_auto_20160519_1022'), + ] + + operations = [ + migrations.AddField( + model_name='project', + name='specialization', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='specializations.Specialization'), + ), + migrations.AddField( + model_name='project', + name='user', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='projects', to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + ] diff --git a/projects/migrations/0004_auto_20160519_1338.py b/projects/migrations/0004_auto_20160519_1338.py new file mode 100644 index 0000000..7370c40 --- /dev/null +++ b/projects/migrations/0004_auto_20160519_1338.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-19 13:38 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0003_auto_20160519_1312'), + ] + + operations = [ + migrations.AlterField( + model_name='project', + name='specialization', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='specializations.Specialization'), + ), + ] diff --git a/projects/migrations/0005_auto_20160524_1053.py b/projects/migrations/0005_auto_20160524_1053.py new file mode 100644 index 0000000..823426b --- /dev/null +++ b/projects/migrations/0005_auto_20160524_1053.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-24 10:53 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0004_auto_20160519_1338'), + ] + + operations = [ + migrations.AlterModelOptions( + name='portfolio', + options={'verbose_name': 'Портфолио', 'verbose_name_plural': 'Портфолио'}, + ), + migrations.AlterModelOptions( + name='portfoliophoto', + options={'verbose_name': 'Фото портфолио', 'verbose_name_plural': 'Фото портфолио'}, + ), + migrations.AddField( + model_name='answer', + name='created', + field=models.DateTimeField(default=datetime.datetime(2016, 5, 24, 10, 53, 28, 347882)), + ), + migrations.AlterField( + model_name='answer', + name='cost_type', + field=models.CharField(choices=[('rur', 'rur'), ('usd', 'usd'), ('eur', 'eur')], default='RUR', max_length=5), + ), + migrations.AlterField( + model_name='answer', + name='term_type', + field=models.CharField(choices=[('hour', 'hour'), ('day', 'day'), ('month', 'month')], default='HOUR', max_length=10), + ), + ] diff --git a/projects/migrations/0006_auto_20160524_1208.py b/projects/migrations/0006_auto_20160524_1208.py new file mode 100644 index 0000000..33afe73 --- /dev/null +++ b/projects/migrations/0006_auto_20160524_1208.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-24 12:08 +from __future__ import unicode_literals + +import datetime +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', '0005_auto_20160524_1053'), + ] + + operations = [ + migrations.CreateModel( + name='Candidate', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('status', models.BooleanField(default=False)), + ], + options={ + 'verbose_name': 'Кандидат', + 'verbose_name_plural': 'Кандидаты', + }, + ), + migrations.AddField( + model_name='project', + name='budget', + field=models.CharField(blank=True, max_length=20), + ), + migrations.AddField( + model_name='project', + name='cro', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='project', + name='secure_transaction', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='project', + name='term_cost', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='project', + name='type_work', + field=models.CharField(choices=[('1', 'проектирование'), ('2', 'техническое сопровождение')], default='1', max_length=20), + ), + migrations.AlterField( + model_name='answer', + name='cost_type', + field=models.CharField(choices=[('rur', 'rur'), ('usd', 'usd'), ('eur', 'eur')], default='rur', max_length=5), + ), + migrations.AlterField( + model_name='answer', + name='created', + field=models.DateTimeField(default=datetime.datetime(2016, 5, 24, 12, 8, 51, 751897)), + ), + migrations.AlterField( + model_name='answer', + name='term_type', + field=models.CharField(choices=[('hour', 'hour'), ('day', 'day'), ('month', 'month')], default='hour', max_length=10), + ), + migrations.AddField( + model_name='candidate', + name='project', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='candidates', to='projects.Project'), + ), + migrations.AddField( + model_name='candidate', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='candidates', to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/projects/migrations/0007_auto_20160525_0948.py b/projects/migrations/0007_auto_20160525_0948.py new file mode 100644 index 0000000..311806e --- /dev/null +++ b/projects/migrations/0007_auto_20160525_0948.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-25 09:48 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0006_auto_20160524_1208'), + ] + + operations = [ + migrations.AlterField( + model_name='answer', + name='created', + field=models.DateTimeField(default=datetime.datetime(2016, 5, 25, 9, 48, 35, 275911)), + ), + ] diff --git a/projects/migrations/0008_auto_20160525_1044.py b/projects/migrations/0008_auto_20160525_1044.py new file mode 100644 index 0000000..71edc9f --- /dev/null +++ b/projects/migrations/0008_auto_20160525_1044.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-25 10:44 +from __future__ import unicode_literals + +import datetime +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', '0007_auto_20160525_0948'), + ] + + operations = [ + migrations.CreateModel( + name='Realty', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('building_classification', models.CharField(max_length=50)), + ('type_construction', models.CharField(max_length=50)), + ('country', models.CharField(max_length=50)), + ('city', models.CharField(max_length=50)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='realty', to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.AlterField( + model_name='answer', + name='created', + field=models.DateTimeField(default=datetime.datetime(2016, 5, 25, 10, 44, 29, 360210)), + ), + migrations.AddField( + model_name='project', + name='realty', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='projects.Realty'), + ), + ] diff --git a/projects/migrations/0009_auto_20160525_1524.py b/projects/migrations/0009_auto_20160525_1524.py new file mode 100644 index 0000000..6f35dc9 --- /dev/null +++ b/projects/migrations/0009_auto_20160525_1524.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-25 15:24 +from __future__ import unicode_literals + +import datetime +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('projects', '0008_auto_20160525_1044'), + ] + + operations = [ + migrations.CreateModel( + name='Order', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('cost', models.DecimalField(decimal_places=2, max_digits=10)), + ('term', models.IntegerField(default=1)), + ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)), + ('status', models.BooleanField(default=False)), + ('contractor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ('project', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='order', to='projects.Project')), + ], + ), + migrations.AlterModelOptions( + name='realty', + options={'verbose_name': 'Объект', 'verbose_name_plural': 'Объекты'}, + ), + migrations.AlterField( + model_name='answer', + name='created', + field=models.DateTimeField(default=datetime.datetime(2016, 5, 25, 15, 24, 2, 462642)), + ), + ] diff --git a/projects/migrations/0010_auto_20160525_1525.py b/projects/migrations/0010_auto_20160525_1525.py new file mode 100644 index 0000000..77bc8e9 --- /dev/null +++ b/projects/migrations/0010_auto_20160525_1525.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-25 15:25 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0009_auto_20160525_1524'), + ] + + operations = [ + migrations.AlterField( + model_name='answer', + name='created', + field=models.DateTimeField(default=datetime.datetime(2016, 5, 25, 15, 25, 42, 489763, tzinfo=utc)), + ), + ] diff --git a/projects/migrations/0011_auto_20160525_1526.py b/projects/migrations/0011_auto_20160525_1526.py new file mode 100644 index 0000000..601de14 --- /dev/null +++ b/projects/migrations/0011_auto_20160525_1526.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-25 15:26 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0010_auto_20160525_1525'), + ] + + operations = [ + migrations.AlterField( + model_name='answer', + name='created', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + ] diff --git a/projects/migrations/0012_auto_20160530_1355.py b/projects/migrations/0012_auto_20160530_1355.py new file mode 100644 index 0000000..555079f --- /dev/null +++ b/projects/migrations/0012_auto_20160530_1355.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-30 13:55 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0011_auto_20160525_1526'), + ] + + operations = [ + migrations.AlterModelOptions( + name='order', + options={'verbose_name': 'Заказ', 'verbose_name_plural': 'Заказы'}, + ), + migrations.AddField( + model_name='project', + name='created', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + migrations.AlterField( + model_name='portfolio', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='portfolio', to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/projects/migrations/0013_auto_20160602_1203.py b/projects/migrations/0013_auto_20160602_1203.py new file mode 100644 index 0000000..538672d --- /dev/null +++ b/projects/migrations/0013_auto_20160602_1203.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-02 12:03 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0012_auto_20160530_1355'), + ] + + operations = [ + migrations.AlterField( + model_name='answer', + name='term', + field=models.IntegerField(default=0), + ), + ] diff --git a/projects/migrations/0014_auto_20160602_1559.py b/projects/migrations/0014_auto_20160602_1559.py new file mode 100644 index 0000000..40f79c9 --- /dev/null +++ b/projects/migrations/0014_auto_20160602_1559.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-02 15:59 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0013_auto_20160602_1203'), + ] + + operations = [ + migrations.AlterModelOptions( + name='answer', + options={'ordering': ('-created',), 'verbose_name': 'Ответ к проекту', 'verbose_name_plural': 'Ответы к проектам'}, + ), + migrations.AlterField( + model_name='order', + name='cost', + field=models.DecimalField(decimal_places=0, max_digits=10), + ), + migrations.AlterField( + model_name='project', + name='price', + field=models.DecimalField(decimal_places=0, max_digits=10), + ), + ] diff --git a/projects/migrations/0015_auto_20160602_1606.py b/projects/migrations/0015_auto_20160602_1606.py new file mode 100644 index 0000000..e4caee6 --- /dev/null +++ b/projects/migrations/0015_auto_20160602_1606.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-02 16:06 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0014_auto_20160602_1559'), + ] + + operations = [ + migrations.AlterField( + model_name='answer', + name='cost', + field=models.DecimalField(decimal_places=0, max_digits=10), + ), + ] diff --git a/projects/migrations/0016_auto_20160603_1140.py b/projects/migrations/0016_auto_20160603_1140.py new file mode 100644 index 0000000..a451cb6 --- /dev/null +++ b/projects/migrations/0016_auto_20160603_1140.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-03 11:40 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0015_auto_20160602_1606'), + ] + + operations = [ + migrations.RemoveField( + model_name='candidate', + name='user', + ), + migrations.AddField( + model_name='candidate', + name='answer', + field=models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='candidates', to='projects.Answer'), + preserve_default=False, + ), + ] diff --git a/projects/migrations/0017_auto_20160606_1659.py b/projects/migrations/0017_auto_20160606_1659.py new file mode 100644 index 0000000..96de7fd --- /dev/null +++ b/projects/migrations/0017_auto_20160606_1659.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-06 13:59 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0016_auto_20160603_1140'), + ] + + operations = [ + migrations.CreateModel( + name='Stage', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('result', models.CharField(max_length=255)), + ('cost', models.DecimalField(decimal_places=0, max_digits=10)), + ('cost_type', models.CharField(choices=[('rur', 'rur'), ('usd', 'usd'), ('eur', 'eur')], default='rur', max_length=5)), + ('term', models.IntegerField(default=0)), + ('term_type', models.CharField(choices=[('hour', 'hour'), ('day', 'day'), ('month', 'month')], default='hour', max_length=10)), + ], + options={ + 'verbose_name_plural': 'Этапы', + 'verbose_name': 'Этап', + }, + ), + migrations.RemoveField( + model_name='order', + name='cost', + ), + migrations.RemoveField( + model_name='order', + name='term', + ), + migrations.AddField( + model_name='order', + name='secure', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='stage', + name='order', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stages', to='projects.Order'), + ), + ] diff --git a/projects/migrations/0018_auto_20160607_1915.py b/projects/migrations/0018_auto_20160607_1915.py new file mode 100644 index 0000000..abab8c4 --- /dev/null +++ b/projects/migrations/0018_auto_20160607_1915.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-07 16:15 +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 = [ + ('projects', '0017_auto_20160606_1659'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='contractor', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/projects/migrations/0019_auto_20160607_1916.py b/projects/migrations/0019_auto_20160607_1916.py new file mode 100644 index 0000000..6806259 --- /dev/null +++ b/projects/migrations/0019_auto_20160607_1916.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-07 16:16 +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 = [ + ('projects', '0018_auto_20160607_1915'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='contractor', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/projects/migrations/0020_auto_20160608_1555.py b/projects/migrations/0020_auto_20160608_1555.py new file mode 100644 index 0000000..be0950b --- /dev/null +++ b/projects/migrations/0020_auto_20160608_1555.py @@ -0,0 +1,96 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-08 12:55 +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 = [ + ('projects', '0019_auto_20160607_1916'), + ] + + operations = [ + migrations.CreateModel( + name='BuildingClassfication', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ], + options={ + 'verbose_name': 'Тип здания', + 'verbose_name_plural': 'Типы здания', + }, + ), + migrations.CreateModel( + name='City', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ], + options={ + 'verbose_name': 'Город', + 'verbose_name_plural': 'Города', + }, + ), + migrations.CreateModel( + name='ConstructionType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ], + options={ + 'verbose_name': 'Вид строительства', + 'verbose_name_plural': 'Виды строительства', + }, + ), + migrations.CreateModel( + name='Country', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ], + options={ + 'verbose_name': 'Страна', + 'verbose_name_plural': 'Страны', + }, + ), + migrations.RemoveField( + model_name='realty', + name='type_construction', + ), + migrations.AlterField( + model_name='answer', + name='cost_type', + field=models.CharField(choices=[('rur', ''), ('usd', 'usd'), ('eur', 'eur')], default='rur', max_length=5), + ), + migrations.AlterField( + model_name='realty', + name='building_classification', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='realties', to='projects.BuildingClassfication'), + ), + migrations.AlterField( + model_name='realty', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='realties', to=settings.AUTH_USER_MODEL), + ), + migrations.AlterField( + model_name='stage', + name='cost_type', + field=models.CharField(choices=[('rur', ''), ('usd', 'usd'), ('eur', 'eur')], default='rur', max_length=5), + ), + migrations.AddField( + model_name='city', + name='country', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cities', to='projects.Country'), + ), + migrations.AddField( + model_name='realty', + name='construction_type', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='realties', to='projects.ConstructionType'), + preserve_default=False, + ), + ] diff --git a/projects/migrations/0021_auto_20160608_1602.py b/projects/migrations/0021_auto_20160608_1602.py new file mode 100644 index 0000000..c180d33 --- /dev/null +++ b/projects/migrations/0021_auto_20160608_1602.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-08 13:02 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0020_auto_20160608_1555'), + ] + + operations = [ + migrations.RemoveField( + model_name='realty', + name='building_classification', + ), + migrations.RemoveField( + model_name='realty', + name='city', + ), + migrations.RemoveField( + model_name='realty', + name='construction_type', + ), + migrations.RemoveField( + model_name='realty', + name='country', + ), + ] diff --git a/projects/migrations/0022_auto_20160608_1605.py b/projects/migrations/0022_auto_20160608_1605.py new file mode 100644 index 0000000..5967c9e --- /dev/null +++ b/projects/migrations/0022_auto_20160608_1605.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-08 13:05 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0021_auto_20160608_1602'), + ] + + operations = [ + migrations.AddField( + model_name='realty', + name='building_classification', + field=models.CharField(default=None, max_length=255), + preserve_default=False, + ), + migrations.AddField( + model_name='realty', + name='construction_type', + field=models.CharField(default=None, max_length=255), + preserve_default=False, + ), + ] diff --git a/projects/migrations/0023_auto_20160608_1609.py b/projects/migrations/0023_auto_20160608_1609.py new file mode 100644 index 0000000..ec65622 --- /dev/null +++ b/projects/migrations/0023_auto_20160608_1609.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-08 13:09 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0022_auto_20160608_1605'), + ] + + operations = [ + migrations.AddField( + model_name='realty', + name='city', + field=models.CharField(default=None, max_length=50), + preserve_default=False, + ), + migrations.AddField( + model_name='realty', + name='country', + field=models.CharField(default=None, max_length=50), + preserve_default=False, + ), + migrations.AlterField( + model_name='realty', + name='building_classification', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='realties', to='projects.BuildingClassfication'), + ), + migrations.AlterField( + model_name='realty', + name='construction_type', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='realties', to='projects.ConstructionType'), + ), + ] diff --git a/projects/migrations/0024_auto_20160609_1808.py b/projects/migrations/0024_auto_20160609_1808.py new file mode 100644 index 0000000..b06db2a --- /dev/null +++ b/projects/migrations/0024_auto_20160609_1808.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-09 15:08 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0023_auto_20160608_1609'), + ] + + operations = [ + migrations.CreateModel( + name='ProjectFile', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('file', models.FileField(upload_to='projects/project_files')), + ], + ), + migrations.RenameField( + model_name='project', + old_name='user', + new_name='customer', + ), + migrations.RenameField( + model_name='project', + old_name='secure_transaction', + new_name='secure_deal', + ), + migrations.RemoveField( + model_name='project', + name='price', + ), + migrations.RemoveField( + model_name='project', + name='term_cost', + ), + migrations.RemoveField( + model_name='project', + name='type_work', + ), + migrations.AddField( + model_name='project', + name='budget_by_agreement', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='project', + name='currency', + field=models.CharField(choices=[('rur', 'RUR'), ('usd', 'USD'), ('eur', 'EUR')], default='rur', max_length=20), + ), + migrations.AddField( + model_name='project', + name='price_and_term_required', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='project', + name='term', + field=models.IntegerField(default=0), + ), + migrations.AddField( + model_name='project', + name='term_type', + field=models.CharField(choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=20), + ), + migrations.AddField( + model_name='project', + name='work_type', + field=models.IntegerField(choices=[('1', 'Проектирование'), ('2', 'Техническое сопровождение')], default=1), + ), + migrations.AlterField( + model_name='answer', + name='cost_type', + field=models.CharField(choices=[('rur', 'RUR'), ('usd', 'USD'), ('eur', 'EUR')], default='rur', max_length=5), + ), + migrations.AlterField( + model_name='answer', + name='term_type', + field=models.CharField(choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=10), + ), + migrations.AlterField( + model_name='project', + name='budget', + field=models.DecimalField(decimal_places=0, max_digits=10), + ), + migrations.AlterField( + model_name='stage', + name='cost_type', + field=models.CharField(choices=[('rur', 'RUR'), ('usd', 'USD'), ('eur', 'EUR')], default='rur', max_length=5), + ), + migrations.AlterField( + model_name='stage', + name='term_type', + field=models.CharField(choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=10), + ), + migrations.AddField( + model_name='projectfile', + name='project', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='projects.Project'), + ), + ] diff --git a/projects/migrations/0025_auto_20160609_1916.py b/projects/migrations/0025_auto_20160609_1916.py new file mode 100644 index 0000000..077f15f --- /dev/null +++ b/projects/migrations/0025_auto_20160609_1916.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-09 16:16 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0024_auto_20160609_1808'), + ] + + operations = [ + migrations.AlterField( + model_name='projectfile', + name='project', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='files', to='projects.Project'), + ), + ] diff --git a/projects/migrations/0026_auto_20160610_1204.py b/projects/migrations/0026_auto_20160610_1204.py new file mode 100644 index 0000000..e96f2b5 --- /dev/null +++ b/projects/migrations/0026_auto_20160610_1204.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-10 09:04 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0025_auto_20160609_1916'), + ] + + operations = [ + migrations.AlterModelOptions( + name='projectfile', + options={'verbose_name': 'Файл проекта', 'verbose_name_plural': 'Файлы проектов'}, + ), + migrations.RemoveField( + model_name='project', + name='secure_deal', + ), + migrations.AddField( + model_name='project', + name='deal_type', + field=models.CharField(choices=[('secure_deal', 'Безопасная сделка (с резервированием бюджета) '), ('direct_payment', 'Прямая оплата Исполнителю на его кошелек/счет')], default='secure_deal', max_length=20), + ), + ] diff --git a/projects/migrations/0027_auto_20160610_1231.py b/projects/migrations/0027_auto_20160610_1231.py new file mode 100644 index 0000000..33d44bf --- /dev/null +++ b/projects/migrations/0027_auto_20160610_1231.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-10 09:31 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0026_auto_20160610_1204'), + ] + + operations = [ + migrations.AlterField( + model_name='realty', + name='city', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='realties', to='projects.City'), + ), + migrations.AlterField( + model_name='realty', + name='country', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='realties', to='projects.Country'), + ), + ] diff --git a/projects/migrations/0028_auto_20160610_1301.py b/projects/migrations/0028_auto_20160610_1301.py new file mode 100644 index 0000000..d5826d1 --- /dev/null +++ b/projects/migrations/0028_auto_20160610_1301.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-10 10:01 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0027_auto_20160610_1231'), + ] + + operations = [ + migrations.AlterField( + model_name='project', + name='work_type', + field=models.CharField(choices=[('1', 'Проектирование'), ('2', 'Техническое сопровождение')], default='1', max_length=20), + ), + ] diff --git a/projects/migrations/0029_project_active.py b/projects/migrations/0029_project_active.py new file mode 100644 index 0000000..e292e83 --- /dev/null +++ b/projects/migrations/0029_project_active.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-10 11:16 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0028_auto_20160610_1301'), + ] + + operations = [ + migrations.AddField( + model_name='project', + name='active', + field=models.BooleanField(default=True), + ), + ] diff --git a/projects/migrations/0030_auto_20160610_1430.py b/projects/migrations/0030_auto_20160610_1430.py new file mode 100644 index 0000000..c50dcdb --- /dev/null +++ b/projects/migrations/0030_auto_20160610_1430.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-10 11:30 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0029_project_active'), + ] + + operations = [ + migrations.RenameField( + model_name='answer', + old_name='cost', + new_name='budget', + ), + migrations.RenameField( + model_name='answer', + old_name='user', + new_name='contractor', + ), + migrations.RenameField( + model_name='answer', + old_name='cost_type', + new_name='currency', + ), + ] diff --git a/projects/migrations/0031_auto_20160610_1434.py b/projects/migrations/0031_auto_20160610_1434.py new file mode 100644 index 0000000..92edae7 --- /dev/null +++ b/projects/migrations/0031_auto_20160610_1434.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-10 11:34 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0030_auto_20160610_1430'), + ] + + operations = [ + migrations.RemoveField( + model_name='project', + name='active', + ), + migrations.AddField( + model_name='project', + name='state', + field=models.CharField(choices=[('active', 'Активный'), ('trash', 'В корзине'), ('delete', 'Удален')], default='active', max_length=20), + ), + ] diff --git a/projects/migrations/0032_auto_20160615_1610.py b/projects/migrations/0032_auto_20160615_1610.py new file mode 100644 index 0000000..30cea38 --- /dev/null +++ b/projects/migrations/0032_auto_20160615_1610.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-15 13:10 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone +import mptt.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0001_initial'), + ('projects', '0031_auto_20160610_1434'), + ] + + operations = [ + migrations.RemoveField( + model_name='city', + name='country', + ), + migrations.RemoveField( + model_name='realty', + name='city', + ), + migrations.RemoveField( + model_name='realty', + name='country', + ), + migrations.AddField( + model_name='realty', + name='location', + field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='realties', to='common.Location'), + ), + migrations.AlterField( + model_name='order', + name='created', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + migrations.AlterField( + model_name='project', + name='state', + field=models.CharField(choices=[('active', 'Активный'), ('trashed', 'В корзине'), ('deleted', 'Удален')], default='active', max_length=20), + ), + migrations.DeleteModel( + name='City', + ), + migrations.DeleteModel( + name='Country', + ), + ] diff --git a/projects/migrations/0033_auto_20160621_1057.py b/projects/migrations/0033_auto_20160621_1057.py new file mode 100644 index 0000000..f78937f --- /dev/null +++ b/projects/migrations/0033_auto_20160621_1057.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-21 07:57 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0032_auto_20160615_1610'), + ] + + operations = [ + migrations.AlterField( + model_name='project', + name='realty', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='projects.Realty'), + ), + ] diff --git a/projects/migrations/0034_auto_20160622_1200.py b/projects/migrations/0034_auto_20160622_1200.py new file mode 100644 index 0000000..7a373bb --- /dev/null +++ b/projects/migrations/0034_auto_20160622_1200.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-22 09:00 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0033_auto_20160621_1057'), + ] + + operations = [ + migrations.AlterField( + model_name='project', + name='work_type', + field=models.IntegerField(choices=[('1', 'Проектирование'), ('2', 'Техническое сопровождение')], default=1, max_length=20), + ), + ] diff --git a/projects/migrations/0035_auto_20160630_1635.py b/projects/migrations/0035_auto_20160630_1635.py new file mode 100644 index 0000000..93c81f0 --- /dev/null +++ b/projects/migrations/0035_auto_20160630_1635.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-30 13:35 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0034_auto_20160622_1200'), + ] + + operations = [ + migrations.AlterModelOptions( + name='buildingclassfication', + options={'verbose_name': 'Тип здания', 'verbose_name_plural': 'Типы зданий'}, + ), + migrations.AlterField( + model_name='project', + name='work_type', + field=models.IntegerField(choices=[(1, 'Проектирование'), (2, 'Техническое сопровождение')], default=1), + ), + migrations.AlterField( + model_name='projectfile', + name='project', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='files', to='projects.Project'), + ), + ] diff --git a/projects/migrations/0036_auto_20160630_1846.py b/projects/migrations/0036_auto_20160630_1846.py new file mode 100644 index 0000000..c09fa43 --- /dev/null +++ b/projects/migrations/0036_auto_20160630_1846.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-30 15:46 +from __future__ import unicode_literals + +from django.db import migrations +import django.db.models.deletion +import mptt.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0035_auto_20160630_1635'), + ] + + operations = [ + migrations.AlterField( + model_name='project', + name='specialization', + field=mptt.fields.TreeForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='projects', to='specializations.Specialization'), + ), + ] diff --git a/projects/migrations/0037_auto_20160704_1444.py b/projects/migrations/0037_auto_20160704_1444.py new file mode 100644 index 0000000..32fefbe --- /dev/null +++ b/projects/migrations/0037_auto_20160704_1444.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-04 11: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 = [ + ('projects', '0036_auto_20160630_1846'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='contractor', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orders', to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/projects/migrations/0038_auto_20160706_1249.py b/projects/migrations/0038_auto_20160706_1249.py new file mode 100644 index 0000000..ba7272e --- /dev/null +++ b/projects/migrations/0038_auto_20160706_1249.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-06 09:49 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import mptt.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0003_mainpage'), + ('specializations', '0002_auto_20160602_1203'), + ('projects', '0037_auto_20160704_1444'), + ] + + operations = [ + migrations.AddField( + model_name='portfolio', + name='budget', + field=models.DecimalField(decimal_places=0, default=0, max_digits=10, null=True), + ), + migrations.AddField( + model_name='portfolio', + name='budget_by_agreement', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='portfolio', + name='building_classification', + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='portfolios', to='projects.BuildingClassfication'), + preserve_default=False, + ), + migrations.AddField( + model_name='portfolio', + name='construction_type', + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='portfolios', to='projects.ConstructionType'), + preserve_default=False, + ), + migrations.AddField( + model_name='portfolio', + name='location', + field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='portfolios', to='common.Location'), + ), + migrations.AddField( + model_name='portfolio', + name='specialization', + field=mptt.fields.TreeForeignKey(default=5, on_delete=django.db.models.deletion.CASCADE, related_name='portfolios', to='specializations.Specialization'), + preserve_default=False, + ), + migrations.AddField( + model_name='portfolio', + name='term', + field=models.IntegerField(default=0), + ), + migrations.AddField( + model_name='portfolio', + name='term_type', + field=models.CharField(choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=20), + ), + migrations.AddField( + model_name='portfolio', + name='worksell', + field=models.BooleanField(default=False), + ), + migrations.AlterField( + model_name='portfolio', + name='user', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='portfolios', to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/projects/migrations/0039_auto_20160707_1724.py b/projects/migrations/0039_auto_20160707_1724.py new file mode 100644 index 0000000..3c52cb5 --- /dev/null +++ b/projects/migrations/0039_auto_20160707_1724.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-07 14:24 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import mptt.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0038_auto_20160706_1249'), + ] + + operations = [ + migrations.RemoveField( + model_name='portfolio', + name='budget_by_agreement', + ), + migrations.AddField( + model_name='portfolio', + name='currency', + field=models.CharField(blank=True, choices=[('rur', 'RUR'), ('usd', 'USD'), ('eur', 'EUR')], default='rur', max_length=20, null=True), + ), + migrations.AlterField( + model_name='portfolio', + name='budget', + field=models.DecimalField(blank=True, decimal_places=0, default=0, max_digits=10, null=True), + ), + migrations.AlterField( + model_name='portfolio', + name='building_classification', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='portfolios', to='projects.BuildingClassfication'), + ), + migrations.AlterField( + model_name='portfolio', + name='construction_type', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='portfolios', to='projects.ConstructionType'), + ), + migrations.AlterField( + model_name='portfolio', + name='specialization', + field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='portfolios', to='specializations.Specialization'), + ), + migrations.AlterField( + model_name='portfolio', + name='term', + field=models.IntegerField(blank=True, default=0, null=True), + ), + migrations.AlterField( + model_name='portfolio', + name='term_type', + field=models.CharField(blank=True, choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=20, null=True), + ), + ] diff --git a/projects/migrations/__init__.py b/projects/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/reviews/migrations/0001_initial.py b/reviews/migrations/0001_initial.py new file mode 100644 index 0000000..6de7199 --- /dev/null +++ b/reviews/migrations/0001_initial.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-07-21 15:08 +from __future__ import unicode_literals + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Review', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('is_secured', models.BooleanField(default=False)), + ('stars', models.IntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)])), + ('text', models.TextField()), + ], + options={ + 'verbose_name': 'Отзыв', + 'verbose_name_plural': 'Отзывы', + }, + ), + ] diff --git a/reviews/migrations/0002_auto_20160531_0906.py b/reviews/migrations/0002_auto_20160531_0906.py new file mode 100644 index 0000000..162115c --- /dev/null +++ b/reviews/migrations/0002_auto_20160531_0906.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-31 09:06 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0012_auto_20160530_1355'), + ('reviews', '0001_initial'), + ] + + operations = [ + migrations.AlterModelOptions( + name='review', + options={'verbose_name': 'Отзыв', 'verbose_name_plural': 'Отзывы'}, + ), + migrations.AddField( + model_name='review', + name='project', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='reviews', to='projects.Project'), + preserve_default=False, + ), + ] diff --git a/reviews/migrations/__init__.py b/reviews/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/specializations/migrations/0001_initial.py b/specializations/migrations/0001_initial.py new file mode 100644 index 0000000..f2ace87 --- /dev/null +++ b/specializations/migrations/0001_initial.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-07-21 15:08 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import mptt.fields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Specialization', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100)), + ('lft', models.PositiveIntegerField(db_index=True, editable=False)), + ('rght', models.PositiveIntegerField(db_index=True, editable=False)), + ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)), + ('level', models.PositiveIntegerField(db_index=True, editable=False)), + ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='specializations.Specialization')), + ], + options={ + 'verbose_name': 'Специализация', + 'verbose_name_plural': 'Специализации', + }, + ), + ] diff --git a/specializations/migrations/0002_auto_20160602_1203.py b/specializations/migrations/0002_auto_20160602_1203.py new file mode 100644 index 0000000..110b8a5 --- /dev/null +++ b/specializations/migrations/0002_auto_20160602_1203.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-02 12:03 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('specializations', '0001_initial'), + ] + + operations = [ + migrations.AlterModelOptions( + name='specialization', + options={'verbose_name': 'Специализация', 'verbose_name_plural': 'Специализации'}, + ), + ] diff --git a/specializations/migrations/__init__.py b/specializations/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/templates/home.html b/templates/home.html index cf5b0af..de9778e 100644 --- a/templates/home.html +++ b/templates/home.html @@ -50,7 +50,7 @@
- +
diff --git a/users/migrations/0001_initial.py b/users/migrations/0001_initial.py new file mode 100644 index 0000000..b55587f --- /dev/null +++ b/users/migrations/0001_initial.py @@ -0,0 +1,149 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-07-21 15:08 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone +import mptt.fields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('auth', '0007_alter_validators_add_error_messages'), + ('common', '0001_initial'), + ('specializations', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='User', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('password', models.CharField(max_length=128, verbose_name='password')), + ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')), + ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')), + ('avatar', models.ImageField(blank=True, upload_to='users/avatars/')), + ('contractor_status', models.CharField(choices=[('free', 'Свободен'), ('busy', 'Занят')], default='free', max_length=20)), + ('created', models.DateTimeField(default=django.utils.timezone.now)), + ('cro', models.BooleanField(default=False)), + ('date_joined', models.DateTimeField(default=django.utils.timezone.now)), + ('date_of_birth', models.DateTimeField(blank=True, null=True)), + ('email', models.EmailField(db_index=True, max_length=255, unique=True)), + ('first_name', models.CharField(blank=True, max_length=255)), + ('gender', models.CharField(blank=True, choices=[('male', 'Мужской'), ('female', 'Женский')], max_length=30)), + ('is_active', models.BooleanField(default=True)), + ('last_name', models.CharField(blank=True, max_length=255)), + ('last_time_visit', models.DateTimeField(default=django.utils.timezone.now)), + ('patronym', models.CharField(blank=True, max_length=255)), + ('phone', models.CharField(blank=True, max_length=30, null=True)), + ('skype', models.CharField(blank=True, max_length=100)), + ('username', models.CharField(max_length=50, unique=True)), + ('website', models.CharField(blank=True, max_length=255)), + ], + options={ + 'verbose_name': 'Пользователь', + 'verbose_name_plural': 'Пользователи', + }, + ), + migrations.CreateModel( + name='ContractorFinancialInfo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('credit_card_number', models.CharField(max_length=50)), + ('date_of_birth', models.DateTimeField()), + ('fio', models.CharField(max_length=255)), + ('inn', models.CharField(max_length=100)), + ('legal_status', models.CharField(choices=[('individual', 'Физическое лицо'), ('legal_entity', 'ИП и юридическое лицо')], max_length=30)), + ('passport_issue_date', models.DateTimeField()), + ('passport_issued_by', models.CharField(max_length=255)), + ('passport_number', models.CharField(max_length=10)), + ('passport_scan', models.ImageField(upload_to='users/contractors/')), + ('passport_series', models.CharField(max_length=6)), + ('phone', models.CharField(max_length=30)), + ('residency', models.CharField(choices=[('russian_resident', 'Резидент РФ'), ('non_russian_resident', 'Нерезидент РФ'), ('refugee', 'Беженец'), ('russian_stay_permit', 'Вид на жительство')], max_length=50)), + ('subdivision_code', models.CharField(max_length=10)), + ('yandex_money', models.CharField(max_length=50)), + ], + options={ + 'verbose_name': 'Финансовая информация', + 'verbose_name_plural': 'Финансовая информация', + }, + ), + migrations.CreateModel( + name='ContractorResume', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('resume_file', models.FileField(upload_to='users/resume/files/')), + ('text', models.TextField()), + ], + options={ + 'verbose_name': 'Резюме', + 'verbose_name_plural': 'Резюме', + }, + ), + migrations.CreateModel( + name='ContractorResumeFiles', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('description', models.TextField(blank=True)), + ('img', models.ImageField(upload_to='users/resume/images/')), + ('title', models.CharField(max_length=255)), + ('type', models.CharField(choices=[('diplom', 'Дипломы/Сертификаты'), ('cro', 'Допуск CPO')], max_length=50)), + ('resume', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='resume_files', to='users.ContractorResume')), + ], + options={ + 'verbose_name': 'Файлы резюме', + 'verbose_name_plural': 'Файлы резюме', + }, + ), + migrations.CreateModel( + name='Team', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created', models.DateTimeField(default=django.utils.timezone.now)), + ('name', models.CharField(max_length=255)), + ('owner', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='team', to=settings.AUTH_USER_MODEL)), + ('specializations', mptt.fields.TreeManyToManyField(blank=True, related_name='teams', to='specializations.Specialization')), + ('users', models.ManyToManyField(blank=True, related_name='teams', to=settings.AUTH_USER_MODEL)), + ], + options={ + 'verbose_name': 'Команда', + 'verbose_name_plural': 'Команды', + }, + ), + migrations.AddField( + model_name='user', + name='contractor_financial_info', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='contractor', to='users.ContractorFinancialInfo'), + ), + migrations.AddField( + model_name='user', + name='contractor_resume', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='contractor', to='users.ContractorResume'), + ), + migrations.AddField( + model_name='user', + name='contractor_specializations', + field=mptt.fields.TreeManyToManyField(blank=True, related_name='contractors', to='specializations.Specialization'), + ), + migrations.AddField( + model_name='user', + name='groups', + field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups'), + ), + migrations.AddField( + model_name='user', + name='location', + field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='users', to='common.Location'), + ), + migrations.AddField( + model_name='user', + name='user_permissions', + field=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'), + ), + ] diff --git a/users/migrations/0002_team_groups.py b/users/migrations/0002_team_groups.py new file mode 100644 index 0000000..54251cc --- /dev/null +++ b/users/migrations/0002_team_groups.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-19 14:52 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('auth', '0007_alter_validators_add_error_messages'), + ('users', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='team', + name='groups', + field=models.ManyToManyField(blank=True, related_name='teams', to='auth.Group'), + ), + ] diff --git a/users/migrations/0003_user_created_at.py b/users/migrations/0003_user_created_at.py new file mode 100644 index 0000000..5f63c7f --- /dev/null +++ b/users/migrations/0003_user_created_at.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-24 10:52 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0002_team_groups'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='created_at', + field=models.DateTimeField(default=datetime.datetime(2016, 5, 24, 10, 52, 56, 737277)), + ), + ] diff --git a/users/migrations/0004_auto_20160524_1053.py b/users/migrations/0004_auto_20160524_1053.py new file mode 100644 index 0000000..0f71065 --- /dev/null +++ b/users/migrations/0004_auto_20160524_1053.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-24 10:53 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0003_user_created_at'), + ] + + operations = [ + migrations.RemoveField( + model_name='team', + name='groups', + ), + migrations.AlterField( + model_name='user', + name='created_at', + field=models.DateTimeField(default=datetime.datetime(2016, 5, 24, 10, 53, 15, 497921)), + ), + ] diff --git a/users/migrations/0005_auto_20160524_1054.py b/users/migrations/0005_auto_20160524_1054.py new file mode 100644 index 0000000..4a80d14 --- /dev/null +++ b/users/migrations/0005_auto_20160524_1054.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-24 10:54 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0004_auto_20160524_1053'), + ] + + operations = [ + migrations.RemoveField( + model_name='user', + name='created_at', + ), + migrations.AddField( + model_name='user', + name='created', + field=models.DateTimeField(default=datetime.datetime(2016, 5, 24, 10, 54, 13, 805566)), + ), + ] diff --git a/users/migrations/0006_auto_20160525_0948.py b/users/migrations/0006_auto_20160525_0948.py new file mode 100644 index 0000000..79ef51b --- /dev/null +++ b/users/migrations/0006_auto_20160525_0948.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-25 09:48 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0005_auto_20160524_1054'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='created', + field=models.DateTimeField(default=datetime.datetime(2016, 5, 25, 9, 48, 35, 257077)), + ), + ] diff --git a/users/migrations/0007_auto_20160525_1526.py b/users/migrations/0007_auto_20160525_1526.py new file mode 100644 index 0000000..f3c493a --- /dev/null +++ b/users/migrations/0007_auto_20160525_1526.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-25 15:26 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0006_auto_20160525_0948'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='created', + field=models.DateTimeField(default=datetime.datetime(2016, 5, 25, 15, 26, 33, 142994)), + ), + ] diff --git a/users/migrations/0008_auto_20160525_1527.py b/users/migrations/0008_auto_20160525_1527.py new file mode 100644 index 0000000..cd55854 --- /dev/null +++ b/users/migrations/0008_auto_20160525_1527.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-05-25 15:27 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0007_auto_20160525_1526'), + ] + + operations = [ + migrations.AlterField( + model_name='user', + name='created', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + ] diff --git a/users/migrations/0009_auto_20160602_1213.py b/users/migrations/0009_auto_20160602_1213.py new file mode 100644 index 0000000..d614b22 --- /dev/null +++ b/users/migrations/0009_auto_20160602_1213.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-02 12:13 +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', '0008_auto_20160525_1527'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='nickname', + field=models.CharField(blank=True, max_length=50, null=True), + ), + migrations.AlterField( + model_name='team', + name='owner', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='team', to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/users/migrations/0010_user_last_time_visit.py b/users/migrations/0010_user_last_time_visit.py new file mode 100644 index 0000000..9932460 --- /dev/null +++ b/users/migrations/0010_user_last_time_visit.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-03 12:15 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0009_auto_20160602_1213'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='last_time_visit', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + ] diff --git a/users/migrations/0011_user_contractor_specializations.py b/users/migrations/0011_user_contractor_specializations.py new file mode 100644 index 0000000..f8050dc --- /dev/null +++ b/users/migrations/0011_user_contractor_specializations.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-08 15:01 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('specializations', '0002_auto_20160602_1203'), + ('users', '0010_user_last_time_visit'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='contractor_specializations', + field=models.ManyToManyField(blank=True, related_name='contractors', to='specializations.Specialization'), + ), + ] diff --git a/users/migrations/0012_user_status.py b/users/migrations/0012_user_status.py new file mode 100644 index 0000000..57dbb7f --- /dev/null +++ b/users/migrations/0012_user_status.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-10 13:58 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0011_user_contractor_specializations'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='status', + field=models.CharField(choices=[('free', 'Свободен'), ('busy', 'Занят')], default='free', max_length=20), + ), + ] diff --git a/users/migrations/0013_auto_20160610_1703.py b/users/migrations/0013_auto_20160610_1703.py new file mode 100644 index 0000000..f39186b --- /dev/null +++ b/users/migrations/0013_auto_20160610_1703.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-10 14:03 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0012_user_status'), + ] + + operations = [ + migrations.RenameField( + model_name='user', + old_name='status', + new_name='contractor_status', + ), + ] diff --git a/users/migrations/0014_auto_20160615_1611.py b/users/migrations/0014_auto_20160615_1611.py new file mode 100644 index 0000000..130df78 --- /dev/null +++ b/users/migrations/0014_auto_20160615_1611.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-15 13:11 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import mptt.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0001_initial'), + ('users', '0013_auto_20160610_1703'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='location', + field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='users', to='common.Location'), + ), + migrations.AddField( + model_name='user', + name='patronym', + field=models.CharField(blank=True, max_length=255), + ), + ] diff --git a/users/migrations/0015_auto_20160615_1747.py b/users/migrations/0015_auto_20160615_1747.py new file mode 100644 index 0000000..26fcf13 --- /dev/null +++ b/users/migrations/0015_auto_20160615_1747.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-15 14:47 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +import django.db.models.deletion +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0014_auto_20160615_1611'), + ] + + operations = [ + migrations.CreateModel( + name='ContractorFinancialInfo', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('fio', models.CharField(max_length=255)), + ('date_of_birth', models.DateTimeField()), + ('phone', models.CharField(max_length=30)), + ('residency', models.CharField(choices=[('russian_resident', 'Резидент РФ'), ('non_russian_resident', 'Нерезидент РФ'), ('refugee', 'Беженец'), ('russian_stay_permit', 'Вид на жительство')], max_length=50)), + ('legal_status', models.CharField(choices=[('individual', 'Физическое лицо'), ('legal_entity', 'ИП и Юридическое лицо')], max_length=30)), + ('passport_series', models.CharField(max_length=6)), + ('passport_number', models.CharField(max_length=10)), + ('subdivision_code', models.CharField(max_length=10)), + ('passport_issued_by', models.CharField(max_length=255)), + ('passport_issue_date', models.DateTimeField()), + ('inn', models.CharField(max_length=100)), + ('yandex_money', models.CharField(max_length=50)), + ('credit_card_number', models.CharField(max_length=50)), + ('passport_scan', models.ImageField(upload_to='users/contractors/')), + ], + options={ + 'verbose_name': 'Финансовая информация', + 'verbose_name_plural': 'Финансовая информация', + }, + ), + migrations.AddField( + model_name='user', + name='avatar', + field=models.ImageField(blank=True, upload_to='users/avatars/'), + ), + migrations.AddField( + model_name='user', + name='cro', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='user', + name='date_of_birth', + field=models.DateTimeField(default=datetime.datetime(2016, 6, 15, 14, 47, 5, 758769, tzinfo=utc)), + preserve_default=False, + ), + migrations.AddField( + model_name='user', + name='gender', + field=models.CharField(blank=True, choices=[('male', 'Мужской'), ('female', 'Женский')], max_length=30), + ), + migrations.AddField( + model_name='user', + name='skype', + field=models.CharField(blank=True, max_length=100), + ), + migrations.AddField( + model_name='user', + name='website', + field=models.CharField(blank=True, max_length=255), + ), + migrations.AddField( + model_name='user', + name='contractor_financial_info', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='contractor', to='users.ContractorFinancialInfo'), + ), + ] diff --git a/users/migrations/0016_auto_20160617_1815.py b/users/migrations/0016_auto_20160617_1815.py new file mode 100644 index 0000000..c917b92 --- /dev/null +++ b/users/migrations/0016_auto_20160617_1815.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-17 15:15 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0015_auto_20160615_1747'), + ] + + operations = [ + migrations.AlterField( + model_name='contractorfinancialinfo', + name='legal_status', + field=models.CharField(choices=[('individual', 'Физическое лицо'), ('legal_entity', 'ИП и юридическое лицо')], max_length=30), + ), + ] diff --git a/users/migrations/0017_user_phone.py b/users/migrations/0017_user_phone.py new file mode 100644 index 0000000..6c51e9d --- /dev/null +++ b/users/migrations/0017_user_phone.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-22 14:03 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0016_auto_20160617_1815'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='phone', + field=models.CharField(blank=True, max_length=30, null=True), + ), + ] diff --git a/users/migrations/0018_auto_20160710_1838.py b/users/migrations/0018_auto_20160710_1838.py new file mode 100644 index 0000000..8d8188d --- /dev/null +++ b/users/migrations/0018_auto_20160710_1838.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-10 15:38 +from __future__ import unicode_literals + +import datetime +from django.db import migrations, models +import django.utils.timezone +from django.utils.timezone import utc +import mptt.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0017_user_phone'), + ] + + operations = [ + migrations.RemoveField( + model_name='user', + name='nickname', + ), + migrations.AddField( + model_name='user', + name='data_joined', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + migrations.AddField( + model_name='user', + name='username', + field=models.CharField(default=datetime.datetime(2016, 7, 10, 15, 38, 2, 660834, tzinfo=utc), max_length=50, unique=True), + preserve_default=False, + ), + migrations.AlterField( + model_name='user', + name='contractor_specializations', + field=mptt.fields.TreeManyToManyField(blank=True, related_name='contractors', to='specializations.Specialization'), + ), + migrations.AlterField( + model_name='user', + name='date_of_birth', + field=models.DateTimeField(blank=True, null=True), + ), + ] diff --git a/users/migrations/0019_auto_20160710_1950.py b/users/migrations/0019_auto_20160710_1950.py new file mode 100644 index 0000000..6472505 --- /dev/null +++ b/users/migrations/0019_auto_20160710_1950.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-10 16:50 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0018_auto_20160710_1838'), + ] + + operations = [ + migrations.RenameField( + model_name='user', + old_name='data_joined', + new_name='date_joined', + ), + ] diff --git a/users/migrations/0020_auto_20160711_1759.py b/users/migrations/0020_auto_20160711_1759.py new file mode 100644 index 0000000..0d729f3 --- /dev/null +++ b/users/migrations/0020_auto_20160711_1759.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-07-11 14:59 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0019_auto_20160710_1950'), + ] + + operations = [ + migrations.CreateModel( + name='ContractorResume', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('text', models.TextField()), + ('resume_file', models.FileField(upload_to='users/resume/files/')), + ], + options={ + 'verbose_name': 'Резюме', + 'verbose_name_plural': 'Резюме', + }, + ), + migrations.CreateModel( + name='ContractorResumeFiles', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('img', models.ImageField(upload_to='users/resume/images/')), + ('title', models.CharField(max_length=255)), + ('description', models.TextField(blank=True)), + ('type', models.CharField(choices=[('diplom', 'Дипломы/Сертификаты'), ('cro', 'Допуск CPO')], max_length=50)), + ], + options={ + 'verbose_name': 'Файлы резюме', + 'verbose_name_plural': 'Файлы резюме', + }, + ), + migrations.AddField( + model_name='user', + name='contractor_resume', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='contractor', to='users.ContractorResume'), + ), + ] diff --git a/users/migrations/0021_contractorresumefiles_resume.py b/users/migrations/0021_contractorresumefiles_resume.py new file mode 100644 index 0000000..00b4577 --- /dev/null +++ b/users/migrations/0021_contractorresumefiles_resume.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-07-11 16:27 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0020_auto_20160711_1759'), + ] + + operations = [ + migrations.AddField( + model_name='contractorresumefiles', + name='resume', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='resume_files', to='users.ContractorResume'), + preserve_default=False, + ), + ] diff --git a/users/migrations/__init__.py b/users/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/work_sell/migrations/0001_initial.py b/work_sell/migrations/0001_initial.py new file mode 100644 index 0000000..ab99020 --- /dev/null +++ b/work_sell/migrations/0001_initial.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-07-21 15:08 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion +import django.utils.timezone +import mptt.fields +import sorl.thumbnail.fields + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('common', '0001_initial'), + ('projects', '0001_initial'), + ('specializations', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='Picture', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('file', models.ImageField(upload_to='worksell/pictures')), + ('slug', models.SlugField(blank=True)), + ], + ), + migrations.CreateModel( + name='WorkSell', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('budget', models.DecimalField(blank=True, decimal_places=0, default=0, max_digits=10, null=True)), + ('created', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True)), + ('currency', models.CharField(blank=True, choices=[('rur', 'RUR'), ('usd', 'USD'), ('eur', 'EUR')], default='rur', max_length=20, null=True)), + ('description', models.TextField(blank=True)), + ('img', sorl.thumbnail.fields.ImageField(blank=True, null=True, upload_to='worksell/worksell')), + ('name', models.CharField(max_length=255)), + ('term', models.IntegerField(blank=True, default=0, null=True)), + ('term_type', models.CharField(blank=True, choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=20, null=True)), + ('building_classification', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='projects.BuildingClassfication')), + ('construction_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='projects.ConstructionType')), + ('contractor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='work_sell', to=settings.AUTH_USER_MODEL)), + ('location', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='common.Location')), + ('specialization', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='specializations.Specialization')), + ], + options={ + 'verbose_name': 'Готовая работа', + 'ordering': ['-created'], + 'verbose_name_plural': 'Готовые работы', + }, + ), + migrations.CreateModel( + name='WorkSellPhoto', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('img', sorl.thumbnail.fields.ImageField(upload_to='worksell/worksell')), + ('worksell', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='photos', to='work_sell.WorkSell')), + ], + options={ + 'verbose_name': 'Изображение Готовая работа', + 'verbose_name_plural': 'Изображения Готовые работы', + }, + ), + ] diff --git a/work_sell/migrations/0002_auto_20160607_1755.py b/work_sell/migrations/0002_auto_20160607_1755.py new file mode 100644 index 0000000..20cd2c9 --- /dev/null +++ b/work_sell/migrations/0002_auto_20160607_1755.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-07 14:55 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('work_sell', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='worksell', + name='img', + field=models.ImageField(upload_to='worksell/worksell'), + ), + ] diff --git a/work_sell/migrations/0003_auto_20160621_1259.py b/work_sell/migrations/0003_auto_20160621_1259.py new file mode 100644 index 0000000..782cf6d --- /dev/null +++ b/work_sell/migrations/0003_auto_20160621_1259.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-21 09:59 +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), + ('work_sell', '0002_auto_20160607_1755'), + ] + + operations = [ + migrations.AlterModelOptions( + name='worksell', + options={'verbose_name': 'Готовая работа', 'verbose_name_plural': 'Готовые работы'}, + ), + migrations.AddField( + model_name='worksell', + name='contractor', + field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='work_sell', to=settings.AUTH_USER_MODEL), + preserve_default=False, + ), + ] diff --git a/work_sell/migrations/0004_worksell_price.py b/work_sell/migrations/0004_worksell_price.py new file mode 100644 index 0000000..31de3be --- /dev/null +++ b/work_sell/migrations/0004_worksell_price.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-06-21 10:19 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('work_sell', '0003_auto_20160621_1259'), + ] + + operations = [ + migrations.AddField( + model_name='worksell', + name='price', + field=models.DecimalField(decimal_places=0, default=0, max_digits=10), + ), + ] diff --git a/work_sell/migrations/0005_auto_20160704_1449.py b/work_sell/migrations/0005_auto_20160704_1449.py new file mode 100644 index 0000000..7826eec --- /dev/null +++ b/work_sell/migrations/0005_auto_20160704_1449.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-04 11:49 +from __future__ import unicode_literals + +from django.db import migrations +import sorl.thumbnail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('work_sell', '0004_worksell_price'), + ] + + operations = [ + migrations.AlterField( + model_name='worksell', + name='img', + field=sorl.thumbnail.fields.ImageField(upload_to='worksell/worksell'), + ), + ] diff --git a/work_sell/migrations/0006_worksellphoto.py b/work_sell/migrations/0006_worksellphoto.py new file mode 100644 index 0000000..08d2f2c --- /dev/null +++ b/work_sell/migrations/0006_worksellphoto.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-04 15:54 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import sorl.thumbnail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('work_sell', '0005_auto_20160704_1449'), + ] + + operations = [ + migrations.CreateModel( + name='WorkSellPhoto', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('img', sorl.thumbnail.fields.ImageField(upload_to='worksell/worksell')), + ('worksell', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='photos', to='work_sell.WorkSell')), + ], + options={ + 'verbose_name': 'Изображение Готовая работа', + 'verbose_name_plural': 'Изображения Готовые работы', + }, + ), + ] diff --git a/work_sell/migrations/0007_auto_20160705_1514.py b/work_sell/migrations/0007_auto_20160705_1514.py new file mode 100644 index 0000000..4d12f7c --- /dev/null +++ b/work_sell/migrations/0007_auto_20160705_1514.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-05 12:14 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('work_sell', '0006_worksellphoto'), + ] + + operations = [ + migrations.AlterModelOptions( + name='worksell', + options={'ordering': ['-created'], 'verbose_name': 'Готовая работа', 'verbose_name_plural': 'Готовые работы'}, + ), + migrations.AddField( + model_name='worksell', + name='created', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + ] diff --git a/work_sell/migrations/0008_auto_20160706_1249.py b/work_sell/migrations/0008_auto_20160706_1249.py new file mode 100644 index 0000000..569d9b3 --- /dev/null +++ b/work_sell/migrations/0008_auto_20160706_1249.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-06 09:49 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import mptt.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0038_auto_20160706_1249'), + ('common', '0003_mainpage'), + ('specializations', '0002_auto_20160602_1203'), + ('work_sell', '0007_auto_20160705_1514'), + ] + + operations = [ + migrations.RemoveField( + model_name='worksell', + name='price', + ), + migrations.AddField( + model_name='worksell', + name='budget', + field=models.DecimalField(decimal_places=0, default=0, max_digits=10, null=True), + ), + migrations.AddField( + model_name='worksell', + name='budget_by_agreement', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='worksell', + name='building_classification', + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='projects.BuildingClassfication'), + preserve_default=False, + ), + migrations.AddField( + model_name='worksell', + name='construction_type', + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='projects.ConstructionType'), + preserve_default=False, + ), + migrations.AddField( + model_name='worksell', + name='location', + field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='common.Location'), + ), + migrations.AddField( + model_name='worksell', + name='specialization', + field=mptt.fields.TreeForeignKey(default=5, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='specializations.Specialization'), + preserve_default=False, + ), + migrations.AddField( + model_name='worksell', + name='term', + field=models.IntegerField(default=0), + ), + migrations.AddField( + model_name='worksell', + name='term_type', + field=models.CharField(choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=20), + ), + ] diff --git a/work_sell/migrations/0009_auto_20160707_1315.py b/work_sell/migrations/0009_auto_20160707_1315.py new file mode 100644 index 0000000..15bb2d8 --- /dev/null +++ b/work_sell/migrations/0009_auto_20160707_1315.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-07 10:15 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import mptt.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('work_sell', '0008_auto_20160706_1249'), + ] + + operations = [ + migrations.RemoveField( + model_name='worksell', + name='budget_by_agreement', + ), + migrations.AddField( + model_name='worksell', + name='currency', + field=models.CharField(blank=True, choices=[('rur', 'RUR'), ('usd', 'USD'), ('eur', 'EUR')], default='rur', max_length=20, null=True), + ), + migrations.AlterField( + model_name='worksell', + name='budget', + field=models.DecimalField(blank=True, decimal_places=0, default=0, max_digits=10, null=True), + ), + migrations.AlterField( + model_name='worksell', + name='building_classification', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='projects.BuildingClassfication'), + ), + migrations.AlterField( + model_name='worksell', + name='construction_type', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='projects.ConstructionType'), + ), + migrations.AlterField( + model_name='worksell', + name='specialization', + field=mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='worksells', to='specializations.Specialization'), + ), + migrations.AlterField( + model_name='worksell', + name='term', + field=models.IntegerField(blank=True, default=0, null=True), + ), + migrations.AlterField( + model_name='worksell', + name='term_type', + field=models.CharField(blank=True, choices=[('project', 'За проект'), ('hour', 'За час'), ('day', 'За день'), ('month', 'За месяц')], default='hour', max_length=20, null=True), + ), + ] diff --git a/work_sell/migrations/0010_auto_20160707_1401.py b/work_sell/migrations/0010_auto_20160707_1401.py new file mode 100644 index 0000000..321b296 --- /dev/null +++ b/work_sell/migrations/0010_auto_20160707_1401.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.6 on 2016-07-07 11:01 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.utils.timezone +import sorl.thumbnail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('work_sell', '0009_auto_20160707_1315'), + ] + + operations = [ + migrations.AlterField( + model_name='worksell', + name='created', + field=models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True), + ), + migrations.AlterField( + model_name='worksell', + name='img', + field=sorl.thumbnail.fields.ImageField(blank=True, null=True, upload_to='worksell/worksell'), + ), + ] diff --git a/work_sell/migrations/0011_picture.py b/work_sell/migrations/0011_picture.py new file mode 100644 index 0000000..cdb20e8 --- /dev/null +++ b/work_sell/migrations/0011_picture.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-07-11 08:33 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('work_sell', '0010_auto_20160707_1401'), + ] + + operations = [ + migrations.CreateModel( + name='Picture', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('file', models.ImageField(upload_to='worksell/pictures')), + ('slug', models.SlugField(blank=True)), + ], + ), + ] diff --git a/work_sell/migrations/__init__.py b/work_sell/migrations/__init__.py new file mode 100644 index 0000000..e69de29