diff --git a/projects/templates/customer_project_detail.html b/projects/templates/customer_project_detail.html
index fd2fac9..93216ca 100644
--- a/projects/templates/customer_project_detail.html
+++ b/projects/templates/customer_project_detail.html
@@ -119,9 +119,9 @@
- {{ answer.user.get_full_name }} [ivanov_petr]
+ {{ answer.contractor.get_full_name }} []
- На сайте {{ answer.user.created }}
+ На сайте {{ answer.contractor.created }}
Свободен
@@ -187,9 +187,7 @@
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus sapien nunc eget odio.
-
+ Lorem ipsum dolor sit amet
diff --git a/projects/templates/projects/project_list.html b/projects/templates/projects/project_list.html
index af83dba..7c77181 100644
--- a/projects/templates/projects/project_list.html
+++ b/projects/templates/projects/project_list.html
@@ -175,7 +175,7 @@
0
- 0
+ {{ proj.answers.count }}
{{ proj.user }}
diff --git a/requirements/base.txt b/requirements/base.txt
index 9c42914..ab9636b 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -1,5 +1,6 @@
Django==1.9.6
Pillow==3.2.0
+django-compressor==2.0
django-debug-toolbar==1.4
django-environ==0.4.0
django-extensions==1.6.7
@@ -14,5 +15,6 @@ psycopg2==2.6.1
pydash==3.4.3
requests==2.10.0
six==1.10.0
+sorl-thumbnail==12.3
sqlparse==0.1.19
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/models.py b/users/models.py
index 9f657a5..2444a2e 100644
--- a/users/models.py
+++ b/users/models.py
@@ -34,6 +34,10 @@ class CustomerUserManager(models.Manager):
class User(AbstractBaseUser, PermissionsMixin):
+ STATUSES = (
+ ('free', 'Свободен'),
+ ('busy', 'Занят'),
+ )
nickname = models.CharField(max_length=50, blank=True,null=True)
first_name = models.CharField(max_length=255, blank=True)
last_name = models.CharField(max_length=255, blank=True)
@@ -42,10 +46,16 @@ class User(AbstractBaseUser, PermissionsMixin):
created = models.DateTimeField(default=timezone.now)
last_time_visit = models.DateTimeField(default=timezone.now)
contractor_specializations = models.ManyToManyField(Specialization, related_name='contractors', blank=True)
+ contractor_status = models.CharField(default='free', max_length=20, choices=STATUSES)
@property
def is_staff(self):
return self.is_superuser
+
+ @property
+ def is_free(self):
+ return self.contractor_status == 'free'
+
def __str__(self):
return self.email