[web2py] Re: Python and Web2py dictionary behavior

2011-06-14 Thread mart
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

[web2py] Re: Python and Web2py dictionary behavior

2011-06-14 Thread pbreit
Cool, thanks. I look forward to taking a look.

[web2py] Re: Python and Web2py dictionary behavior

2011-06-13 Thread Ross Peoples
I make heavy use of Storage in my apps because dot notation is so much easier and faster. It is completely backwards compatible with Python's dictionary. I usually end up putting this at the top of all my controllers and modules: from gluon.storage import Storage Then instead of using a

[web2py] Re: Python and Web2py dictionary behavior

2011-06-13 Thread mart
there are many variations and combined functionality that we can do with these dicts with attribute like functionality... below is an example of one that lets you do the dot thing on copies of a dict (comes in vary handy at times) and uses cPickle (can send usage if unclear) something else very

[web2py] Re: Python and Web2py dictionary behavior

2011-06-13 Thread pbreit
I'd be curious to see your XML processing code. Manipulating XML in Python is pretty lame form what' I've seen so far.

[web2py] Re: Python and Web2py dictionary behavior

2011-06-13 Thread mart
be glad to... and I will freely admit to being dense :), but... I don't know how to attach it here ;) Is there a trick? or if you send me your email, I'll send with a usage sample. Mart :) On Jun 13, 9:48 pm, pbreit pbreitenb...@gmail.com wrote: I'd be curious to see your XML processing code.

[web2py] Re: Python and Web2py dictionary behavior

2011-06-13 Thread Anthony
On Monday, June 13, 2011 10:16:15 PM UTC-4, mart wrote: be glad to... and I will freely admit to being dense :), but... I don't know how to attach it here ;) Is there a trick? or if you send me your email, I'll send with a usage sample. If you use the newer forum interface at

[web2py] Re: Python and Web2py dictionary behavior

2011-06-13 Thread mart
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

[web2py] Re: Python and Web2py dictionary behavior

2011-06-12 Thread pbreit
I think this might be the best way to do it: my_dict.get(key, value_if_absent)

[web2py] Re: Python and Web2py dictionary behavior

2011-06-12 Thread Anthony
It's the gluon.storage.Storage class -- explained here: http://web2py.com/book/default/chapter/04#request. You can probably use it in a module by importing it. On Sunday, June 12, 2011 2:41:44 AM UTC-4, pbreit wrote: I am newish to Python and I think spoiled by Web2py. Is it correct that