diff --git a/projects/forms.py b/projects/forms.py index 8e978dd..fa0b5b9 100644 --- a/projects/forms.py +++ b/projects/forms.py @@ -92,6 +92,12 @@ class PortfolioForm(forms.ModelForm): model = Portfolio fields = '__all__' + widgets = { + 'construction_type': forms.Select(attrs={'class':'selectpicker'}), + 'building_classification': forms.Select(attrs={'class':'selectpicker'}), + 'currency': forms.Select(attrs={'class':'selectpicker'}), + 'term_type': forms.Select(attrs={'class':'selectpicker'}), + } class ContractorProjectAnswerForm(forms.ModelForm): # def __init__(self, *args, **kwargs): 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/models.py b/projects/models.py index e08d8f8..6eea696 100644 --- a/projects/models.py +++ b/projects/models.py @@ -180,13 +180,13 @@ class Candidate(models.Model): class Portfolio(models.Model): description = models.TextField() name = models.CharField(max_length=255) - budget = models.DecimalField(max_digits=10, decimal_places=0, default=0, null=True) - budget_by_agreement = models.BooleanField(default=False) - specialization = TreeForeignKey(Specialization, related_name='portfolios') - term = models.IntegerField(default=0) - term_type = models.CharField(max_length=20, choices=TERMS, default='hour') - building_classification = models.ForeignKey(BuildingClassfication, related_name='portfolios') - construction_type = models.ForeignKey(ConstructionType, related_name='portfolios') + budget = models.DecimalField(max_digits=10, decimal_places=0, default=0, null=True, blank=True) + currency = models.CharField(max_length=20, default='rur', choices=CURRENCIES, null=True, blank=True) + specialization = TreeForeignKey(Specialization, related_name='portfolios',null=True, blank=True) + term = models.IntegerField(default=0,null=True, blank=True) + term_type = models.CharField(max_length=20, choices=TERMS, default='hour',null=True, blank=True) + building_classification = models.ForeignKey(BuildingClassfication, related_name='portfolios',null=True, blank=True) + construction_type = models.ForeignKey(ConstructionType, related_name='portfolios',null=True, blank=True) location = TreeForeignKey('common.Location', related_name='portfolios', null=True, blank=True) worksell = models.BooleanField(default=False) user = models.ForeignKey(User, related_name='portfolios') diff --git a/projects/templates/contractor_portfolio_edit.html b/projects/templates/contractor_portfolio_edit.html new file mode 100644 index 0000000..06eea9c --- /dev/null +++ b/projects/templates/contractor_portfolio_edit.html @@ -0,0 +1,97 @@ +{% extends 'partials/base.html' %} + +{% load common_tags %} + +{% block content %} + {% include 'partials/header.html' %} + +
Изменение портфолио
+{{ p.name }}