<filename>comptes/migrations/0020_auto_20180106_2130.py
# Generated by Django 2.0.1 on 2018-01-06 21:30

from datetime import datetime

from django.db import migrations


def moment(apps, schema_editor):
    for model in ('Dette', 'Remboursement'):
        for instance in apps.get_model('comptes', model).objects.all():
            instance.moment = datetime.combine(instance.date, instance.time)
            instance.save()


class Migration(migrations.Migration):

    dependencies = [
        ('comptes', '0019_auto_20180106_2130'),
    ]

    operations = [
        migrations.RunPython(moment),
    ]

<filename>comptes/migrations/0020_auto_20180106_2130.py
# Generated by Django 2.0.1 on 2018-01-06 21:30

from datetime import datetime

from django.db import migrations


def moment(apps, schema_editor):
    for model in ('Dette', 'Remboursement'):
        for instance in apps.get_model('comptes', model).objects.all():
            instance.moment = datetime.combine(instance.date, instance.time)
            instance.save()


class Migration(migrations.Migration):

    dependencies = [
        ('comptes', '0019_auto_20180106_2130'),
    ]

    operations = [
        migrations.RunPython(moment),
    ]

# Generated by Django 2.0.1 on 2018-01-06 21:30