[Grok-dev] grok.url() requiring a request object a bit inconvenient

Sylvain Viollon sylvain at infrae.com
Mon Nov 2 04:19:40 EST 2009


On Sun, 01 Nov 2009 15:03:52 +0100
Jan-Wijbrand Kolman <janwijbrand at gmail.com> wrote:

  Hello,

> Even though the ZTK does not really promote retrieving the request 
> object "yourself" (and I think rightfully so!) there are situations 
> where you really really want to be able to get the request anyway.
> 

  I fully agree that you should not have any code where you would need
  to retrieve the request, with something like global_request. The
  reason is simple, is that *if* the request is need in your code, it
  should be added as a parameter. Otherwise it's using global variables
  for me.

  It sounds a bit like you want to write generic code, in a library, and
  that at the end, you end up not.

  But anyway, it's possible if you want, and you do not need to
  write some dirty code yourself to do it.

  I am all +1 to have a method:

     grok.url(object, request, **other_options)

  Best regards,

  Sylvain,


-- 
Sylvain Viollon -- Infrae
t +31 10 243 7051 -- http://infrae.com
Hoevestraat 10 3033GC Rotterdam -- The Netherlands


More information about the Grok-dev mailing list