예제 #1
0
class PropositionNewSchema(PropositionSchema):
    area_id = int_property(title=_('subject_area'))
    proposition_type_id = int_property(title=_('proposition_type'))
    editing_remarks = string_property(
        title=_('editing_remarks'),
        description=_('editing_remarks_description'),
        missing='',
        validator=Length(max=2000))
class PropositionNoteSchema(Schema):
    proposition_id = int_property(title=_('proposition_id'), missing=None)
    user_id = int_property(title=_('user_id'), missing=None)
    notes = string_property(title=_('notes'),
                            validator=Length(min=0, max=2048),
                            missing=None)
    vote = enum_property(VoteByUser,
                         title=_('vote'),
                         missing=VoteByUser.UNSURE)
예제 #3
0
class BallotSchema(Schema):
    name = string_property(title=_('name'),
                           validator=Length(min=2, max=23),
                           missing='')
    election = int_property(title=_('election_positions'), missing=0)
    result = json_property(title=_('voting_result'), missing={})
    area_id = int_property(title=_('subject_area'), missing=None)
    voting_id = int_property(title=('voting_phase'), missing=None)
    proposition_type_id = int_property(title=('proposition_type'),
                                       missing=None)
class PropositionNewSchema(Schema):
    area_id = int_property(title=_('subject_area'))
    title = string_property(title=_('title'), validator=Length(min=5, max=512))
    external_discussion_url = string_property(
        title=_('external_discussion_url'), validator=colander.url)
    abstract = string_property(title=_('abstract'),
                               validator=Length(min=5, max=2048))
    content = string_property(title=_('content'),
                              validator=Length(min=10, max=65536))
    motivation = string_property(title=_('motivation'), missing='')
    tags = set_property(title=_('tags'), missing=tuple())
    relation_type = string_property(validator=OneOf(['replaces', 'modifies']),
                                    missing=None)
    related_proposition_id = int_property(missing=None)
class VotingPhaseSchema(Schema):
    name = string_property(title=_('name'),
                           validator=Length(min=2, max=23),
                           missing='')
    title = string_property(title=_('title'),
                            validator=Length(min=5, max=140),
                            missing='')
    target = date_property(title=_('target'), missing=None)
    status = enum_property(VotingStatus, title=_('voting_status'))
    department_id = int_property(title=_('department'))
    phase_type_id = int_property(title=_('voting_phase_type'))
    secret = bool_property(title=_('secret_voting_possible'))
    description = string_property(title=_('description'),
                                  validator=Length(min=10, max=65536),
                                  missing='')
class PropositionTypeSchema(Schema):
    name = string_property(title=_('name'), validator=Length(max=64))
    abbreviation = string_property(title=_('abbreviation'),
                                   validator=Length(max=3))
    description = string_property(title=_('description'),
                                  validator=Length(min=10, max=4000),
                                  missing='')
    policy_id = int_property(title=_('policy'))
예제 #7
0
class PolicySchema(Schema):
    name = string_property(title=_('name'), validator=Length(max=64))
    description = string_property(title=_('description'), validator=Length(max=4000), missing='')
    majority = enum_property(Majority, title=_('majority'))
    proposition_expiration = int_property(title=_('proposition_expiration'))
    qualification_minimum = int_property(title=_('qualification_minimum'))
    qualification_quorum = decimal_property(title=_('qualification_quorum'))
    range_max = int_property(title=_('range_max'))
    range_small_max = int_property(title=_('range_small_max'))
    range_small_options = int_property(title=_('range_small_options'))
    secret_minimum = int_property(title=_('secret_minimum'))
    secret_quorum = decimal_property(title=_('secret_quorum'))
    submitter_minimum = int_property(title=_('submitter_minimum'))
    voting_duration = int_property(title=_('voting_duration'))
    voting_system = enum_property(VotingSystem, title=_('voting_system'))
예제 #8
0
class PropositionNewDraftSchema(Schema):
    title = string_property(title=_('title'), validator=Length(min=5, max=255))
    content = string_property(title=_('content'),
                              validator=Length(min=10, max=100_000))
    motivation = string_property(title=_('motivation'),
                                 missing='',
                                 validator=Length(max=100_000))
    tags = set_property(title=_('tags'), missing=tuple())
    abstract = string_property(title=_('abstract'),
                               validator=Length(max=500),
                               missing='')
    editing_remarks = string_property(
        title=_('editing_remarks'),
        description=_('editing_remarks_description'),
        missing='',
        validator=Length(max=2000))
    document_id = int_property()
    section = string_property()
예제 #9
0
class ArgumentForPropositionSchema(ArgumentSchema):
    proposition_id = int_property()
    relation_type = enum_property(ArgumentType)