l.a.i.w.IQuestion(IHasOwner) : interface documentation

Part of lp.answers.interfaces.webservice View In Hierarchy

A single question, often a support request.
Choice priority Undocumented
Choice product Select the upstream project with which you need support.
Choice distribution Select the distribution for which you need support.
Choice sourcepackagename The source package in the distribution which contains the software with which you are experiencing difficulties.
Text whiteboard Up-to-date notes on the status of the question.
Object faq The FAQ document containing the long answer to this question.
Attribute subscriptions The set of subscriptions to this question.
Attribute reopenings Records of times when this question was reopened.
Method setStatus Change the status of this question.
Attribute can_request_info Whether the question is in a state where a user can request more information from the question owner.
Method requestInfo Request more information from the question owner.
Attribute can_give_info Whether the question is in a state where the question owner can give more information on the question.
Method giveInfo Reply to the information request.
Attribute can_give_answer Whether the question is in a state a user can provide an answer on the question.
Method giveAnswer Give an answer to this question.
Method linkFAQ Link a FAQ as an answer to this question.
Attribute can_confirm_answer Whether the question is in a state for the question owner to confirm that an answer solved their problem.
Method confirmAnswer Confirm that a solution to the question was found.
Method canReject Test if a user can reject the question.
Method reject Mark this question as INVALID.
Method expireQuestion Mark a question as EXPIRED.
Attribute can_reopen Whether the question state is a state where the question owner could reopen it.
Method reopen Reopen a question that was ANSWERED, EXPIRED or SOLVED.
Method addComment Add a comment on the question.
Method subscribe Subscribe person to the question.
Method isSubscribed Return a boolean indicating whether the person is subscribed.
Method unsubscribe Unsubscribe person from the question.
Method getDirectSubscribers Return the persons who are subscribed to this question.
Method getDirectSubscribersWithDetails Get direct subscribers and their subscriptions for the question.
Method getIndirectSubscribers Return the persons who are implicitly subscribed to this question.
Method getRecipients Return the set of person to notify about changes in this question.
Attribute direct_recipients Return An INotificationRecipientSet containing the persons to notify along the rationale for doing so.
Attribute indirect_recipients Return the INotificationRecipientSet of answer contacts for the question's target as well as the question's assignee.
Method setCommentVisibility Set the visible attribute on a question message.

Inherited from IHasOwner:

Attribute owner The object's owner, which is an IPerson.
priority =
Undocumented
product =
Select the upstream project with which you need support.
distribution =
Select the distribution for which you need support.
sourcepackagename =
The source package in the distribution which contains the software with which you are experiencing difficulties.
whiteboard =
Up-to-date notes on the status of the question.
faq =
The FAQ document containing the long answer to this question.
subscriptions =
The set of subscriptions to this question.
reopenings =
Records of times when this question was reopened.
def setStatus(user, new_status, comment, datecreated=None):
Change the status of this question.

Set the question's status to new_status and add an IQuestionMessage with action SETSTATUS.

Only the question target owner or admin can change the status using this method.

An InvalidQuestiontateError is raised when this method is called with new_status equals to the current question status.

Return the created IQuestionMessage.

This method should fire an IObjectCreatedEvent for the created IQuestionMessage and an IObjectModifiedEvent for the question.

Unknown Field: userThe IPerson making the change.
Unknown Field: new_statusThe new QuestionStatus
Unknown Field: commentA string or IMessage containing an explanation for the change.
Unknown Field: datecreatedDate for the message. Defaults to the current time.
can_request_info =
Whether the question is in a state where a user can request more information from the question owner.
def requestInfo(user, question, datecreated=None):
Request more information from the question owner.

Add an IQuestionMessage with action REQUESTINFO containing the question. The question's status is changed to NEEDSINFO, and the datelastresponse attribute is updated to the message creation date.

The user requesting more information cannot be the question's owner. This workflow method should only be called when the question status is OPEN or NEEDSINFO. An InvalidQuestionStateError is raised otherwise.

It can also be called when the question is in the ANSWERED state, but in that case, the status will stay unchanged.

Return the created IQuestionMessage.

This method should fire an IObjectCreatedEvent for the created IQuestionMessage and an IObjectModifiedEvent for the question.

