On Thu, Jun 18, 2009 at 11:01 AM, Dan Winslow<[email protected]> wrote: > In plugin code, I am trying to access the value of the ‘owner’ field. Can > anyone guide me on how to do this? My latest attempt is > > > > from trac.ticket.model import Ticket > > … > > try: > > tkt = Ticket(self.env, res.id) > > except TracError: > > return None # Ticket doesn't exist > > disabled = True > > > > which almost works….except at runtime it says that ‘NameError: global name > 'res' is not defined’. The ‘res’ is not currently passed into the method I > am in > > ( def filter_stream(self, req, method, filename, stream, data): ). > > > > If there’s a better way, in code, to obtain the value of the current ticket > ‘owner’, please let me know.
Ah...after a close look, this provides just enough context (more than your previous post) to divine what you're trying to do. Assuming that you're filtering on the ticket page (filename=='ticket.html') you want data['ticket']. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Users" 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-users?hl=en -~----------~----~----~----~------~----~------~--~---
