I've looked at extending tags, but it seems that there is no easy way
to extend the tags for the standard Django installed with Google
Apps. That's because the Django 'load' tag "looks at your
INSTALLED_APPS setting and only allows the loading of template
libraries within installed Django apps" (look under Extending the
Template System in this page
http://www.djangoproject.com/documentation/templates_python/#extending-the-template-system).
The only solution seems to be installing the entire Django framework.
Unless of course I'm wrong (which I hope I am). Any thoughts?
> Calling methods with arguments is not allowed, however, you can create
> custom filters andtagsthat provide the parametrized functionality
> that you need.
>
>
http://www.djangoproject.com/documentation/templates_python/#extendin...
> > > > ConsiderDjangotemplate language as language of its own, which has
> > > > nothing to do with Python.
>
> > > > and that is the way it should be (generally, I mean)
>
> > > > if your needs are different, use something else, there are no
> > > > workarounds, and if there would be, they would be considered as
> > > > security wholes or bugs and quickly fixed.
>
> > > > regards
> > > > --
> > > > Roberto Sacconhttp://
rsaccon.com
>
> > > > On Jun 14, 11:55 am, glenc <
glen.coa...@gmail.com> wrote:
>
> > > > > Hi,
>
> > > > > I'm prototyping a webapp on GAE now using the vanilla install and I'm
> > > > > having a hard time with what seems to be some very fundamental
> > > > > limitations of the underlyingDjangoframework, and wanted to ask for
> > > > > some suggestions before jumping to CherryPy (which I know well from
> > > > > TurboGears development). I generally like to stick to the most
> > > > > vanilla frameworks where possible as it means support for particular
> > > > > problems is better, but alas:
>
> > > > > 1. I don't see any way to execute arbitrary Python from within a
> > > > >Djangotemplate, i.e. there doesn't seem to be a {} structure that
> > > > > allows you to write a little block of script that might set up some
> > > > > variables or whatever. This means you have to do all of this in the
> > > > > RequestHandler which makes template inheritance very annoying; AFAICS
> > > > > you have to pass every variable through as a template parameter.
>
> > > > > When you are working with template inheritance, even if you structure
> > > > > your RequestHandlers to try do the "base template" stuff in a
> > > > > superclass, you still have to worry about parameter name collision in
> > > > > the dictionary passed to the template.
>
> > > > > 2.Djangodoesn't seem to want to let you call methods on variables
> > > > > you have, e.g. if you pass through 'obj' as a template parameter,
> > > > >Djangois happy to let you access 'obj.property' but dies if you try
> > > > > to call 'obj.method()' which means you have to set up convoluted
> > > > > filters whose job it is to call the methods. Very bad for
> > > > > readability.
>
> > > > > 3.Djangodoesn't seem to have any access to the normal Python
> > > > > namespace, so let's say I want to insert the logged in user's email
> > > > > address, doing something like {{ users.get_current_user().email() }}
> > > > > won't work because 'users' is not in theDjangonamespace (and also
> > > > > becauseDjangodoesn't understand method calls).