parent
623efd676b
commit
26674349cd
16 changed files with 211 additions and 68 deletions
@ -0,0 +1,16 @@ |
||||
<div id="dialog_delete" class="modal fade" role="dialog"> |
||||
<div class="modal-dialog" role="document" style="width:400px;"> |
||||
<div class="modal-content"> |
||||
<div class="modal-header"> |
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">× |
||||
</button> |
||||
<h4 class="modal-title"></h4> |
||||
</div> |
||||
<div class="modal-footer"> |
||||
<button type="button" class="btn btn-danger btn-lg" id="btnNot">Нет</button> |
||||
<button type="button" class="btn btn-success btn-lg" id="btnYes">Да</button> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
@ -0,0 +1,23 @@ |
||||
# -*- coding: utf-8 -*- |
||||
# Generated by Django 1.9.7 on 2016-09-08 08:17 |
||||
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', '0027_auto_20160907_1658'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AddField( |
||||
model_name='stage', |
||||
name='approve_time', |
||||
field=models.DateTimeField(default=datetime.datetime(2016, 9, 8, 8, 17, 17, 715320, tzinfo=utc)), |
||||
preserve_default=False, |
||||
), |
||||
] |
||||
@ -0,0 +1,20 @@ |
||||
# -*- coding: utf-8 -*- |
||||
# Generated by Django 1.9.7 on 2016-09-08 08:59 |
||||
from __future__ import unicode_literals |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('projects', '0028_stage_approve_time'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AlterField( |
||||
model_name='stage', |
||||
name='approve_time', |
||||
field=models.DateTimeField(blank=True, null=True), |
||||
), |
||||
] |
||||
@ -1,8 +1,12 @@ |
||||
from django.core.signals import request_finished |
||||
from django.db.models.signals import post_save |
||||
from django.utils import timezone |
||||
from django.dispatch import receiver |
||||
from .models import Project |
||||
from .models import Stage |
||||
|
||||
@receiver(request_finished) |
||||
def add_project_test(sender, **kwargs): |
||||
pr = Project.objects.create(name='Test', price=100, user=2, spec=2) |
||||
pr.save() |
||||
|
||||
@receiver(post_save, sender=Stage) |
||||
def set_approve_time(sender, instance, created, **kwargs): |
||||
if instance.status == 'in_process' and not instance.approve_time: |
||||
instance.approve_time = timezone.now() |
||||
instance.save() |
||||
|
||||
Loading…
Reference in new issue