コード例 #1
0
def read_PlatformConfig(project_id, RepositoryCategoryId):
    session = database.get_session()
    modulerelationprofile = session.query(RepositoryProfile).filter(
        RepositoryProfile.ProjectId == project_id,
        RepositoryProfile.RepositoryCategoryId == RepositoryCategoryId).one()
    session.close()
    return modulerelationprofile
コード例 #2
0
def query_repository():

    session = database.get_session()

    list = session.query(Repository).all()
    session.close()
    return list
コード例 #3
0
def query_repositoryprofile(project_id):

    session = database.get_session()

    list = session.query(RepositoryProfile).filter(
        RepositoryProfile.ProjectId == project_id)
    session.close()
    return list
コード例 #4
0
def get_repositoryprofile(repositorycategory_id):

    session = database.get_session()

    list = session.query(RepositoryProfile).filter(
        RepositoryProfile.RepositoryCategoryId == repositorycategory_id)
    session.close()
    return list
コード例 #5
0
def remove_Repository(repository_id):

    session = database.get_session()

    #     r1 = session.query(RepositoryProfile).filter(RepositoryProfile.RepositoryId == repository_id).delete()
    r2 = session.query(Repository).filter(
        Repository.RepositoryId == repository_id).delete()
    session.commit()
    session.close()
コード例 #6
0
def get(repository_id):

    session = database.get_session()

    r = session.query(Repository).filter(
        Repository.RepositoryId == repository_id).one()

    session.close()
    return r
コード例 #7
0
def exist_repository(repositoryname):
    session = database.get_session()

    c = session.query(Repository).filter(
        Repository.RepositoryName == repositoryname).count()

    session.close()

    return c > 0
コード例 #8
0
def exist_repositoryprofile(project_id, repositorycategory_name):
    session = database.get_session()

    c = session.query(RepositoryProfile).filter(
        RepositoryProfile.RepositoryCategoryName == repositorycategory_name,
        RepositoryProfile.ProjectId == project_id).count()

    session.close()

    return c > 0
コード例 #9
0
def create_repository(repositoryname):
    session = database.get_session()

    c = Repository()
    c.RepositoryName = repositoryname.strip()
    #    c.Status = IssueCategoryStatus.Enabled

    session.add(c)

    session.commit()
    session.close()
コード例 #10
0
def create_repositoryprofile(project_id, repositorycategory_name):
    session = database.get_session()
    r = RepositoryProfile()
    repositorycategory_name = repositorycategory_name.strip()
    r.ProjectId = project_id
    r.RepositoryCategoryName = repositorycategory_name
    r.CMPlatform = ''
    r.CIPlatform = ''
    r.ReposPlatform = ''
    session.add(r)
    session.commit()
    session.close()
コード例 #11
0
def remove_RepositoryCategory(project_id, repositoryCategory_id):

    session = database.get_session()

    list = session.query(RepositoryProfile).filter(
        RepositoryProfile.ProjectId == project_id,
        RepositoryProfile.RepositoryCategoryId ==
        repositoryCategory_id).delete()
    session.commit()
    session.close()

    return list
コード例 #12
0
def update_PlatformConfig(repositoryCategory_id, CMPlatform, CIPlatform,
                          ReposPlatform):
    session = database.get_session()
    Platformlist = session.query(RepositoryProfile).filter(
        RepositoryProfile.RepositoryCategoryId ==
        repositoryCategory_id).update({
            'CMPlatform': CMPlatform,
            'CIPlatform': CIPlatform,
            'ReposPlatform': ReposPlatform
        })
    session.commit()
    session.close()

    return Platformlist