Пример #1
0
    def review(self, id):
        c.streams = Stream.select_values()
        c.proposal = Proposal.find_by_id(id)
        c.signed_in_person = h.signed_in_person()
        c.next_review_id = Proposal.find_next_proposal(c.proposal.id, c.proposal.type.id, c.signed_in_person.id)

        c.review = Review.find_by_proposal_reviewer(id, c.signed_in_person.id, abort_404=False)
        if c.review:
            c.form = 'edit'
            defaults = h.object_to_defaults(c.review, 'review')
            if c.review.score == None:
                defaults['review.score'] = ''
            if c.review.stream_id:
                defaults['review.stream'] = c.review.stream_id

            form = render('/review/edit.mako')
            return htmlfill.render(form, defaults)
        else:
            c.form = 'new'
            return render('/review/new.mako')
Пример #2
0
    def review(self, id):
        c.streams = Stream.select_values()
        c.proposal = Proposal.find_by_id(id)
        c.signed_in_person = h.signed_in_person()
        c.next_review_id = Proposal.find_next_proposal(c.proposal.id, c.proposal.type.id, c.signed_in_person.id)

        c.review = Review.find_by_proposal_reviewer(id, c.signed_in_person.id, abort_404=False)
        if c.review:
            c.form = 'edit'
            defaults = h.object_to_defaults(c.review, 'review')
            if c.review.score == None:
                defaults['review.score'] = ''
            if c.review.stream_id:
                defaults['review.stream'] = c.review.stream_id

            form = render('/review/edit.mako')
            return htmlfill.render(form, defaults)
        else:
            c.form = 'new'
            return render('/review/new.mako')
Пример #3
0
 def _to_python(self, value, state):
     if value in ("", "None", None):
         return None
     else:
         return Stream.find_by_id(value)
Пример #4
0
 def __before__(self, **kwargs):
     c.streams = Stream.select_values()
Пример #5
0
 def _to_python(self, value, state):
     if value in ("", "None", None):
         return None
     else:
         return Stream.find_by_id(value)
Пример #6
0
 def __before__(self, **kwargs):
     c.streams = Stream.select_values()