-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migracion de correccion de callable str
- Loading branch information
Alexis Wolfsdorf
committed
Nov 6, 2019
1 parent
f8b498e
commit b3c6bf6
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...toreo/apps/dashboard/migrations/0058_federation_task_callable_str_migration_correction.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
|
||
def convert_callable_str(apps, _schema_editor): | ||
stage_model = apps.get_model('django_datajsonar', 'Stage') | ||
stages = stage_model.objects.filter(callable_str__contains=".tasks.") | ||
for stage in stages: | ||
stage.callable_str = stage.callable_str.replace(".tasks.", ".federation_tasks.") | ||
stage.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('dashboard', '0057_federation_task_callable_str_migration'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(convert_callable_str, migrations.RunPython.noop) | ||
] |