preferences.py 1.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
""" preferences

"""
if db(db.preferences).count() != 3:

    if not db(db.preferences.property == "authorize_harvester_scan").select():
        db.preferences.insert(property='authorize_harvester_scan',
                              definition=T("Harvesters are ran automatically "
                                           "when the value is equal to true."))

    if not db(db.preferences.property == "authorize_user_login").select():
        db.preferences.insert(property="authorize_user_login",
                              definition=T("Users can login when the value is "
                                           "equal to true."))

    if not db(db.preferences.property == "harvester_start_year").select():
        db.preferences.insert(property="harvester_start_year",
                              definition=T("Define the range of years in which "
                                           "the harvesters can be ran. "
                                           "It starts with the given value and "
                                           "ends with the current year."))