On Mon, 2011-02-21 at 08:35 -0800, Jonathan Vanasco wrote:
> To be clear:
>
> This works:
>
> @action(renderer='/test_a.mako')
> def test_a1(self):
> return {'project':'myapp'}
>
> @action(renderer='/test_b.mako')
> def test_b1(self):
> return {'project':'myapp'}
>
> def test_c1(self):
> return render_to_response('/test_b.mako', self.test_b1(),
> request=self.request)
>
>
> But this doesnt:
>
> @action(renderer='/test_a.mako')
> def test_a2(self):
> return {'project':'myapp'}
>
> @action(renderer='/test_b.mako')
> def test_b2(self):
> return HTTPFound(location='/account/login')
>
> def test_c2(self):
> return render_to_response('/account/test_b.mako',
> self.test_b2(), request=self.request)
>
>
>
> Based on this pattern, I don't think it would be possible to migrate
> any of my Pylons apps to Pyramid -- this behavior would require a
> substantial rewrite of most controllers.
Considering that Pylons doesn't have externalized renderers and you need
to do the equivalent of "render_to_response" unconditionally in Pylons,
that surprises me.
> 1- The way redirects / 404s are currently implemented creates a need
> for additional logic in a dispatching function ( the results would
> need to be tested, not handled by the framework )
You're saying that:
return HTTPFound('http://...')
Requires more testing than:
redirect('http://...')
>
> 2- There looks to be a duplication in labor - a call to a dispatched
> function would also require noting the template as well. So instead
> of just noting the template at the function, you're also noting it at
> anything that dispatches it.
Which is exactly what you already have to do in Pylons, right?
- C
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en.