On Apr 12, 10:06 pm, mart <[email protected]> wrote:
> Just tried this:
>
> test = db(db.cumulativeProperties.id>0).select(limitby=(0,1))
> print 'test: {0}'.format(test)
>
> results:
> cumulativeProperties.id,cumulativeProperties.uuid,cumulativeProperties.name 
> ,cumulativeProperties.value,cumulativeProperties.tag,cumulativeProperties.c 
> mdName
> 1,365674dc-6371-4215-ad44-c35b5f6159bf,ftp_user,nmcbuild,<NULL>,None
>
> perfect!!!! :) and the bonus, makes it easy and quick to test if
> individual fields have content as well just by looping through results
> and doing dict(testItems).keys(). If a given field has value,it can
> also indicate a met or unmet condition.
>
> question: if i do the this, i get a 'update_record' in the returned
> list, does that indicate that something has in fact updated the
> record?

no the record was not touched

> and would 'isempty' be a shortcut for ...select(limitby=(0,1) and
> return the same data?
>
> thanks,
> Mart :)
>
> On Apr 12, 5:11 pm, Massimo Di Pierro <[email protected]>
> wrote:
>
>
>
>
>
>
>
> > may be faster to do
>
> > db(db.tablename.id>0).select(limitby=(0,1))
>
> > perhaps we should have something like:
>
> > db(db.tablename).isempty()
>
> > On Apr 12, 12:02 pm, Marin Pranjic <[email protected]> wrote:
>
> > > Something like db(db.tablename.id>0).count() ?
>
> > > On Tue, Apr 12, 2011 at 5:22 PM, mart <[email protected]> wrote:
> > > > Hi,
>
> > > > is there a shortcut  to check if a table is empty? (not look to see
> > > > what the content is, just if it has any at all)
>
> > > > Thanks,
> > > > Mart :)

Reply via email to