diff options
author | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2012-02-18 11:32:28 +0100 |
---|---|---|
committer | Elrond <elrond+mediagoblin.org@samba-tng.org> | 2012-02-18 12:50:30 +0100 |
commit | feba5c5287a7cb4c0ed8f5124ad60a8a291770ad (patch) | |
tree | 0a70ac50d1ef5c6093bf682526d9843e20945275 /mediagoblin/db/mongo/models.py | |
parent | 1e72e075f8d542f4aa1ad0262f4fd1a5645cc731 (diff) | |
download | mediagoblin-feba5c5287a7cb4c0ed8f5124ad60a8a291770ad.tar.lz mediagoblin-feba5c5287a7cb4c0ed8f5124ad60a8a291770ad.tar.xz mediagoblin-feba5c5287a7cb4c0ed8f5124ad60a8a291770ad.zip |
Drop pre-rendered html: MediaComment.content_html
After a bit of discussion, we decided to drop the
pre-rendered html from the database and render it on
the fly.
In another step, we will use some proper caching method to
cache this stuff.
This commit affects the MediaComment.content_html part.
Diffstat (limited to 'mediagoblin/db/mongo/models.py')
-rw-r--r-- | mediagoblin/db/mongo/models.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/mediagoblin/db/mongo/models.py b/mediagoblin/db/mongo/models.py index db38d502..57af137d 100644 --- a/mediagoblin/db/mongo/models.py +++ b/mediagoblin/db/mongo/models.py @@ -23,7 +23,7 @@ from mediagoblin.db.mongo import migrations from mediagoblin.db.mongo.util import ASCENDING, DESCENDING, ObjectId from mediagoblin.tools.pagination import Pagination from mediagoblin.tools import url -from mediagoblin.db.mixin import UserMixin, MediaEntryMixin +from mediagoblin.db.mixin import UserMixin, MediaEntryMixin, MediaCommentMixin ################### # Custom validators @@ -251,7 +251,7 @@ class MediaEntry(Document, MediaEntryMixin): return self.db.User.find_one({'_id': self.uploader}) -class MediaComment(Document): +class MediaComment(Document, MediaCommentMixin): """ A comment on a MediaEntry. @@ -260,8 +260,6 @@ class MediaComment(Document): - author: user who posted this comment - created: when the comment was created - content: plaintext (but markdown'able) version of the comment's content. - - content_html: the actual html-rendered version of the comment displayed. - Run through Markdown and the HTML cleaner. """ __collection__ = 'media_comments' @@ -272,7 +270,7 @@ class MediaComment(Document): 'author': ObjectId, 'created': datetime.datetime, 'content': unicode, - 'content_html': unicode} + } required_fields = [ 'media_entry', 'author', 'created', 'content'] |