开发者

How to dynamic insert data from templatetag

开发者 https://www.devze.com 2023-03-29 09:27 出处:网络
I have many different models and each does something different. In template i want use templatetag ex: {% loadmodules \'left\' %} which loads the appropriate modules

I have many different models and each does something different. In template i want use templatetag ex: {% loadmodules 'left' %} which loads the appropriate modules

开发者_高级运维

For example i have module "menu" (model menu and model menuitem with relation to menu) and if module menu have position 'left', it being loaded in template but in such a way as to display a specific HTML with retrieved data.

How to convert templatetag on the list of results returned from the function of a module?


I can't understand what do you exactly need, but there are two possible solutions: docs.djangoproject.com/en/dev/howto/custom-template-tags - create your own templatetag or use includes.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号