Completed
Push — master ( e8ec91...4c727f )
by Fox
01:13
created

update_date_result()   A

Complexity

Conditions 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
c 1
b 1
f 0
dl 0
loc 6
rs 9.4285
1
# -*- coding: utf-8 -*-
2
from __future__ import unicode_literals
3
4
from django.db import migrations
5
6
7
def update_date_result(apps, schema):
8
    TriggerService = apps.get_model("django_th", "TriggerService")
9
    for trigger in TriggerService.objects.all():
10
        trigger.date_result = trigger.date_triggered
11
        trigger.result = 'OK'
12
        trigger.save()
13
14
15
class Migration(migrations.Migration):
16
17
    dependencies = [
18
        ('django_th', '0007_trigger_result'),
19
    ]
20
    operations = [
21
        migrations.RunPython(update_date_result),
22
    ]
23