I think the closest you could get to a painless implementation of what
you need, for existing apps, could be to create a method named
something like "render_to_json_response", that behave the way you want
and have the appropriate "views" modules in each app import it as
"render_to_response" (indee
On Mon, 2009-03-16 at 18:34 -0700, Preston Timmons wrote:
> I am wondering if render_to_response is really the proper function you
> are looking for.
>
> For instance, here is a simple view that returns json using
> HttpResponse without need of a template:
He was wanting to hijack the output fro
I am wondering if render_to_response is really the proper function you
are looking for.
For instance, here is a simple view that returns json using
HttpResponse without need of a template:
import simplejson
from django.http import HttpResponse
def output_json(request):
data = [
dict(
On Mon, 2009-03-16 at 20:05 -0400, Malinka Rellikwodahs wrote:
[...]
> Unless I'm mistaken it should be fairly simple in this case to create
> your own set of templates for each of the django apps you're using and
> then have them output the data you need as json text instead of as
> html
Ooh ...
ext dict
> as JSON instead
> of rendering the html template.
>
> Is it possible to override render_to_response so all the apps using it will
> respond with JSON without
> actually touching the apps code? I don't want to create a middleware that
> will modify the response
> context dict as JSON instead
> of rendering the html template.
>
> Is it possible to override render_to_response so all the apps using it
> will respond with JSON without
> actually touching the apps code?
Not really, no. Monkey-patching like that is gene
Hi,
I'm building a one page app with no page refresh.
All the content is loaded as JSON dynamically and the UI is built using
javascript.
I'm using external django apps and I need them to send back the context dict
as JSON instead
of rendering the html template.
Is it possible t
7 matches
Mail list logo