On Fri, Feb 11, 2011 at 9:19 PM, Shawn Milochik wrote:
> On Fri, Feb 11, 2011 at 4:15 PM, Tom Evans wrote:
>>
>> Have a read of this:
>>
>> http://www.secnetix.de/olli/Python/lambda_functions.hawk
>>
>
> That's funny -- I did a quick Google search and that's one I found
> also. I chose to give a
On Fri, Feb 11, 2011 at 4:15 PM, Tom Evans wrote:
>
> Have a read of this:
>
> http://www.secnetix.de/olli/Python/lambda_functions.hawk
>
That's funny -- I did a quick Google search and that's one I found
also. I chose to give a quick sample instead of sending the link
because I thought an exampl
On Fri, Feb 11, 2011 at 9:06 PM, kyleduncan wrote:
> I dont understand what the x is, but thank you so much for fixing this
> for me in a matter of minutes!
Have a read of this:
http://www.secnetix.de/olli/Python/lambda_functions.hawk
Cheers
Tom
--
You received this message because you are s
On Fri, Feb 11, 2011 at 4:06 PM, kyleduncan wrote:
> I dont understand what the x is, but thank you so much for fixing this
> for me in a matter of minutes!
>
You're welcome.
The 'key' kwarg to the sort function expects a value. Instead of
giving it a single value, you can pass a function.
So,
this seems to work:
results = sorted(results, key=lambda x: x.user.last_login,
reverse=True)
I dont understand what the x is, but thank you so much for fixing this
for me in a matter of minutes!
On Feb 11, 8:36 pm, Shawn Milochik wrote:
> Something like this:
>
> key = lambda x: x.last_login
-
On Fri, Feb 11, 2011 at 3:59 PM, kyleduncan wrote:
> Thank you! Not sure how to work it just yet though. do I replace x
> with user? i tried this:
>
> results = results.sort(key=lambda x: x.last_login, reverse=True)
>
> and got an error that the Profile object didn't have the attribute
> last_lo
Thank you! Not sure how to work it just yet though. do I replace x
with user? i tried this:
results = results.sort(key=lambda x: x.last_login, reverse=True)
and got an error that the Profile object didn't have the attribute
last_login
On Feb 11, 8:36 pm, Shawn Milochik wrote:
> Something like
Something like this:
key = lambda x: x.last_login
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@google
Hi, I have the following code:
results = list(results.filter(**location_distance_kwargs))
for trip in possible_trips:
try:
trip = Trip.objects.get(id=trip.id, **trip_kwargs)
profile = Profile.objects.get(user=trip.user)
if profile not in results:
results.ap
9 matches
Mail list logo