Matt Good wrote:
> On Mar 18, 4:10 pm, Peter Dimov <[EMAIL PROTECTED]> wrote:
>
>> I was thinking, wouldn't it be nice, simple and straightforward to pass
>> python objects rather than dictionaries to the template engine.
>>
>
> The ticket and wiki pages already do this.
>
>
>> Let's take for example the changeset page, which contains a title, a
>> message, other properties and a list of file changes. A file change is
>> between two nodes and has a type attribute and a list of content
>> changes. The nodes have their own attributes like path and revision. The
>> template file would know this structure and would know how to represent
>> the objects as html content.
>>
>
> Yeah, the logic for displaying changesets is a bit complex and could
> probably use some clean up, though I'd be cautious about trying to
> move all of it into the template, since this may make parts of it more
> complicated and hard to read than straight Python. However, if you'd
> be willing to submit a patch starting some refactoring on this I'm
> sure one of the devs will take a look.
>
The migration to Genshi retained a good part of the original "HDF"
compatible data structure needed to fill Clearsilver templates. Existing
objects were reused when possible, but no new classes were created,
rather dictionaries and lists where kept. Now we should maybe start to
create such intermediate objects more liberally, especially since
[genshi 510], as that would help to get default/missing values right (by
setting them to None in the constructor). That would be preferable to
all the defined('...') or get('...') calls introduced in the templates.
-- Christian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---