def create_areas(apps, schema_editor):
    ServiceArea = apps.get_model("services", "ServiceArea")

    for number, parent, english, arabic in INITIAL_AREAS:
        # If the area already exists, do not change it because someone might
        # have edited it and we don't want to lose their changes.
        ServiceArea.objects.get_or_create(
            pk=number, defaults=dict(name_en="%s / %s" % (parent, english), name_ar="%s / %s" % (parent, arabic))
        )
    update_postgres_sequence_generator(ServiceArea)
def create_areas(apps, schema_editor):
    ServiceArea = apps.get_model('services', 'ServiceArea')

    for number, parent, english, arabic in INITIAL_AREAS:
        # If the area already exists, do not change it because someone might
        # have edited it and we don't want to lose their changes.
        ServiceArea.objects.get_or_create(
            pk=number,
            defaults=dict(
                name_en="%s / %s" % (parent, english),
                name_ar="%s / %s" % (parent, arabic),
            )
        )
    update_postgres_sequence_generator(ServiceArea)
Example #3
0
def create_areas(apps, schema_editor):
    ServiceArea = apps.get_model('services', 'ServiceArea')

    ServiceArea.objects.update_or_create(pk=27,
                                         defaults=dict(
                                             name_en="Mount Lebanon",
                                             name_ar="جبل لبنان",
                                         ))
    ServiceArea.objects.update_or_create(
        pk=28,
        defaults=dict(
            name_en="Tripoli and surroundings",
            name_ar="طرابلس وضواحيها",
        ))

    update_postgres_sequence_generator(ServiceArea)
def create_areas(apps, schema_editor):
    ServiceArea = apps.get_model('services', 'ServiceArea')

    ServiceArea.objects.update_or_create(
        pk=27,
        defaults=dict(
            name_en="Mount Lebanon",
            name_ar="جبل لبنان",
        )
    )
    ServiceArea.objects.update_or_create(
        pk=28,
        defaults=dict(
            name_en="Tripoli and surroundings",
            name_ar="طرابلس وضواحيها",
        )
    )

    update_postgres_sequence_generator(ServiceArea)