wiki:AfterSOCWebSetup

Version 2 (modified by anubhav, 11 years ago) ( diff )

--

Reducing Redundant Code in s3cfg.py and 000_config

There has to be a file that will run before s3cfg or even 000_config . So it can be used in init only if there is no 000_config in the models(i.e for the first time)

Initialy in s3cfg2.py

class S3Config(Storage):

    """
    Deployment Settings Helper Class

    """

    def __init__(self, T):
        self.auth = Storage()
        self.base = Storage()
        self.database = Storage()
        self.gis = Storage()
        self.mail = Storage()
        self.twitter = Storage()
        self.L10n = Storage()
        self.osm = Storage()
        self.security = Storage()
        self.ui = Storage()
        self.T = T

Code in the New file

Dict of Settings:- .Algo :-

Settings = {"databse.db_type" : {"nice_name" :T("Database"), 
                                  "description":T("Database Type: "), 
                                  "input_type":"select", 
                                  "options":['sqlite', 'sql', 'mysql'],
                                  "jquery_validation_requirements”: "required lettersonly"
                                 },
             #and similarly other options for language can be set
            } 

for creating s3cfg.py .Algo:-

Note: See TracWiki for help on using the wiki.