On Jan 9, 12:20 am, Gaojiawang <[EMAIL PROTECTED]> wrote: > I want to use the local variable in template's html file. > like 'count = 0' and how to use it > How to do it?
The snippet José links to uses the resolve function of Django's templating system, which is good because it stays within the context created by the view and thus does not tempt a template writer to do arbitrary Python things in the middle of a template. However, there may be times when you want something a little more powerful. WARNING: If you think you need to use the following tag, think twice: it will probably cause you to embed knowledge about your models and/or business logic in your templates. This is a Bad Thing (tm). If you still feel the need, see http://www.djangosnippets.org/snippets/9/ for arbitrary Python expressions assigned to a variable. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

