add stages models

remotes/origin/setup
Mukhtar 10 years ago
parent 4573742355
commit a443240fa3
  1. BIN
      data.xlsx
  2. 50
      projects/migrations/0017_auto_20160606_1659.py
  3. 55
      projects/models.py
  4. 6
      projects/templates/projects/project_detail.html
  5. 6
      projects/templates/projects/project_form.html
  6. 16
      users/templates/users/contractor.html

Binary file not shown.

@ -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'),
),
]

@ -5,6 +5,18 @@ from django.utils import timezone
from users.models import User
from specializations.models import Specialization
COST_TYPE_CHOICES = (
('rur', 'rur'),
('usd', 'usd'),
('eur', 'eur'),
)
TERM_TYPE_CHOICES = (
('hour', 'hour'),
('day', 'day'),
('month', 'month'),
)
class Realty(models.Model):
BUILDING_CLASSIFICATION_CHOICES = (
@ -58,10 +70,9 @@ class Project(models.Model):
class Order(models.Model):
project = models.OneToOneField(Project, related_name='order')
contractor = models.ForeignKey(User)
cost = models.DecimalField(max_digits=10, decimal_places=0)
term = models.IntegerField(default=1)
created = models.DateTimeField(default=timezone.now, editable=False)
status = models.BooleanField(default=False)
secure = models.BooleanField(default=False)
def __str__(self):
return self.project.name
@ -71,19 +82,25 @@ class Order(models.Model):
verbose_name_plural = 'Заказы'
class Stage(models.Model):
name = models.CharField(max_length=255)
result = models.CharField(max_length=255)
cost = models.DecimalField(max_digits=10, decimal_places=0)
cost_type = models.CharField(max_length=5, choices=COST_TYPE_CHOICES, default='rur')
term = models.IntegerField(default=0)
term_type = models.CharField(max_length=10, choices=TERM_TYPE_CHOICES, default='hour')
order = models.ForeignKey(Order, related_name='stages')
def __str__(self):
return self.name
class Meta:
verbose_name = 'Этап'
verbose_name_plural = 'Этапы'
class Answer(models.Model):
COST_TYPE_CHOICES = (
('rur', 'rur'),
('usd', 'usd'),
('eur', 'eur'),
)
TERM_TYPE_CHOICES = (
('hour', 'hour'),
('day', 'day'),
('month', 'month'),
)
cost = models.DecimalField(max_digits=10, decimal_places=0)
cost_type = models.CharField(max_length=5, choices=COST_TYPE_CHOICES, default='rur')
text = models.TextField()
@ -114,10 +131,11 @@ class Candidate(models.Model):
verbose_name = 'Кандидат'
verbose_name_plural = 'Кандидаты'
class Portfolio(models.Model):
name = models.CharField(max_length=255)
description = models.TextField()
user = models.ForeignKey(User,related_name='portfolio')
user = models.ForeignKey(User, related_name='portfolio')
def __str__(self):
return self.name
@ -135,8 +153,5 @@ class PortfolioPhoto(models.Model):
verbose_name = 'Фото портфолио'
verbose_name_plural = 'Фото портфолио'
# def __str__(self):
# return self.img
# def __str__(self):
# return self.img

@ -95,9 +95,9 @@
<div class="polsF1 pols-new disTab">
<div class="col-lg-3">
<select class="selectpicker">
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
<option>От своего имени</option>
<option></option>
</select>
</div>
</div>

@ -73,10 +73,10 @@
<div class="polsF1 disTab">
<div class="col-lg-3">
{# <select id="specialization1" name="{{ project_form.specialization.name }}">#}
{# </select>#}
<select id="specialization1" name="{{ project_form.specialization.name }}">
</select>
{{ project_form.specialization }}
{# {{ project_form.specialization }}#}
</div>
<div class="col-lg-3">
<select class="selectpicker">

@ -1,18 +1,15 @@
{% extends "base.html" %}
{% load staticfiles %}
{% block content %}
<h1>{{ object }}</h1>
<h1>{{ user }}</h1>
<h2>{{ user.groups.all }}</h2>
<div class="container mainScore mainBlock2">
<div class="row">
<div class="col-lg-12">
<div class="col-lg-3 divCol3">
<div class="avatar">
<div class="avatarInset">
<img src="img/profile.jpg" alt="profile-image">
<img src="{% static 'img/profile.jpg' %}" alt="profile-image">
</div>
</div>
<div class="menuUser disTab">
@ -75,20 +72,17 @@
<span>Архитектура</span>
<span>3-й</span>
</div>
<div class="insetSpec">
<span>3D Моделирование</span>
<span>100-й</span>
</div>
</div>
</div>
<div class="col-lg-4">
<ul class="rettList">
<li><a href="javascript:void(0)">Рейтинг: <span> 1245</span></a></li>
<li><a href="javascript:void(0)">Рейтинг: <span> 0</span></a></li>
<li><a href="javascript:void(0)">Безопасные сделки: <span> 5</span></a></li>
<li>
<a href="javascript:void(0)">
Отзывы:
<span> + 385</span>
<span> + 0</span>
<small> 0</small>
<mark> - 0</mark>
</a>

Loading…
Cancel
Save