Re: Rethinking silent failures in templates

2008-05-17 Thread Peter Rowell
Personally, I prefer fireworks when a variable is not set. Here's yet another possibility, just a variant on current code: TEMPLATE_STRING_IF_INVALID = "% (expression)s: %(error)s" The above would be filled in by _resolve_lookup with appropriate values. Then you have a style: template-var-error

Re: Callable context variables do not get called during resolution.

2008-05-09 Thread Peter Rowell
> Look at the constructor of django.db.models.sql.query.Query for the > "connection" argument. You know, I grepped on that but didn't see anything interesting. Now with a two-beer-handicap, I'll go with Blanche DuBois -- Tomorrow is another day. --~--~-~--~~~---~--~

Re: Callable context variables do not get called during resolution.

2008-05-09 Thread Peter Rowell
> You probably should take a look at the ORM code. OK, I'll bite. I kind of doubt he rewrote the templating system in the ORM, so you must be inferring that multiple database support was part of the qs-refactoring. I just checked out trunk and I'll admit I'm working with a one-beer-handicap at th

Re: Callable context variables do not get called during resolution.

2008-05-09 Thread Peter Rowell
> QuerySets are lazy [...] What are you trying to accomplish that is any > different? I'm working around the fact that Django's templates can't take arguments. So I'm calling formatting functions which *do* take arguments, one of which is a QuerySet. Of course, I can't pass args to a function in

Re: Callable context variables do not get called during resolution.

2008-05-09 Thread Peter Rowell
BTW, I tried to add a comment on this to http://code.djangoproject.com/ticket/7153, but got "Internal Server Error (Submission rejected as potential spam)", which struck me as rather rude. :-) --~--~-~--~~~---~--~~ You received this message because you are subscrib

Callable context variables do not get called during resolution.

2008-05-09 Thread Peter Rowell
Short version: Callable context variables do not get called during resolution. If invoked as a simple variable they return something like . If used in a for loop, they blow up the template. I'm running trunk:7374 Longer version: In order to delay a *very* expensive DB operation, I decided to p

Re: Easier URL patterns

2008-04-09 Thread Peter Rowell
> Django is the web framework for perfectionists with deadlines! Thank you. Somehow I missed that. :-) Seriously, one of the key things you do when marketing a product is identify your target audience. Adrian and Jacob (or their editors) had to do that when writing the book. What specifically m

Re: Easier URL patterns

2008-04-09 Thread Peter Rowell
This conversation is reminiscent of many others I have seen in other technical communities through the years. I believe the need for a simpler URL pattern mechanism (and perhaps other simplifying tools) is largely dictated by the stated target audience for Django. If Django is meant for experienc

Re: Session save every request

2008-01-06 Thread Peter Rowell
> Just wanted to point out a discussion in django-users which is a bit > of a worry regarding session > behaviour:http://groups.google.com/group/django-users/browse_thread/thread/f7d7... Well, I was the original poster and part of what was reported was an analysis error on my part. Mea culpa. We