From: Elrond Date: Thu, 29 Mar 2012 21:05:34 +0000 (+0200) Subject: And remove some now useless methods. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=73758391f3222567e24b25d69610227e8f9fd69d;p=mediagoblin.git And remove some now useless methods. --- diff --git a/mediagoblin/db/sql/models_v0.py b/mediagoblin/db/sql/models_v0.py index 6dd23187..5dd6b38b 100644 --- a/mediagoblin/db/sql/models_v0.py +++ b/mediagoblin/db/sql/models_v0.py @@ -28,7 +28,6 @@ from sqlalchemy import ( from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, backref from sqlalchemy.orm.collections import attribute_mapped_collection -from sqlalchemy.sql.expression import desc from sqlalchemy.ext.associationproxy import association_proxy from sqlalchemy.util import memoized_property @@ -110,41 +109,6 @@ class MediaEntry(Base_v0): cascade="all, delete-orphan" ) - def get_comments(self, ascending=False): - order_col = MediaComment.created - if not ascending: - order_col = desc(order_col) - return MediaComment.query.filter_by( - media_entry=self.id).order_by(order_col) - - def url_to_prev(self, urlgen): - """get the next 'newer' entry by this user""" - media = MediaEntry.query.filter( - (MediaEntry.uploader == self.uploader) - & (MediaEntry.state == 'processed') - & (MediaEntry.id > self.id)).order_by(MediaEntry.id).first() - - if media is not None: - return media.url_for_self(urlgen) - - def url_to_next(self, urlgen): - """get the next 'older' entry by this user""" - media = MediaEntry.query.filter( - (MediaEntry.uploader == self.uploader) - & (MediaEntry.state == 'processed') - & (MediaEntry.id < self.id)).order_by(desc(MediaEntry.id)).first() - - if media is not None: - return media.url_for_self(urlgen) - - #@memoized_property - @property - def media_data(self): - session = Session() - - return session.query(self.media_data_table).filter_by( - media_entry=self.id).first() - def media_data_init(self, **kwargs): """ Initialize or update the contents of a media entry's media_data row