On Fri, Mar 4, 2011 at 8:40 PM, Sidney Cadot wrote:
> Hi Tom,
>
>> Unless I'm being dense, you cannot represent this as a single SQL
>> query, so logically you cannot represent this as a QuerySet.
>
> It is possible by using a nested query, e.g.
>
> SELECT * FROM (SELECT * FROM some_table ORDER BY
On Fri, 4 Mar 2011 21:40:36 +0100, Sidney Cadot wrote:
Hi Sidney,
> It is possible by using a nested query, e.g.
>
> SELECT * FROM (SELECT * FROM some_table ORDER BY timestamp DESC LIMIT 10)
> ORDER BY timestamp ASC;
Nice, but it doesn't make sense. It makes everything harder to
understand. Reve
Hi Tom,
> Unless I'm being dense, you cannot represent this as a single SQL
> query, so logically you cannot represent this as a QuerySet.
It is possible by using a nested query, e.g.
SELECT * FROM (SELECT * FROM some_table ORDER BY timestamp DESC LIMIT 10)
ORDER BY timestamp ASC;
But I suppose
On Fri, Mar 4, 2011 at 4:06 PM, reddish wrote:
> Hi,
>
> I have trouble getting a QuerySet to do what I want. I need to select
> the last 10 items of a certain model (ordered by timestamp; so the
> "most recent" 10 items), and when I iterate over them during template
> processing I want the earlie
Hi,
I have trouble getting a QuerySet to do what I want. I need to select
the last 10 items of a certain model (ordered by timestamp; so the
"most recent" 10 items), and when I iterate over them during template
processing I want the earliest item (with the oldest timestamp) to
come first.
I've tr
5 matches
Mail list logo