So I have a list present in the template context and I want to apply random and then access an attribute of the resulting object.
So far, what I’ve read in the template section of the django documentation, filters always have to come after the variable so I understand (even though I tried it anyway) that
{{ my_list|random.attribute }}
won’t work.
Right now I’m using a custom filter to access attribute, so I can chain it after any other filter, but what would be the best solution for this?
Use with to give the result another name temporarily.