~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/translations/interfaces/translationrelicensingagreement.py

[r=sinzui][bug=855670] Add additional checks to the private team
        launchpad.LimitedView security adaptor so more users in defined
        roles can see the team.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2009 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
from lazr.enum import (
 
5
    EnumeratedType,
 
6
    Item,
 
7
    )
 
8
from zope.interface import Interface
 
9
from zope.schema import (
 
10
    Bool,
 
11
    Choice,
 
12
    Datetime,
 
13
    Int,
 
14
    Object,
 
15
    Text,
 
16
    )
 
17
 
 
18
from canonical.launchpad import _
 
19
from lp.registry.interfaces.person import IPerson
 
20
 
 
21
 
 
22
__metaclass__ = type
 
23
__all__ = [
 
24
    'ITranslationRelicensingAgreement',
 
25
    'ITranslationRelicensingAgreementEdit',
 
26
    'TranslationRelicensingAgreementOptions'
 
27
    ]
 
28
 
 
29
 
 
30
class ITranslationRelicensingAgreement(Interface):
 
31
    """An agreement to relicensing a person's translations."""
 
32
 
 
33
    id = Int(
 
34
        title=_("The ID for this relicensing answer"),
 
35
        readonly=True, required=True)
 
36
 
 
37
    person = Object(
 
38
        title=_("The person who responded to the relicensing question"),
 
39
        readonly=False, required=True, schema=IPerson)
 
40
 
 
41
    allow_relicensing = Bool(
 
42
        title=_("Whether the person agreed to the BSD license"),
 
43
        readonly=False, default=True, required=True)
 
44
 
 
45
    date_decided = Datetime(
 
46
        title=_("The date person made her decision"),
 
47
        readonly=True, required=True)
 
48
 
 
49
 
 
50
class TranslationRelicensingAgreementOptions(EnumeratedType):
 
51
    BSD = Item("License all my translations in Launchpad "
 
52
               "under the BSD license")
 
53
    REMOVE = Item("Not make translations in Launchpad")
 
54
 
 
55
 
 
56
class ITranslationRelicensingAgreementEdit(ITranslationRelicensingAgreement):
 
57
    """Extend ITranslationRelicensingAgreement with `back_to` field."""
 
58
 
 
59
    back_to = Text(
 
60
        title=_("URL to go back to after question is shown"),
 
61
        readonly=False, required=False)
 
62
 
 
63
    allow_relicensing = Choice(
 
64
        title=_("I would rather"),
 
65
        vocabulary=TranslationRelicensingAgreementOptions,
 
66
        required=True)