Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

370
Views
How to use this for 'if' statement in jinja2 template

I'm trying to write an if statement in a Jinja2 template:

let temp_html = `<div class="card">
    <div class="card-body">
        <blockquote class="blockquote mb-0">
            <p>${comment}</p>
            <footer class="blockquote-footer">${name}</footer>
            {% if session['user_id'] == ? %}
            <div class="modify">modify</div>
            {% endif %}
        </blockquote>
    </div>
</div>`

=> in the ajax

I want to compare ${name} to session['user_id'] using the {% if ~ %} as I wrote.

How can I write ${name} in the 'if' statement within the Jinja2 template?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

 session['user_id'] ? 'if true' : 'if false'

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!