Skip to content

Commit

Permalink
Feat speciesSheet: use markdown for TaxHub attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
jpm-cbna committed Apr 25, 2022
1 parent d2962b5 commit da6eb3d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions atlas/modeles/repositories/vmCorTaxonAttribut.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding:utf-8 -*-

from sqlalchemy.sql import text
import markdown


def getAttributesTaxon(
Expand Down Expand Up @@ -28,12 +29,13 @@ def getAttributesTaxon(
'chorologie': None
}
for r in req:
html_value = markdown.markdown(r.valeur_attribut)
if r.id_attribut == attrDesc:
descTaxon['description'] = r.valeur_attribut
descTaxon['description'] = html_value
elif r.id_attribut == attrComment:
descTaxon['commentaire'] = r.valeur_attribut
descTaxon['commentaire'] = html_value
elif r.id_attribut == attrMilieu:
descTaxon['milieu'] = r.valeur_attribut.replace("&", " | ")
elif r.id_attribut == attrChoro:
descTaxon['chorologie'] = r.valeur_attribut
descTaxon['chorologie'] = html_value
return descTaxon
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ geojson
gunicorn
itsdangerous < 2.0
Jinja2 < 3.0
markdown
MarkupSafe
marshmallow
python-dotenv
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ gunicorn==20.1.0
importlib-metadata==4.8.2
itsdangerous==1.1.0
Jinja2==2.11.3
markdown==3.3.6
MarkupSafe==2.0.1
marshmallow==3.14.1
packaging==21.3
Expand Down

0 comments on commit da6eb3d

Please sign in to comment.