And what is the URL of the ticket when you access it using the web UI?

Modifying your url to something similar to /products/%40/api/ticket/1
should solve your problem. (I can give you the exact url after you
provide me the bloodhound ticket url).

On Wed, Jun 26, 2013 at 4:43 PM, Antonia Horincar
<[email protected]> wrote:
> I'm accessing the method with /api/ticket/1.
>
> On Wed, Jun 26, 2013 at 5:25 PM, Anze Staric <[email protected]> wrote:
>> What URL do you use to access your API method?
>>
>> On Wed, Jun 26, 2013 at 4:14 PM, Antonia Horincar
>> <[email protected]> wrote:
>>> Hi Pranay,
>>>
>>> Thanks for the link, I had a look at it yesterday, but unfortunately
>>> it doesn't help me with the error.
>>>
>>> I'm still not sure what's causing this error to come up every time I
>>> try to access a ticket through my API. The ticket exists, I checked
>>> this in the Python interpreter. I am suspecting that the problem might
>>> be caused by the environment, but don't know why or how to solve it. I
>>> have 'forced' the API to use the "bloodhound/environments/main"
>>> environment by writing
>>> env = trac.env.Environment("bloodhound/environments/main")
>>> in the process_request method (I only did this so that maybe I could
>>> see what's causing the error).
>>> After doing this, I tried to access the ticket again and the error was
>>> KeyError: 'author_id', and this made me think that maybe the
>>> application runs on a different environment that the one I forced my
>>> API to run on. I'm definitely not sure if this is the problem. I will
>>> continue to try to solve this, but I am stuck for now. If anyone has
>>> the slightest idea on what could be the problem, that would be more
>>> than welcome.
>>>
>>> Thanks,
>>> Antonia
>>>
>>> On Wed, Jun 26, 2013 at 1:29 AM, Pranay B. Sodre
>>> <[email protected]> wrote:
>>>> Antonia- I am trying to understand this Ticket field myself. The place I am
>>>> looking at to fully understand how this is structured is listed below. The
>>>> structure is based on code written here
>>>> http://trac.edgewall.org/browser/branches/1.0-stable/trac/ticket/model.py?rev=11830
>>>>
>>>> Look at line 120. I am not sure if this will answer your question, but it a
>>>> place to look.
>>>>
>>>> Pranay B.
>>>>
>>>> "He is richest who is content with the least, for content is the wealth of
>>>> nature."-
>>>>
>>>> Socrates
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On 25 June 2013 14:31, Antonia Horincar <[email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I made a basic template for displaying ticket information when
>>>>> accessing a certain path, but I am having trouble with processing the
>>>>> ticket. It gives me an error "Ticket <id> does not exist" even though
>>>>> there is a ticket with the id that I entered. What I did in my api,
>>>>> after matching the request, in the process_request method was
>>>>> something like this:
>>>>> data = {'ticket': model.Ticket(self.env, ticket_id)}, where ticket_id
>>>>> is the id of the req argument.
>>>>>
>>>>> I have checked if the matching does indeed find the correct id, and it
>>>>> does. I have looked through the other Bloodhound APIs but I found no
>>>>> clue that could help me determine the cause of my error. If anyone
>>>>> encountered this error before and knows what might be causing it, can
>>>>> you please help me? I might be missing something or I might have
>>>>> misunderstood some concepts.
>>>>>
>>>>> Thanks,
>>>>> Antonia
>>>>>

Reply via email to