equal
deleted
inserted
replaced
1 |
|
2 from django.db import migrations |
|
3 |
|
4 def copy_link_data(apps, schema_editor): |
|
5 Collection = apps.get_model('iconolab', 'Collection') |
|
6 for collection in Collection.objects.all(): |
|
7 collection.link_text = 'Cet objet dans Joconde catalogue collectif des collections des musées de France' |
|
8 collection.link_url = "http://www.culture.gouv.fr/public/mistral/joconde_fr?ACTION=CHERCHER&FIELD_98=REF&VALUE_98={joconde_ref:0>11}" |
|
9 collection.save() |
|
10 |
|
11 class Migration(migrations.Migration): |
|
12 |
|
13 |
|
14 dependencies = [ |
|
15 ('iconolab', '0032_auto_20180704_1131'), |
|
16 ] |
|
17 |
|
18 operations = [ |
|
19 migrations.RunPython(copy_link_data), |
|
20 ] |
|