Unknown Field: userIPerson requesting for the information.
Unknown Field: questionA string or IMessage containing the question.
Unknown Field: datecreatedDate for the answer. Defaults to the current time.
can_give_info =
Whether the question is in a state where the question owner can give more information on the question.
def giveInfo(reply, datecreated=None):
Reply to the information request.

Add an IQuestionMessage with action GIVEINFO. The question status is changed to OPEN, the datelastquery attribute is updated to the message creation time.

This method should only be called on behalf of the question owner when the question is in the OPEN or NEEDSINFO state. An InvalidQuestionStateError is raised otherwise.

Return the created IQuestionMessage.

This method should fire an IObjectCreatedEvent for the created IQuestionMessage and an IObjectModifiedEvent for the question.

Unknown Field: replyA string or IMessage containing the new information.
Unknown Field: datecreatedDate for the message. Defaults to the current time.
can_give_answer =
Whether the question is in a state a user can provide an answer on the question.
def giveAnswer(user, answer, datecreated=None):
Give an answer to this question.

If the user is not the question's owner, add an IQuestionMessage with action ANSWER containing an answer for the question. This changes the question's status to ANSWERED and updates the datelastresponse attribute to the message's creation date.

When the question owner answers the question, add an IQuestionMessage with action CONFIRM. The question status is changed to SOLVED, the answerer attribute is updated to contain the question owner, the answer attribute will be updated to point at the new message, the datelastresponse and date_solved attributes are updated to the message creation date.

This workflow method should only be called when the question status is one of OPEN, ANSWERED or NEEDSINFO. An InvalidQuestionStateError is raised otherwise.

Return the created IQuestionMessage.

This method should fire an IObjectCreatedEvent for the created IQuestionMessage and an IObjectModifiedEvent for the question.

Unknown Field: userIPerson giving the answer.
Unknown Field: answerA string or IMessage containing the answer.
Unknown Field: datecreatedDate for the message. Defaults to the current time.
def linkFAQ(user, faq, comment, datecreated=None):
Link a FAQ as an answer to this question.

Exactly like giveAnswer() but also link the IFAQ faq object to this question.

Return the created IQuestionMessage.

This method should fire an IObjectCreatedEvent for the created IQuestionMessage and an IObjectModifiedEvent for the question.

ParametersuserIPerson linking the faq.
faqThe IFAQ containing the answer.
commentA string or IMessage explaining how the FAQ is relevant.
datecreatedDate for the message. Defaults to the current time.
can_confirm_answer =
Whether the question is in a state for the question owner to confirm that an answer solved their problem.
def confirmAnswer(comment, answer=None, datecreated=None):
Confirm that a solution to the question was found.

 Add an IQuestionMessage with action CONFIRM. The question status is
 changed to SOLVED. If the answer parameter is not None, it is recorded
 in the answer attribute and the answerer attribute is set to that
 message's owner. The datelastresponse and date_solved attributes are
 updated to the message creation date.

 This workflow method should only be called on behalf of the question
 owner, when the question status is ANSWERED, or when the status is
 OPEN or NEEDSINFO but an answer was already provided. An
 InvalidQuestionStateError is raised otherwise.

 Return the created IQuestionMessage.

 This method should fire an IObjectCreatedEvent for the created
 IQuestionMessage and an IObjectModifiedEvent for the question.

:comment: A string or IMessage containing a comment.
 :answer: The IQuestionMessage that contain the answer to the question.
          It must be one of the IQuestionMessage of this question.
 :datecreated: Date for the message. Defaults to the current time.
 
def canReject(user):
Test if a user can reject the question.

Return true only if user is an answer contact for the question target, the question target owner or part of the administration team.

@operation_parameters(Text(_('An explanation of the rejection')))
@call_with(REQUEST_USER)
@export_factory_operation(IQuestionMessage, )
@operation_for_version('devel')
def reject(user, comment, datecreated=None):
Mark this question as INVALID.

Add an IQuestionMessage with action REJECT. The question status is changed to INVALID. The created message is set as the question answer and its owner as the question answerer. The datelastresponse and date_solved are updated to the message creation.

Only answer contacts for the question target, the target owner or a member of the admin team can reject a request. All questions can be rejected.

Return the created IQuestionMessage.

This method should fire an IObjectCreatedEvent for the created IQuestionMessage and an IObjectModifiedEvent for the question.

