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

97
Views
how we can implement this coniditon in django template

How i can implement this condition in django template with multiple and or statement in if?

 {% if ((email_setting.twitter_link is not None and email_setting.twitter_link != '') 
 or (email_setting.instagram_link is not None and email_setting.instagram_link != '') 
 or (email_setting.fb_link is not None and email_setting.fb_link!= '') ) %}
  Here my body
 {% endif %}

this give me an error

TemplateSyntaxError at /settings/emailView
Could not parse the remainder: '((email_setting.twitter_link' from '((email_setting.twitter_link'
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can expresss this as:

{% if email_setting.twitter_link or email_setting.instagram_link or email_setting.fb_link %}
   …
{% endif %}

Here we check the truthiness of the twitter_link and other settings. The truthiness of None and the empty string are False whereas for a non-empty string, it is True.

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!