Beispiel #1
0
def project2(dbsession, company2, customer2):
    from autonomie.models.project import Project
    project = Project(name=u"Project 2")
    project.company = company2
    project.customers = [customer2]
    dbsession.add(project)
    dbsession.flush()
    return project
Beispiel #2
0
def project(dbsession, company, customer, project_type):
    from autonomie.models.project import Project
    project = Project(name=u"Project", project_type=project_type)
    project.company = company
    project.customers = [customer]
    dbsession.add(project)
    dbsession.flush()
    return project
def project2(dbsession, company2, customer2, project_type):
    from autonomie.models.project import Project
    project = Project(name=u"Project 2", project_type=project_type)
    project.company = company2
    project.customers = [customer2]
    dbsession.add(project)
    dbsession.flush()
    return project
Beispiel #4
0
def add_project(customer, company, project_name, project_code):
    project = Project(name=project_name, code=project_code)
    project.customers.append(customer)
    project.company = company

    session = DBSESSION()
    session.add(project)
    session.flush()

    print u"Added project to %s for %s: %s" % (company.name, customer.name,
                                                            project_name)
    return project
    def func(
        name=u'Project', company=company, customers=[customer],
        project_type=project_type
    ):
        if not hasattr(customers, '__iter__'):
            customers = [customers]

        project = Project(name=u"Project", project_type=project_type)
        project.company = company
        project.customers = customers
        dbsession.add(project)
        dbsession.flush()
        return project
Beispiel #6
0
    def func(name=u'Project',
             company=company,
             customers=[customer],
             project_type=project_type):
        if not hasattr(customers, '__iter__'):
            customers = [customers]

        project = Project(name=u"Project", project_type=project_type)
        project.company = company
        project.customers = customers
        dbsession.add(project)
        dbsession.flush()
        return project