aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/sql/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/db/sql/models.py')
-rw-r--r--mediagoblin/db/sql/models.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/mediagoblin/db/sql/models.py b/mediagoblin/db/sql/models.py
index b48c1fbe..4450e38d 100644
--- a/mediagoblin/db/sql/models.py
+++ b/mediagoblin/db/sql/models.py
@@ -44,18 +44,6 @@ from mediagoblin.db.sql.base import Session
from migrate import changeset
-class SimpleFieldAlias(object):
- """An alias for any field"""
- def __init__(self, fieldname):
- self.fieldname = fieldname
-
- def __get__(self, instance, cls):
- return getattr(instance, self.fieldname)
-
- def __set__(self, instance, val):
- setattr(instance, self.fieldname, val)
-
-
class User(Base, UserMixin):
"""
TODO: We should consider moving some rarely used fields
@@ -83,8 +71,6 @@ class User(Base, UserMixin):
## TODO
# plugin data would be in a separate model
- _id = SimpleFieldAlias("id")
-
def __repr__(self):
return '<{0} #{1} {2} {3} "{4}">'.format(
self.__class__.__name__,
@@ -161,8 +147,6 @@ class MediaEntry(Base, MediaEntryMixin):
# media_data
# fail_error
- _id = SimpleFieldAlias("id")
-
def get_comments(self, ascending=False):
order_col = MediaComment.created
if not ascending:
@@ -359,8 +343,6 @@ class MediaComment(Base, MediaCommentMixin):
get_author = relationship(User)
- _id = SimpleFieldAlias("id")
-
class Collection(Base, CollectionMixin):
__tablename__ = "core__collections"
@@ -383,8 +365,6 @@ class Collection(Base, CollectionMixin):
return CollectionItem.query.filter_by(
collection=self.id).order_by(order_col)
- _id = SimpleFieldAlias("id")
-
class CollectionItem(Base, CollectionItemMixin):
__tablename__ = "core__collection_items"
@@ -400,8 +380,6 @@ class CollectionItem(Base, CollectionItemMixin):
get_media_entry = relationship(MediaEntry)
- _id = SimpleFieldAlias("id")
-
__table_args__ = (
UniqueConstraint('collection', 'media_entry'),
{})