[Grok-dev] url() method on JSON component

Martijn Faassen faassen at startifact.com
Tue Nov 3 11:36:13 EST 2009


Hey,

Jan-Wijbrand Kolman wrote:

> Proposal:
> 
> Not only the url() method is useful for JSON (and maybe even the REST) 
> components, but so are the application_url() method and the response 
> property.

I think certainly we need them for the REST components too. It's very 
common one wants to generate a URL when writing a RESTful protocol.

> The url() method and the response property is defined in 
> grokcore.view.View. We could split out these into a seperate baseclass. 
> grokcore.view.View will then inherit from this baseclass.
> 
> In grok we will define a mixin class derived from this baseclass that 
> adds the application_url() method. The JSON and REST components can then 
> inherit from this mixin class.

Sounds reasonable. We practically have that mixin class already in the 
form of components.View in grok. The only differences are that it's a 
mixin and doesn't have the flash() method.

Regards,

Martijn



More information about the Grok-dev mailing list