def setUpClass(cls): super(ApiBaseTest, cls).setUpClass() manage.load_districts() manage.update_functions() rest.db.metadata.create_all( rest.db.engine, tables=[ each.__table__ for each in rest.db.Model._decl_class_registry.values() if hasattr(each, '__table__') ] )
def setUpClass(cls): super(ApiBaseTest, cls).setUpClass() manage.load_districts() manage.update_functions() rest.db.metadata.create_all( rest.db.engine, tables=[ each.__table__ for each in rest.db.Model._decl_class_registry.values() if hasattr(each, '__table__') ])
def setUpClass(cls): super(ApiBaseTest, cls).setUpClass() manage.load_districts() manage.update_functions() whitelist = [models.CandidateCommitteeTotalsPresidential, models.CandidateCommitteeTotalsHouseSenate] rest.db.metadata.create_all( rest.db.engine, tables=[ each.__table__ for each in rest.db.Model._decl_class_registry.values() if hasattr(each, '__table__') and each not in whitelist ] )
def refresh(): """Update incremental aggregates, itemized schedules, materialized views, then email logs to the development team. """ buffer = io.StringIO() with mail.CaptureLogs(manage.logger, buffer): try: manage.update_functions() manage.update_aggregates() manage.refresh_itemized() manage.update_itemized('e') manage.update_schemas() download.clear_bucket() except Exception as error: manage.logger.exception(error) try: mail.send_mail(buffer) except Exception as error: logger.exception(error)
def setUpClass(cls): super(ApiBaseTest, cls).setUpClass() manage.load_districts() manage.update_functions() rest.db.create_all()