Re: Pick a value from list variable in templates

2008-03-06 Thread Justin Fagnani
There must be a lot of us who have created a similar filter. My particular version looks like this: from django.template import resolve_variable def lookup(value, key): return resolve_variable(key,value) so that it behaves like the normal attribute access.I use this to do things like send a

Re: Pick a value from list variable in templates

2008-03-06 Thread Adrian Holovaty
On Thu, Mar 6, 2008 at 8:25 PM, Ian Kelly <[EMAIL PROTECTED]> wrote: > Why do I have a sudden fear that a branch is going to spawn called > "newtemplates"? That won't be happening. As Jacob noted eloquently, this filter/feature isn't something worth adding at this time. It's quite easy to add

Re: Pick a value from list variable in templates

2008-03-06 Thread Ian Kelly
On Thu, Mar 6, 2008 at 7:06 PM, Collin Grady <[EMAIL PROTECTED]> wrote: > To keep things consistent though, you'd then likely have to change normal > access > to work like that as well, so instead of foo.bar to look up the key "bar" > you'd > have to change it to use foo["bar"], which would

Re: Pick a value from list variable in templates

2008-03-06 Thread Collin Grady
Matthew Marshall said the following: > What's wrong with ``{{ foo[bar] }}`` ? > > That's how it's done in python, javascript, php, and others. Most people > writing html templates will be somewhat familiar with at least Javascript. To keep things consistent though, you'd then likely have to

Re: Pick a value from list variable in templates

2008-03-06 Thread Matthew Marshall
On Tuesday 04 March 2008 14:54:38 Jacob Kaplan-Moss wrote: > Second, there's the question of weather this is a first-class > language-level feature or a filter. If it's the former, there's a > syntactic decision to be made; some have proposed something like ``{{ > foo.$bar }}``, but anything that

Re: Pick a value from list variable in templates

2008-03-06 Thread Russell Keith-Magee
On Fri, Mar 7, 2008 at 8:53 AM, Yuri Baburov <[EMAIL PROTECTED]> wrote: > > I suggest {{ foo->bar }} syntax. It is simple, common to programmers, > easy to remember and recognize, does not interfere with any other > features. -1. 1) The primary audience of the Django template language is

Re: Pick a value from list variable in templates

2008-03-06 Thread Yuri Baburov
I suggest {{ foo->bar }} syntax. It is simple, common to programmers, easy to remember and recognize, does not interfere with any other features. On Wed, Mar 5, 2008 at 5:50 PM, vcc <[EMAIL PROTECTED]> wrote: > > I got another ID: foo.(bar) > It's clear and no conflict, also can use nested,

django-restapi Improvements Proposal

2008-03-06 Thread Jared Flatow
Hi all, Forgive me if this is slightly off topic, but I hope to get some feedback on the design of what I think is an improved version of the django-rest-interface. I have posted a gzipped archive of the code and an example application here:

Re: settings imported twice Was: logging & MODPYTHON

2008-03-06 Thread Thomas Guettler
> Something like that should work though: > > try: > reimported = imported > raise Exception, "already imported!" > catch NameError: > imported = True > > Sorry, if __name__ is different, this won't help, too. The python interpreter thinks that there are two different modules.