On 01/12/2012 11:07 AM, Ethan Jucovy wrote:
On Thu, Jan 12, 2012 at 10:57 AM, Chris Nelson <[email protected]
<mailto:[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()
Which doesn't work because t.values() returns a list which doesn't have
a copy function. So I do
copy.copy(t.values())
only to find out that that gives me a list of raw values without keys
which makes it rather useless to me.
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.)
No, I've never done that; didn't know of Ticket.values() until today.
> If so you can create a copy of the dict by simply saying
``t.copy()`` or ``dict(t)`` (the latter is idiomatic)
--
Christopher Nelson, Software Engineering Manager
SIXNET - Solutions for Your Industrial Networking Challenges
331 Ushers Road, Ballston Lake, NY 12019
Tel: +1.518.877.5173, Fax: +1.518.877.8346 www.sixnet.com
--
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.