[Grok-dev] Re: proposal: grok.title() and grok.description()

Wichert Akkerman wichert at wiggy.net
Sun Sep 2 11:59:04 EDT 2007


Previously Tres Seaver wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Martijn Faassen wrote:
> > Hi there,
> > 
> > Inspired by Tres's idea of grok.describe(), I'd like to propose two new 
> > grok directives:
> > 
> > grok.title()
> > 
> > and
> > 
> > grok.description()
> > 
> > The arguments to both is a unicode string or a message id: human 
> > readable text.
> 
> Can we stay with the grokkish convention that ASCII strings are alllowed
> as well?  I *hate* the dead chicken of the leading 'u'.
> 
> > These directives should be usable on just about any class, ranging from 
> > Model to View to Permission.
> > 
> > The idea is then that an application's user interface can access this 
> > data (this means we need to come up with a good API to access this kind 
> > of grok-defined attribute in the grok module. Anyone have any ideas?). 
> 
> How about assigning '__doc__' on the object ;)?  Actually, one might
> hack the directives so that they *returned* the values when passed a
> non-basestring / message ID object.

Perhaps the first line of __doc__ would make a decent default title as
well.

Wichert.

-- 
Wichert Akkerman <wichert at wiggy.net>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.


More information about the Grok-dev mailing list