aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db/mixin.py
diff options
context:
space:
mode:
authorJessica Tallon <tsyesika@tsyesika.se>2015-09-17 13:47:56 +0200
committerJessica Tallon <tsyesika@tsyesika.se>2015-10-07 14:40:44 +0200
commit0f3bf8d4b180ffd1907d1578e087522aad7d9158 (patch)
tree22279f7ff895047d1ec3c68bedb69a081cc0871a /mediagoblin/db/mixin.py
parent80ba8ad1d1badb2f6330f25c540dc413e42e7d5c (diff)
downloadmediagoblin-0f3bf8d4b180ffd1907d1578e087522aad7d9158.tar.lz
mediagoblin-0f3bf8d4b180ffd1907d1578e087522aad7d9158.tar.xz
mediagoblin-0f3bf8d4b180ffd1907d1578e087522aad7d9158.zip
Collection changes and migration for federation
- Adds a "type" column to the Collection object and allows the CollectionItem model to contain any object. - Changes "items" to "num_items" as per TODO - Renames "uploader", "creator" and "user" to a common "actor" in most places
Diffstat (limited to 'mediagoblin/db/mixin.py')
-rw-r--r--mediagoblin/db/mixin.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/mediagoblin/db/mixin.py b/mediagoblin/db/mixin.py
index b954ab90..7960061e 100644
--- a/mediagoblin/db/mixin.py
+++ b/mediagoblin/db/mixin.py
@@ -134,7 +134,7 @@ class MediaEntryMixin(GenerateSlugMixin):
# (db.models -> db.mixin -> db.util -> db.models)
from mediagoblin.db.util import check_media_slug_used
- return check_media_slug_used(self.uploader, slug, self.id)
+ return check_media_slug_used(self.actor, slug, self.id)
@property
def object_type(self):
@@ -188,7 +188,7 @@ class MediaEntryMixin(GenerateSlugMixin):
Use a slug if we have one, else use our 'id'.
"""
- uploader = self.get_uploader
+ uploader = self.get_actor
return urlgen(
'mediagoblin.user_pages.media_home',
@@ -338,17 +338,17 @@ class MediaCommentMixin(object):
return cleaned_markdown_conversion(self.content)
def __unicode__(self):
- return u'<{klass} #{id} {author} "{comment}">'.format(
+ return u'<{klass} #{id} {actor} "{comment}">'.format(
klass=self.__class__.__name__,
id=self.id,
- author=self.get_author,
+ actor=self.get_actor,
comment=self.content)
def __repr__(self):
- return '<{klass} #{id} {author} "{comment}">'.format(
+ return '<{klass} #{id} {actor} "{comment}">'.format(
klass=self.__class__.__name__,
id=self.id,
- author=self.get_author,
+ actor=self.get_actor,
comment=self.content)
@@ -360,7 +360,7 @@ class CollectionMixin(GenerateSlugMixin):
# (db.models -> db.mixin -> db.util -> db.models)
from mediagoblin.db.util import check_collection_slug_used
- return check_collection_slug_used(self.creator, slug, self.id)
+ return check_collection_slug_used(self.actor, slug, self.id)
@property
def description_html(self):
@@ -380,7 +380,7 @@ class CollectionMixin(GenerateSlugMixin):
Use a slug if we have one, else use our 'id'.
"""
- creator = self.get_creator
+ creator = self.get_actor
return urlgen(
'mediagoblin.user_pages.user_collection',