Turn MediaComment's author() into get_author property
1) MediaComment's author method conflicts with the author field. So rename it to get_author. 2) Turn it from a normal function into a python property. That means you call it by ".get_author" not by ".get_author()". This is exactly what sqlalchemy gives us free of charge.
This commit is contained in:
@@ -346,7 +346,8 @@ class MediaComment(Document):
|
||||
def media_entry(self):
|
||||
return self.db.MediaEntry.find_one({'_id': self['media_entry']})
|
||||
|
||||
def author(self):
|
||||
@property
|
||||
def get_author(self):
|
||||
return self.db.User.find_one({'_id': self['author']})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user