开发者

How to dynamic insert data from templatetag

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