-
Notifications
You must be signed in to change notification settings - Fork 66
Description
Is your feature request related to a problem? Please describe.
Enable discussions to be attached to other objects.
Describe the solution you'd like
Methods the attached_to object must implement:
get_absolute_url() => Expects that the Discussion exists on the page returned by this method. Invitations to the discussion bring the user here.
title (with "@Property" attribute) => Return the title of the discussion
is_discussion_deleted() => Is the attached_to object inactive and the discussion should be treated as deleted, maybe?
get_discussion_participants() => Returns a QuerySet of Users. Used to give those users notifications about new comments I think?
get_discussion_interleaved_events(since) => Returns other events to show interleaved between comments like github's pull requests show comments interleaved with other activity on the PR. "since" is a time, if passed, it should return events since that time.
get_project_context_dict() => Return stuff.... Need to look at how it is used to know what it can return. Probably should be a dict, so returning an empty dict " {} " would probably be fine.
is_discussion_public() => Optional! If implemented, returns something. Need to see how Discussion.is_public is used.
can_invite_guests(user) => Returns whether the user is permitted to invite guests.
get_notification_watchers() => Returns a QuerySet of Users who should get notifications about things related to the discussion.
get_discussion_autocompletes(discussion) => Returns information about available autocompletes for comments. Need to see how Discussion.get_autocompletes is used to know what to return.
on_discussion_comment(discussion) => Optional! This is called after a comment is left so the attached_to object can take further action.
on_discussion_comment_edited(comment) => Optional! If implemented, it is called after an existing comment is edited (i.e. revised) by its author.
task (with "@Property" attribute) => Returns the Task associated with the TaskAnswer but obviously does not pertain to other uses of discussions.
get_user_role(user) => Returns a string describing the user's role in a discussion. I think this might be for display purposes only. Can return None. Otherwise e.g. "guest", "member," etc.