The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From: Daniel Poelzleithner <goo...@poelzi.org>
Date: Thu, 03 Aug 2006 20:15:20 +0200
Local: Thurs, Aug 3 2006 2:15 pm
Subject: flat values() in querysets
Hi,
Currently it's kinda verbose to get just a list of id's from a query to example: >>> NetworkState.objects.all().order_by("-stopdate")[:5].values("id") [{'id': 2738}, {'id': 2737}, {'id': 2736}, {'id': 2735}, {'id': 2734}] Then i have to unpack it to get a [2738, 2737,...] list, which is what I I suggest Object.objects.all().values("id", flat=True). Flat as a Any better ideas ? kindly regards You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||