Example #1
0
    def add_institute(self, internal_id, display_name):
        """Add a institute to the database

            Args:
                internal_id(str): The internal id (like cust003)
                display_name(str): The display name for a institute (like CMMS)
        """
        logger.info("Creating institute with internal_id: {0} and"\
                    " display_name: {1}".format(internal_id, display_name))
        institute = Institute(
            internal_id=internal_id,
            display_name=display_name
        )
        institute.save()
Example #2
0
def get_institute(request):
    print('')
    logger.info("setup a institute")
    institute = Institute(
        internal_id='cust000',
        display_name='clinical'
    )
    logger.info("Adding institute to database")
    institute.save()
    def teardown():
        print('\n')
        logger.info('Removing institute')
        institute.delete()
        logger.info('Institute removed')
    request.addfinalizer(teardown)
    
    return institute