"like": {"simple": _("{username} liked {object}")},
"post": {
"simple": _("{username} posted {object}"),
- "targetted": _("{username} posted {object} to {targetted}"),
+ "targetted": _("{username} posted {object} to {target}"),
},
"share": {"simple": _("{username} shared {object}")},
"unfavorite": {"simple": _("{username} unfavorited {object}")},
updated = Column(DateTime, default=datetime.datetime.now)
object_type = Column(Unicode, nullable=False)
+ def __repr__(self):
+ return "<{klass} {name}>".format(
+ klass=self.__class__.__name__,
+ name=self.name
+ )
+
def serialize(self, request):
return {
"id": self.id,
foreign_keys="Activity.actor", post_update=True)
get_generator = relationship(Generator)
+ def __repr__(self):
+ if self.content is None:
+ return "<{klass} verb:{verb}>".format(
+ klass=self.__class__.__name__,
+ verb=self.verb
+ )
+ else:
+ return "<{klass} {content}>".format(
+ klass=self.__class__.__name__,
+ content=self.content
+ )
+
@property
def get_object(self):
if self.object is None:
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from mediagoblin.db.models import Activity, Generator, User, MediaEntry, \
- MediaComment, Collection
+from mediagoblin.db.models import Activity, Generator, User
def create_activity(verb, obj, actor, target=None):
"""
_('Your comment has been posted!'))
trigger_notification(comment, media, request)
- create_activity("post", comment, comment.author)
+ create_activity("post", comment, comment.author, target=media)
add_comment_subscription(request.user, media)
return redirect_obj(request, media)