On 9/10/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
> Valid point - however, in practice, the same context is passed to
> multiple templates. There are some edge cases (e.g., a view with two
> calls to render_to_template) where this isn't the case, but I wouldn't
> consider them to be the common case.

I'm not entirely familiar with how the test client keeps track of
contexts, but I recently published an app[1] that does exactly this,
and I'm hoping it may become quite common.

Basically, it renders a series of small templates, each with its own
context, independent of the one being rendered on the main page, and
adds the rendered output to a context variable that can be looped
through in the main template. So, essentially, I could (and plan to)
render a set of 5 or 6 modules that all contain a "module" variable in
the context, but each "module" variable will point to a different
object.

I hadn't considered what impact this might have on writing test cases
for it, as I haven't even finished the documentation written for it
yet. I won't have much time to look more into how it would work this
week, but I hope to devote more time to it after (or during) the
sprint, so maybe that'll shed some light on things. Just wanted to
give you a heads up that there may indeed be such a not-so-uncommon
case in the not-so-distant future.

-Gul

[1] http://code.google.com/p/django-modular/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to