From 485404a9c42b09f0fda38aeb8d1242f24ccfa143 Mon Sep 17 00:00:00 2001 From: Elrond Date: Fri, 1 Feb 2013 16:33:53 +0100 Subject: [PATCH] Drop backward compatibility for media_data backref. Now we only support media_type backrefs with uselist=False. --- mediagoblin/db/models.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index c9bc3c11..10e0c33f 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -20,7 +20,6 @@ TODO: indexes on foreignkeys, where useful. import logging import datetime -from collections import Sequence from sqlalchemy import Column, Integer, Unicode, UnicodeText, DateTime, \ Boolean, ForeignKey, UniqueConstraint, PrimaryKeyConstraint, \ @@ -197,14 +196,7 @@ class MediaEntry(Base, MediaEntryMixin): @property def media_data(self): - r = getattr(self, self.media_data_ref, None) - if isinstance(r, Sequence): - assert len(r) < 2 - if r: - return r[0] - else: - return None - return r + return getattr(self, self.media_data_ref) def media_data_init(self, **kwargs): """ -- 2.25.1