1
0
Fork 0
mirror of https://github.com/Findus23/acronomy.git synced 2024-09-19 15:33:45 +02:00
acronomy/acros/management/commands/markdown.py

15 lines
430 B
Python
Raw Normal View History

2020-06-01 11:03:21 +02:00
from django.core.management.base import BaseCommand
from acros.models import Acronym
2020-06-02 20:10:37 +02:00
from acros.utils.conversion import md_to_html
2020-06-01 11:03:21 +02:00
class Command(BaseCommand):
help = 'Updates all Markdown descriptions'
def handle(self, *args, **options):
acronyms = Acronym.objects.all()
for acronym in acronyms:
print(acronym.name)
acronym.description_html = md_to_html(acronym.description_md)