Rename Photo.author -> get_author; no longer a @property.
This commit is contained in:
parent
205c49c21f
commit
bbe392ac09
2 changed files with 9 additions and 10 deletions
|
@ -635,15 +635,6 @@ class Photo(ObjectBase):
|
||||||
self.photodb.commit()
|
self.photodb.commit()
|
||||||
return tag
|
return tag
|
||||||
|
|
||||||
@property
|
|
||||||
def author(self):
|
|
||||||
'''
|
|
||||||
Return the User object who owns this photo, or None if it is unassigned.
|
|
||||||
'''
|
|
||||||
if self.author_id is None:
|
|
||||||
return None
|
|
||||||
return self.photodb.get_user(id=self.author_id)
|
|
||||||
|
|
||||||
def bytestring(self):
|
def bytestring(self):
|
||||||
if self.bytes is not None:
|
if self.bytes is not None:
|
||||||
return bytestring.bytestring(self.bytes)
|
return bytestring.bytestring(self.bytes)
|
||||||
|
@ -782,6 +773,14 @@ class Photo(ObjectBase):
|
||||||
self.__reinit__()
|
self.__reinit__()
|
||||||
return self.thumbnail
|
return self.thumbnail
|
||||||
|
|
||||||
|
def get_author(self):
|
||||||
|
'''
|
||||||
|
Return the User object who owns this photo, or None if it is unassigned.
|
||||||
|
'''
|
||||||
|
if self.author_id is None:
|
||||||
|
return None
|
||||||
|
return self.photodb.get_user(id=self.author_id)
|
||||||
|
|
||||||
def get_containing_albums(self):
|
def get_containing_albums(self):
|
||||||
'''
|
'''
|
||||||
Return the albums of which this photo is a member.
|
Return the albums of which this photo is a member.
|
||||||
|
|
|
@ -184,7 +184,7 @@
|
||||||
</h4>
|
</h4>
|
||||||
<ul id="metadata">
|
<ul id="metadata">
|
||||||
<li>Filename: {{photo.basename}}</li>
|
<li>Filename: {{photo.basename}}</li>
|
||||||
{% set author = photo.author %}
|
{% set author = photo.get_author() %}
|
||||||
{% if author is not none %}
|
{% if author is not none %}
|
||||||
<li>Author: <a href="/user/{{author.username}}">{{author.username}}</a></li>
|
<li>Author: <a href="/user/{{author.username}}">{{author.username}}</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue