[Grok-dev] Grokker to remove development code?

Martijn Faassen faassen at startifact.com
Wed Dec 3 13:55:56 EST 2008


Sebastian Ware wrote:
> I often have the odd class here and there that is mainly intended for  
> development purposes. It would be great if I could mark them somehow  
> in order to exclude them from being registered on the production server.
> 
> Could this be easily achieved with a custom grokker?
> 
> Is there any other best practice for this use case?

What we *should* do is extend martian so we can tag our classes:

class MyView(grok.View):
     grok.tag('dev')

and then have a way to run the application with different profiles that 
include or exclude particular tags. For starters we could extend the 
grok:grok directive with tag_exclude and tag_include attributes:

<grok:grok package="." tag_exclude="dev">

though I think it's important to be able to configure this at a higher 
level, so that common tags can be used across packages and excluded and 
included.

Regards,

Martijn



More information about the Grok-dev mailing list