Skip to content
Snippets Groups Projects
Select Git revision
  • 58c446ae5687afdc7885be68d67e0c0e056a1727
  • master default protected
  • 2.0.0-alpha-11
  • 2.0.0-alpha-10
  • 2.0.0-alpha-9
  • 2.0.0-alpha-8
  • 2.0.0-alpha-7
  • 2.0.0-alpha-6
  • 2.0.0-alpha-5
  • 2.0.0-alpha-4
  • 2.0.0-alpha-3
  • 2.0.0-alpha-2
  • 2.0.0-alpha-1
  • 1.8.0
  • 1.7.0
  • 1.6.4
  • 1.6.3
  • 1.6.2
  • 1.6.1
  • 1.6.0
  • 1.5.5
  • 1.5.4
22 results

headings.mustache

Blame
  • Forked from TO / Weby / ui-styleguide
    Source project has a limited visibility.
    0067_delete_all_superseded_pages.py 825 B
    # Generated by Django 4.0.3 on 2022-05-06 08:49
    
    from django.db import migrations
    
    
    def delete_all_superseded_page_types(apps, schema_editor):
        Page = apps.get_model("wagtailcore", "Page")
        ContentType = apps.get_model("contenttypes", "ContentType")
    
        for model in (
            "districtafterelectionpage",
            "districtelectionpage",
            "districtelectionpointpage",
        ):
            try:
                ct = ContentType.objects.get(app_label="district", model=model)
                Page.objects.filter(content_type=ct).delete()
            except ContentType.DoesNotExist:
                pass
    
    
    class Migration(migrations.Migration):
        dependencies = [
            ("district", "0066_alter_districtarticlepage_content_and_more"),
        ]
    
        operations = [
            migrations.RunPython(delete_all_superseded_page_types),
        ]