11
11
'IQuestionMessage',
14
from zope.interface import Interface
14
15
from zope.schema import (
21
from lazr.restful.declarations import (
22
export_as_webservice_entry,
25
from lazr.restful.fields import Reference
21
27
from canonical.launchpad import _
22
from canonical.launchpad.interfaces.message import IMessage
28
from lp.services.messages.interfaces.message import IMessage
23
29
from lp.answers.enums import (
32
38
It adds attributes to the IMessage interface.
40
export_as_webservice_entry(as_of='devel')
34
42
# This is really an Object field with schema=IQuestion, but that
35
43
# would create a circular dependency between IQuestion
36
44
# and IQuestionMessage
38
title=_("The question related to this message."),
39
description=_("An IQuestion object."), required=True, readonly=True)
45
question = exported(Reference(
46
title=_("The question related to this message."), schema=Interface,
47
description=_("An IQuestion object."), required=True, readonly=True),
49
action = exported(Choice(
42
50
title=_("Action operated on the question by this message."),
43
51
required=True, readonly=True, default=QuestionAction.COMMENT,
44
vocabulary=QuestionAction)
52
vocabulary=QuestionAction),
54
new_status = exported(Choice(
47
55
title=_("Question status after message"),
48
56
description=_("The status of the question after the transition "
49
57
"related the action operated by this message."), required=True,
50
58
readonly=True, default=QuestionStatus.OPEN,
51
vocabulary=QuestionStatus)
59
vocabulary=QuestionStatus),
53
62
title=_("Message index."),
54
description=_("The messages index in the question's list of "
63
description=_("The messages 0-index in the question's list of "
66
display_index = exported(Int(
67
title=_("Human readable Message index."),
68
description=_("The message's index in the question's list of "
70
readonly=True), exported_as='index')
71
visible = exported(Bool(
58
72
title=_("Message visibility."),
59
73
description=_("Whether or not the message is visible."),