2018-11-19 23:20:37 +00:00
|
|
|
# Generated by Django 2.1.2 on 2018-11-18 13:42
|
|
|
|
|
|
|
|
from django.db import migrations
|
|
|
|
|
2019-06-16 12:32:24 +00:00
|
|
|
|
2018-11-19 23:20:37 +00:00
|
|
|
def populate_logo_filename(apps, schema_editor):
|
2019-06-16 12:32:24 +00:00
|
|
|
Sponsor = apps.get_model("sponsors", "Sponsor")
|
2018-11-19 23:20:37 +00:00
|
|
|
for sponsor in Sponsor.objects.all():
|
|
|
|
sponsor.logo_filename = sponsor.logo.split("/")[-1]
|
|
|
|
sponsor.save()
|
|
|
|
|
2019-06-16 12:32:24 +00:00
|
|
|
|
2018-11-19 23:20:37 +00:00
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
2019-06-16 12:32:24 +00:00
|
|
|
dependencies = [("sponsors", "0009_sponsor_logo_filename")]
|
2018-11-19 23:20:37 +00:00
|
|
|
|
2019-06-16 12:32:24 +00:00
|
|
|
operations = [migrations.RunPython(populate_logo_filename)]
|