also, here's a little example of usage of the blueDict class (above in
this thread). I use DAL in script. I have a table called 'data' which
has fields called 'pyModuleName' and 'cmdName'. I can use the dict
object to store the pyModuleName values and the cmdName values in one
of those dict objects.
def getCmdNames():
cmdDict=_pickledDict.blueDict()
rows=db(db.data.id>0).select()
if rows:
for row in rows:
if row.cmdName:cmdDict[row.pyModuleName]\
=row.cmdName
return cmdDict
def genreportsFromDB():
cmds=getCmdNames()
for name in cmds.keys():
print 'cmd name : {0}\t{1}'.format(name,cmds[name])
dir=db(db.cumulativeProperties.name=='reports_directory').select().last()
if dir:
reportsDir=dir.value
print('reports_directory: {0}'.format(reportsDir))
else:
print('could not retrieve data DB...')
blablabla............
On Jun 13, 11:18 pm, mart <[email protected]> wrote:
> well, well,... look at this! this is new to me! :)
>
> so, you can dump the 3 attached files somewhere and run dfoTest.py and check
> the output (a few comments in the script and some in the _dfo module). I
> through in an xml file just for quick testing.
>
> I have quite a few variations on this (some has lots of web2py stuff in it
> that plays nice with dal.py - which is very useful for me (i think I use DAL
> everywhere now ;) )
>
> anyways, let me know if anything unclear.
>
> Mart :)
>
> _dfo.py
> 4KViewDownload
>
> brewmp_29.xml
> 3KViewDownload
>
> dfoTest.py
> 1KViewDownload