Ejemplo n.º 1
0
def chain_info(chain_dict):
    labels = ('project id', 'project name', 'status', 'pending app id')
    l = []
    for chain, (state, project, app) in chain_dict.iteritems():
        status = Chain.state_display(state)
        if state in Chain.PENDING_STATES:
            appid = str(app.id)
        else:
            appid = ""

        t = (chain,
             project.application.name if project else app.name,
             status,
             appid,
             )
        l.append(t)
    return l, labels
Ejemplo n.º 2
0
def chain_info(chain_dict):
    l = []
    for chain, (state, project, app) in chain_dict.iteritems():
        status = Chain.state_display(state)
        if state in Chain.PENDING_STATES:
            appid = str(app.id)
        else:
            appid = ""

        t = (chain,
             project.application.name if project else app.name,
             app.owner.realname,
             app.owner.email,
             status,
             appid,
             )
        l.append(t)
    return l
Ejemplo n.º 3
0
def chain_info(chain_dict):
    labels = ('project id', 'project name', 'status', 'pending app id')
    l = []
    for chain, (state, project, app) in chain_dict.iteritems():
        status = Chain.state_display(state)
        if state in Chain.PENDING_STATES:
            appid = str(app.id)
        else:
            appid = ""

        t = (
            chain,
            project.application.name if project else app.name,
            status,
            appid,
        )
        l.append(t)
    return l, labels
Ejemplo n.º 4
0
def chain_info(chain_dict):
    l = []
    for chain, (state, project, app) in chain_dict.iteritems():
        status = Chain.state_display(state)
        if state in Chain.PENDING_STATES:
            appid = str(app.id)
        else:
            appid = ""

        t = (
            chain,
            project.application.name if project else app.name,
            app.owner.realname,
            app.owner.email,
            status,
            appid,
        )
        l.append(t)
    return l
Ejemplo n.º 5
0
def project_fields(s, project, last_app):
    app = project.application

    d = OrderedDict([
        ('project id', project.id),
        ('application id', app.id),
        ('name', app.name),
        ('status', Chain.state_display(s)),
    ])
    if s in Chain.PENDING_STATES:
        d.update([('pending application', last_app.id)])

    d.update([('owner', app.owner),
              ('applicant', app.applicant),
              ('homepage', app.homepage),
              ('description', app.description),
              ('comments for review', app.comments),
              ('request issue date', app.issue_date),
              ('request start date', app.start_date),
              ('creation date', project.creation_date),
              ('request end date', app.end_date),
              ])

    deact_date = project.deactivation_date
    if deact_date is not None:
        d['deactivation date'] = deact_date

    mem_limit = app.limit_on_members_number
    mem_limit_show = mem_limit if mem_limit is not None else "unlimited"

    d.update([
            ('join policy', app.member_join_policy_display),
            ('leave policy', app.member_leave_policy_display),
            ('max members', mem_limit_show),
            ('total members', project.members_count()),
    ])

    return d
Ejemplo n.º 6
0
def project_fields(s, project, last_app):
    app = project.application

    d = OrderedDict(
        [("project id", project.id), ("application id", app.id), ("name", app.name), ("status", Chain.state_display(s))]
    )
    if s in Chain.PENDING_STATES:
        d.update([("pending application", last_app.id)])

    d.update(
        [
            ("owner", app.owner),
            ("applicant", app.applicant),
            ("homepage", app.homepage),
            ("description", app.description),
            ("comments for review", app.comments),
            ("request issue date", app.issue_date),
            ("request start date", app.start_date),
            ("creation date", project.creation_date),
            ("request end date", app.end_date),
        ]
    )

    deact_date = project.deactivation_date
    if deact_date is not None:
        d["deactivation date"] = deact_date

    mem_limit = app.limit_on_members_number
    mem_limit_show = mem_limit if mem_limit is not None else "unlimited"

    d.update(
        [
            ("join policy", app.member_join_policy_display),
            ("leave policy", app.member_leave_policy_display),
            ("max members", mem_limit_show),
            ("total members", project.members_count()),
        ]
    )

    return d