Yes but i think this is gae thing. You try? with max(id) or add some
datetime field and order by this field like Field('created_on',
'datetime',
default=datetime.datetime.today(),writable=False,readable=False)

On 9 sep, 03:06, b vivek <bvivek1...@gmail.com> wrote:
> Ok so if i have a table in my db named homepage as below:-
> ----------------------
> id  | data |
> -----------------------
> 1   | vivek|
> ----------------------
> 2  | andrew|
> -----------------------
>
> Now if I want to retrieve only the last row .. i can do this
> homepage=db().select(db.homepage.ALL,orderby=~db.homepage.id,limitby=(0,1))
>
> Now let me point out that this works prefectly on localhost using the normal
> rdbms like mysql or sqlite. However when I use the local development GAE
> environ or even when I upload it to GAE,it just returns the first row. Seems
> like it totally ignores the tilde.
>
> The same command when used on GAE gives me the first row,rather than the
> last one.
>
> Thanks
> Vivek
>
> On Thu, Sep 9, 2010 at 11:27 AM, Andrew Thompson <andre...@aktzero.com>wrote:
>
>
>
> >  On 9/9/2010 12:24 AM, b vivek wrote:
>
> > Hi I wanted to retrieve the latest data entered in a table and thus used
> > the below syntax for data look up
>
> > homepage=db().select(db.homepage.ALL,orderby=~db.homepage.id
> > ,limitby=(0,1))
>
> >  This is expected to retrieve the last row entered in the table homepage .
> > While this works perfectly, it does not work on GAE. It would be really
> > helpful, if someone could please help me with this..
>
> > While I'm not familiar with GAE, I can say for sure that you've not
> > provided enough information.
>
> > How does it "not work"?
>
> > For example, can you make any .select() work? If you remove the orderby or
> > the limitby does it change how it doesn't work?
>
> > --
> > Andrew Thompsonhttp://aktzero.com/

Reply via email to