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
2020-06-02 20:10:37 +02:00

14 lines
430 B
Python

from django.core.management.base import BaseCommand
from acros.models import Acronym
from acros.utils.conversion import md_to_html
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)