[Grok-dev] Grok 1.0 final?

Martijn Faassen faassen at startifact.com
Wed Apr 15 10:59:10 EDT 2009


Martin Aspeli wrote:
> Martijn Faassen wrote:
>> Hey,
>>
>> Martin Aspeli wrote:
>> [snip]
>>> Actually, I wouldn't name it after the context, I'd name it after the 
>>> module + class name. The idea is that in my source code browser, I see 
>>> mytype.py and templates/mytype_view.pt. It's obvious that this matches 
>>> mytype.py:View. If I had an Edit view in mytype.py, I'd see 
>>> templates/mytype_edit.pt and so on.
>> Good point, that's much simpler, view module name + view class name.
> 
> Can I also ask: I'm fairly confused by the whole 
> default_namespace/namespace dance. Is there an actual use case for that?

Ah, in template pluggability? The idea is that the default_namespace() 
function is defined by the base template implementation. Viewlets offer 
a different implementation that pushes the `viewletmanager`` and 
``viewlet`` objects into the template.

namespace() is if a particular template wants to control what enters the 
namespace of the template.

I think it's quite possible we could improve this code by some judicious 
refactoring, but I do think there are use cases for control of template 
namespaces.

Regards,

Martijn



More information about the Grok-dev mailing list