On Mon, May 18, 2009 at 8:41 AM, eri x <[email protected]> wrote:
> Hi, i want to take the ticket type inside the __init__ method of a
> plugin(similar to ConfigurableTicketWorkflow) but when i use:
> tipo_ticket=ticket._old.get('type', ticket['type'])
> trac says me that global name ticket is not defined.
> When i use the same command inside the methods of ITicketActionController or
> IEnvironmentSetupParticipant that are in the same class it works.I need
> ticket type in init time but i can't acces the ticket var.

Trac Component __init__ methods don't take any arguments (other than
self).  They are initialized by the ComponentManager, and are
singletons.  Also, it's not a "command".  `ticket` is just a name
given to an object, that may or may not be an instance of
trac.ticket.model.Ticket.

I think maybe you need to study more about Python, and about how Trac
plugins are written (look at existing Trac plugins and the Trac source
itself) before forging ahead.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to