ah, I thought he was trying to call 'append' on every object. In that case, 
this is what i'd do...

li = x.toLowerCase() for x in leases

but yours solution is probably what he was wanting.

On Thursday, March 8, 2012 5:05:00 PM UTC-7, pbreit wrote:
>
> Oh, wow, that was easy:
>
>      li = [lease.id for lease in leases]
>
>
> On Thursday, March 8, 2012 3:57:09 PM UTC-8, pbreit wrote:
>>
>> I can't seem to figure out how to do this in a one-line with list 
>> comprehension:
>>
>>     li = []
>>     for lease in leases:
>>         li.append(lease.id)
>>
>

Reply via email to