Noah, I'm sorry but I don't understand what you are getting at in this
case. You ask me what I am trying to do, and I say 'I am trying to get
access to the elements of the ticket'. You say 'Yes, but what are you
trying to do?' This confuses me.
So, I don't know what to say. I suppose I could tell you exactly what
ticket field I happen to interested in, and why, but my question is
really just generally how to access any fields of the ticket. If you
don't know, or if my question doesn't make sense, then just say so.
For instance, you could say 'well, there's no such thing as a 'ticket'
per se, so if you tell me what field you want I can tell you where it is
in the ever-mysterious req structure', or something along those lines,
rather than ' .. what are you trying to _do_'.
Anyways, I can't really help asking about implementation details
because, in fact, implementation details are exactly what I want. I want
to get a hold of the values of the ticket, and for that I need
implementation details. Like this, for instance :
try:
tkt = Ticket(self.env, res.id)
except TracError:
return None # Ticket doesn't exist
Ah! There's a ticket constructor in the trac.ticket.model stuff.
Wonderful. I even asked about that import in my first post. Which (I
think) is exactly what I need, and I found it after having spent about 5
hours today, which I couldn't afford, roaming around inside the
implementation details of several plugins.
-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Noah Kantrowitz
Sent: Wednesday, June 17, 2009 11:47 AM
To: [email protected]
Subject: [Trac] Re: access to the ticket array
You are still asking about implementation details. What are you trying
to _do_.
--Noah
On Jun 17, 2009, at 8:14 AM, Dan Winslow wrote:
> I suspect that the ticket{} elements are present in the req, too,
> but as I can't see the structure of req I don't know.
>
> From: [email protected] [mailto:trac-
> [email protected]] On Behalf Of Dan Winslow
> Sent: Wednesday, June 17, 2009 7:31 AM
> To: [email protected]
> Subject: [Trac] Re: access to the ticket array
>
> ...
> Ok, I am trying to access the ticket[] elements. How might I do that?
>
> From: [email protected] [mailto:trac-
> [email protected]] On Behalf Of Noah Kantrowitz
> Sent: Tuesday, June 16, 2009 4:04 PM
> To: [email protected]
> Subject: [Trac] Re: access to the ticket array
>
> Please ask questions about what you actually trying to _do_, not
> specific implementation details.
>
> --Noah
>
> From: [email protected] [mailto:trac-
> [email protected]] On Behalf Of Dan Winslow
> Sent: Tuesday, June 16, 2009 1:52 PM
> To: [email protected]
> Subject: [Trac] access to the ticket array
>
> I am in some plugin source, and I would like to access the ticket[]
> array. It's not available in the class I am in :
>
> class TicketTweaks(Component):
> implements(ITemplateStreamFilter, ITemplateProvider,
> IPermissionRequestor)
>
> I am guessing because it does not do some of this ( from another
> plugin )
>
> from trac.core import *
> from trac.ticket import ITicketManipulator
> from trac.ticket import TicketSystem
>
> class RequiredFieldValidator(Component):
> """Basic ticket validator for required fields"""
>
> implements(ITicketManipulator)
>
> I guess this because the ticket[] array *is* visible in the second
> plugin. Can I just add the import for trac.ticket.TicketSystem? Or
> must I also implement the ITicketManipulator interface?
>
> Dan Winslow
> Director of Information Technology, AIM INSTITUTE
> 1905 Harney Street, Suite 700
> Omaha, NE 68102
> 402-345-5025 x156
> [email protected]
> www.aiminstitute.org
>
>
>
>
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---