- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2022 06:35 AM
Hi Team,
I wondered if one of you could share some Jinja2 Template design principles (What to do / What not to do) please ?
Any link would be appreciated !
Thanks in advance,
Jerems
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 08:17 PM - edited 06-22-2022 08:18 PM
Hello,
I used Jinja in some script.
Here some stuff that i used:
- I use dictionnary to pass Data to the template ==> It's simplify thing because you have to add your new element to dictionnary then just use it in your template otherwise if you pass directly variable you have to modify it 3 times ..
- You have to check how you want to deal with whitespace & newline break
- You have to check how you want to deal with variable that has None as value. Do you want to pass None or just replace by empty string for exemple
Here a Link that might help you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2022 08:17 PM - edited 06-22-2022 08:18 PM
Hello,
I used Jinja in some script.
Here some stuff that i used:
- I use dictionnary to pass Data to the template ==> It's simplify thing because you have to add your new element to dictionnary then just use it in your template otherwise if you pass directly variable you have to modify it 3 times ..
- You have to check how you want to deal with whitespace & newline break
- You have to check how you want to deal with variable that has None as value. Do you want to pass None or just replace by empty string for exemple
Here a Link that might help you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2022 01:10 AM
Hi Nabasch,
Thanks a lot for your hints and support as well as for the provided link.
Jerems
