Django-Template : Get Variables in a Tag block !

前端 未结 4 576
有刺的猬
有刺的猬 2021-02-04 14:37

I need to retrieve an optional number saved in DB , to a custom template tag i made . which to retrieve , a variable ( a photo ID ) included in this Gallery . within the gallery

4条回答
  •  失恋的感觉
    2021-02-04 14:48

    You don't put the brackets around variables when you use them in template tags.

    {% get_latest_photo photo.id %}
    

提交回复
热议问题