Unknown Field: userThe user rejecting the request.
Unknown Field: commentA string or IMessage containing an explanation of the rejection.
Unknown Field: datecreatedDate for the message. Defaults to the current time.
def expireQuestion(user, comment, datecreated=None):
Mark a question as EXPIRED.

Add an IQuestionMessage with action EXPIRE. This changes the question status to EXPIRED and update the datelastresponse attribute to the new message creation date.

This workflow method should only be called when the question status is one of OPEN or NEEDSINFO. An InvalidQuestionStateError is raised otherwise.

Return the created IQuestionMessage.

(Note this method is named expireQuestion and not expire because of conflicts with SQLObject.)

This method should fire an IObjectCreatedEvent for the created IQuestionMessage and an IObjectModifiedEvent for the question.

Unknown Field: userIPerson expiring the request.
Unknown Field: commentA string or IMessage containing an explanation for the expiration.
Unknown Field: datecreatedDate for the message. Defaults to the current time.
can_reopen =
Whether the question state is a state where the question owner could reopen it.
def reopen(comment, datecreated=None):
Reopen a question that was ANSWERED, EXPIRED or SOLVED.

Add an IQuestionMessage with action REOPEN. This changes the question status to OPEN and update the datelastquery attribute to the new message creation date. When the question was in the SOLVED state, this method should reset the date_solved, answerer and answer attributes.

This workflow method should only be called on behalf of the question owner, when the question status is in one of ANSWERED, EXPIRED or SOLVED. An InvalidQuestionStateError is raised otherwise.

Return the created IQuestionMessage.

This method should fire an IObjectCreatedEvent for the created IQuestionMessage and an IObjectModifiedEvent for the question.

Unknown Field: commentA string or IMessage containing more information about the request.
Unknown Field: datecreatedDate for the message. Defaults to the current time.
def addComment(user, comment, datecreated=None):
Add a comment on the question.

Create an IQuestionMessage with action COMMENT. It leaves the question status unchanged.

This method should fire an IObjectCreatedEvent for the created IQuestionMessage and an IObjectModifiedEvent for the question.

Unknown Field: userThe IPerson making the comment.
Unknown Field: commentA string or IMessage containing the comment.
Unknown Field: datecreatedDate for the message. Defaults to the current time.
@operation_parameters(Reference(IPerson, _('Person'), True))
@call_with(REQUEST_USER)
@export_write_operation()
@operation_for_version('devel')
def subscribe(person, subscribed_by=None):
Subscribe person to the question.
Parameterspersonthe subscriber.
subscribed_bythe person who created the subscription.
Returnsan IQuestionSubscription.
def isSubscribed(person):
Return a boolean indicating whether the person is subscribed.
@operation_parameters(Reference(IPerson, _('Person'), False))
@call_with(REQUEST_USER)
@export_write_operation()
@operation_for_version('devel')
def unsubscribe(person, unsubscribed_by):
Unsubscribe person from the question.
Parameterspersonthe subscriber.
unsubscribed_bythe person who removed the subscription.
def getDirectSubscribers():
Return the persons who are subscribed to this question.
ReturnsA list of persons sorted by displayname.
def getDirectSubscribersWithDetails():
Get direct subscribers and their subscriptions for the question.
ReturnsA ResultSet of tuples (Person, QuestionSubscription) representing a subscriber and their question subscription.
def getIndirectSubscribers():
Return the persons who are implicitly subscribed to this question.
ReturnsA list of persons sorted by displayname.
def getRecipients():
Return the set of person to notify about changes in this question.

That is the union of getDirectSubscribers() and getIndirectSubscribers().

ReturnsAn INotificationRecipientSet containing the persons to notify along the rationale for doing so.
direct_recipients =
Return An INotificationRecipientSet containing the persons to notify along the rationale for doing so.
indirect_recipients =
Return the INotificationRecipientSet of answer contacts for the question's target as well as the question's assignee.
@operation_parameters(Int(_('The number of the comment in the list of messages.'), True), Bool(_('Show this comment?'), True))
@call_with(REQUEST_USER)
@export_write_operation()
@operation_for_version('devel')
def setCommentVisibility(user, comment_number, visible):
Set the visible attribute on a question message.

This is restricted to Launchpad admins and registry members, and will return a HTTP Error 401: Unauthorized error for non-admin callers.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.