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/sql | |
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/sql')
-rw-r--r-- | mediagoblin/db/sql/convert.py | 2 | ||||
-rw-r--r-- | mediagoblin/db/sql/models.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/mediagoblin/db/sql/convert.py b/mediagoblin/db/sql/convert.py index 9d276866..a46d62ea 100644 --- a/mediagoblin/db/sql/convert.py +++ b/mediagoblin/db/sql/convert.py @@ -133,7 +133,7 @@ def convert_media_comments(mk_db): new_entry = MediaComment() copy_attrs(entry, new_entry, ('created', - 'content', 'content_html',)) + 'content',)) copy_reference_attr(entry, new_entry, "media_entry") copy_reference_attr(entry, new_entry, "author") diff --git a/mediagoblin/db/sql/models.py b/mediagoblin/db/sql/models.py index 72591f4e..18e1dfd7 100644 --- a/mediagoblin/db/sql/models.py +++ b/mediagoblin/db/sql/models.py @@ -31,7 +31,7 @@ from sqlalchemy.ext.associationproxy import association_proxy from mediagoblin.db.sql.extratypes import PathTupleWithSlashes from mediagoblin.db.sql.base import Base, DictReadAttrProxy -from mediagoblin.db.mixin import UserMixin, MediaEntryMixin +from mediagoblin.db.mixin import UserMixin, MediaEntryMixin, MediaCommentMixin class SimpleFieldAlias(object): @@ -218,7 +218,7 @@ class MediaTag(Base): return DictReadAttrProxy(self) -class MediaComment(Base): +class MediaComment(Base, MediaCommentMixin): __tablename__ = "media_comments" id = Column(Integer, primary_key=True) @@ -227,7 +227,6 @@ class MediaComment(Base): author = Column(Integer, ForeignKey('users.id'), nullable=False) created = Column(DateTime, nullable=False, default=datetime.datetime.now) content = Column(UnicodeText, nullable=False) - content_html = Column(UnicodeText) get_author = relationship(User) |