Skip to content
Snippets Groups Projects

Convert HTML metadatas as markdown

Merged Manon Blanco requested to merge convert-html-metadata-as-markdown into master
All threads resolved!
1 file
+ 4
0
Compare changes
  • Side-by-side
  • Inline
@@ -6,12 +6,16 @@ from arkindex.documents.models import MetaType
def convert_html_metadata_to_markdown(apps, schema_editor):
MetaData = apps.get_model('documents', 'MetaData')
AllowedMetaData = apps.get_model('documents', 'AllowedMetaData')
MetaData.objects.exclude(type__in=[mt.value for mt in MetaType]).update(type=MetaType.Markdown)
AllowedMetaData.objects.exclude(type__in=[mt.value for mt in MetaType]).update(type=MetaType.Markdown)
def convert_markdown_metadata_to_html(apps, schema_editor):
MetaData = apps.get_model('documents', 'MetaData')
AllowedMetaData = apps.get_model('documents', 'AllowedMetaData')
MetaData.objects.exclude(type__in=[mt.value for mt in MetaType]).update(type=MetaType.HTML)
AllowedMetaData.objects.exclude(type__in=[mt.value for mt in MetaType]).update(type=MetaType.HTML)
class Migration(migrations.Migration):
Loading