Replies: 1 comment 1 reply
-
circuit__type__in=[’3’, ’4’]
…Sent from my iPhone
On 15 Jun 2022, at 11:19, dsc999 ***@***.***> wrote:
Hi! I'm trying to create a custom link which checks the circuit type and status.
I currently have this:
{% if obj.circuit_terminations.filter(circuit__custom_field_data__WAN='1', circuit__type='3', circuit__status='active').count() > 0%}T1
{% elif obj.circuit_terminations.filter(circuit__custom_field_data__WAN='1', circuit__type='4', circuit__status='active').count() > 0%}T1
{% elif obj.circuit_terminations.filter(circuit__custom_field_data__WAN='1', circuit__type='5', circuit__status='active').count() > 0%}T2
{% endif %}
This code actually works. The thing is, since I have multiple lines to write on the custom link and these ones are limited, I need to check (in this example) if 'circuit__type' has one of the following values: '3', '4'.
What syntax should I use in order to do it, like I would do in python:
if circuit_type in ['3', '4']:
Thank you for your help.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm trying to create a custom link which checks the circuit type and status.
I currently have this:
This code actually works. The thing is, since I have multiple lines to write on the custom link and these ones are limited, I need to check (in this example) if 'circuit__type' has one of the following values: '3', '4'.
What syntax should I use in order to do it, like I would do in python:
Thank you for your help.
Beta Was this translation helpful? Give feedback.
All reactions