0009_auto_20170211_1523.py 577 B

12345678910111213141516171819202122
  1. # -*- coding: utf-8 -*-
  2. # Generated by Django 1.10.5 on 2017-02-11 14:23
  3. from __future__ import unicode_literals
  4. from django.db import migrations
  5. def remove_unaffected_services(apps, schema_editor):
  6. db_alias = schema_editor.connection.alias
  7. Service = apps.get_model('services', 'Service')
  8. Service.objects.using(db_alias).filter(adherent__isnull=True).delete()
  9. class Migration(migrations.Migration):
  10. dependencies = [
  11. ('services', '0008_auto_20170211_0130'),
  12. ]
  13. operations = [
  14. migrations.RunPython(remove_unaffected_services),
  15. ]