Skip to content

Instantly share code, notes, and snippets.

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
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
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
MIGRATION_MODULES = {'third_party_app': 'my_awesome_app.temp_migrations'}
python manage.py migrate my_awesome_app zero
python manage.py third_party_app zero
from django.db import migrations
class Migration(migrations.Migration):
...
run_before = [
('third_party_app', '0001_initial'),
]
...