Not work in GAE but its better than the other, and i think it has a
problem if month is for example 02 (feb), raise an exception.

On Aug 11, 4:27 pm, mdipierro <[email protected]> wrote:
> d1=datetime.date(year_full,month,1)
> d2=datetime.date(year_full,month,31)
>
> count = db(db.posts.published_on>=d1)
> (db.posts.published_on<=d2).count()
>
> On Aug 11, 1:40 pm, "Martin.Mulone" <[email protected]> wrote:
>
>
>
> > I need to transform this query that works in RDBS to GAE. Both of them
> > are working i check it, but there are a better way, more simpler?.
>
> > RDBS:
> > count = db((db.posts.published_on.year()==year_full) &
> > (db.posts.published_on.month()==month)).count()
>
> > GAE:
> > count = len(db(db.posts.id>0).select().find(lambda
> > row:row.published_on.year==year_full).find(lambda
> > row:row.published_on.month==month))

Reply via email to