yup, that did it! AND... only those tables not in _tables! this is
great! Thanks Massimo! :)

Mart :)

if anyone interested, this empties tables NOT specified in a list:

def deleteRecords():
    _tables=['auth_user',
                'auth_group',
                    'auth_membership',
                        'auth_permisssion',
                            'auth_event',
                                'local_user',
                                    'local_history']
    for tbl in db.tables:
        if not tbl in _tables:emptyTable(tbl)

def emptyTable(tbl):
    for mTbl in db.tables:
        if tbl in mTbl:
            if mTbl.startswith(tbl):db[tbl].truncate()

On Apr 29, 12:12 am, Massimo Di Pierro <massimo.dipie...@gmail.com>
wrote:
> Instead of
>
> db(db[tbl].id>0).delete()
>
> you can use
>
> db[tbl].truncate()
>
> which is faster but does not work on GAE.
>
> On Apr 28, 8:18 pm, mart <msenecal...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> >  I'm thinking this should work... its done through script. Should I be
> > doing it differently?
>
> > thanks,
> > Mart :)
>
> > def deleteRecords():
> >     _tables=['auth_user',
> >                         'auth_group',
> >                             'auth_membership',
> >                                 'auth_permisssion',
> >                                     'auth_event',
> >                                         'local_user',
> >                                             'local_history']
> >     for tbl in db.tables:
> >         if not tbl in _tables:
> >             db(db[tbl].id>0).delete()

Reply via email to