-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attach discussions to other objects #1668
Comments
Because the Discussion Model has a
In this example there is a constant in Discussion called LIKE. This issue then seems to either be enhancing the Discussion methods are present and applying GenericRelations to at least the User and Comment models. This is all to say the Discussion model is all setup to attach to other models. |
Unless otherwise discussed below the methods are already ready to be added given the Generic Relationship Discussion can have with any other model (given its GenericForeignKey)
|
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 discussionis_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.The text was updated successfully, but these errors were encountered: