Files
edx-platform/common/djangoapps/django_comment_common/comment_client/commentable.py
2019-05-01 19:13:09 -04:00

19 lines
573 B
Python

"""Provides base Commentable model class"""
from django_comment_common.comment_client import models, settings
class Commentable(models.Model):
accessible_fields = ['id', 'commentable_id']
base_url = "{prefix}/commentables".format(prefix=settings.PREFIX)
type = 'commentable'
def retrieve(self, *args, **kwargs):
"""
Override default behavior because commentables don't actually exist in the comment service.
"""
self.attributes["commentable_id"] = self.attributes["id"]
self.retrieved = True
return self