I have this code in my template file
{{markets|getSpiderItem:spider.id}}
Mysql has market_timezone and market_location and it connects to another table with spider_id so I filtered as follow:
@register.filter
def getSpiderItem(datas, spider_id):
return datas.filter(spider=spider_id)
I am getting this output:
<QuerySet [{'market_timezone': 'Turkey', 'market_location': 'Nigde'}]>
I want to print this QuerySet item on Django Template separately.
This function has already 2 for loop so I want to print just 1 time. I don't wanna use for loop like this:
{% for market in markets|getSpiderItem:spider.id %}
I want something like this but I couldn't figure out:
For Example:
{{markets|getSpiderItem:spider.id|market_timezone}} # I don't know the true way.