On Thu, Jan 12, 2012 at 10:57 AM, Chris Nelson <[email protected]>wrote:

> ticketsByID[t['id']] = t.values.copy()
>>
>

> Which gives me:
> AttributeError: 'builtin_function_or_method' object has no attribute 'copy'


The error message is telling you that ``t.values`` is a function.  So you
need to call it to get a copyable data structure:

t.values().copy()

Based on that, it looks like ``t`` may already be a dict instead of a trac
Ticket object.  (Probably it's the result of accessing ticket.values
somewhere.)  If so you can create a copy of the dict by simply saying
``t.copy()`` or ``dict(t)`` (the latter is idiomatic)

To double check you might want to throw in a ``import pdb;
pdb.set_trace()`` in your code and check ``type(t)`` to make sure the
object is what you think it is.

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