Hi,
I want to make configuration mechanism for web2py applications, just
like .ini files with sections,
but configuration will be saved in the database, so that can be
modified when running on google app engine.


The module is something like this:
class MyApplicationConfiguration(object):
    def __init__(self, db):
        self.db = db
    def define_tables(self):
        db = self.db
        db.define_table('configuration', db.Field('section'), db.Field
('key'), db.Field('val')) #denormalized

In Application:
config = MyApplicationConfiguration(db)

The question is how to make setting and getting like this:
config.section1.key1 = some_value #put in db
v = config.section1.key1 #get from db

I am new to python and web2py.

Than you



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to