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
lista_1 = ['a', 'b', 'c', 'a'] | |
lista_2 = [1,2,3,4] | |
dicio = {} | |
for key, value in zip(lista_1, lista_2): | |
if key in dicio: | |
dicio[key] = [dicio[key]] + [value] | |
else: | |
dicio[key] = value |
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
from django.db import migrations | |
import third_party_app.generators | |
import third_party_app.models | |
def forwards_func(apps, schema_editor): | |
""" | |
Forward migration touches every somemodel.some_field to do some shenanigans. | |
""" | |
pass |
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
from django.db import migrations | |
import third_party_app.generators | |
import third_party_app.models | |
def forwards_func(apps, schema_editor): | |
""" | |
Forward migration touches every somemodel.some_field to do some shenanigans. | |
""" | |
pass |
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
MIGRATION_MODULES = {'third_party_app': 'my_awesome_app.temp_migrations'} |
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
python manage.py migrate my_awesome_app zero | |
python manage.py third_party_app zero |
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
from django.db import migrations | |
class Migration(migrations.Migration): | |
... | |
run_before = [ | |
('third_party_app', '0001_initial'), | |
] | |
... |