Ejemplo n.º 1
0
    def setup(self):
        '''Reset the database and clear the search indexes.'''
        super(TestEventShowAuth, self).setup()

        # set up lacounts tables
        if not tables_exist():
            create_tables()
Ejemplo n.º 2
0
    def init_db(self):

        if tables_exist():
            print(u'Get Involved tables already exist')
            sys.exit(1)

        create_tables()

        print(u'Get Involved tables created')
Ejemplo n.º 3
0
    def update_config(self, config_):
        if not tables_exist():
            log.critical(u'''
The lacounts extension requires database initialization. Please run the
following to create the database tables:
    paster --plugin=ckanext-lacounts get_involved init-db
''')
        else:
            log.debug(u'LA Counts "Get Involved" tables exist')

        toolkit.add_template_directory(config_, 'templates')
        toolkit.add_public_directory(config_, 'public')
        toolkit.add_resource('fanstatic', 'lacounts')
        toolkit.add_ckan_admin_tab(config_, 'getinvolved_admin',
                                   'Get Involved')