On Thu, Apr 09, 2009 at 08:40:12AM -0700, yoheeb wrote:
> 
> On Apr 9, 7:26 am, Jeff Hammel <jham...@openplans.org> wrote:
> > I hope to write an interface, IComputedFieldProvider (or similar), soon 
> > which will fake computed fields with an ITemplateStreamFilter.  A better 
> > solution would be to patch Trac core to do this.  But yeah, its a common 
> > problem and its annoying to do.  See (e.g.) the TracHoursPlugin for an 
> > example of this (field: totalhours).
> >
> > Jeff
> <snip>
> 
> actually, patching trac core to do this, IMHO, is a worse solution.
> That's what the "provider" interfaces are for.    

If you made 'computed' a custom field type, I think this is a big win for Trac. 
 If there was an existing core provider interface to hook into that would be 
ideal, but there isn't :(  My main reason for it being in core is to avoid Yet 
Another Stream Filter.

> In reference to the
> "better solution" comment: I don't think you'd want an
> ITemplateStreamFilter, but promote your solution to something else
> here.  

With existing implementation, I see no choice but to do an 
ITemplateStreamFilter or maybe a IRequestFilter to get the correct data into 
ticket.html.  Of course, this doesn't fix searching and all of the other 
interfaces, so the computed field would have to be computed and cached for all 
requests that will need the field (again, another reason to do in core).

> Although, the solution you are working on has the merits of
> being one of the easier solutions, and might end up being more
> flexible to leverage to other tasks as well.

Flexible?  I'm not sure about.  Easier?  Yeah, that's why I'm doing it ;)

> Either way, I am curious to see your solution if you make it public.

Will do.  Hopefully will be done soon, as I (think I) need it for something 
else I'm working on.

Jeff

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to