diff --git a/etiquette/jsonify.py b/etiquette/jsonify.py index c7973d6..f96c711 100644 --- a/etiquette/jsonify.py +++ b/etiquette/jsonify.py @@ -11,7 +11,7 @@ def album(a, minimal=False): } if not minimal: j['photos'] = [photo(p) for p in a.photos()] - parent = a.parent() + parent = a.get_parent() if parent is not None: j['parent'] = album(parent, minimal=True) else: diff --git a/etiquette/objects.py b/etiquette/objects.py index 5228a7d..d9d6021 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -131,7 +131,7 @@ class GroupableMixin: child.delete(delete_children=delete_children, commit=False) else: # Lift children - parent = self.parent() + parent = self.get_parent() if parent is None: # Since this group was a root, children become roots by removing # the row. @@ -156,7 +156,7 @@ class GroupableMixin: self.photodb.log.debug('Committing - delete tag') self.photodb.commit() - def parent(self): + def get_parent(self): ''' Return the group of which this is a member, or None. Returned object will be of the same type as calling object. @@ -208,10 +208,10 @@ class GroupableMixin: yield from child.walk_children() def walk_parents(self): - parent = self.parent() + parent = self.get_parent() while parent is not None: yield parent - parent = parent.parent() + parent = parent.get_parent() class Album(ObjectBase, GroupableMixin): @@ -247,7 +247,7 @@ class Album(ObjectBase, GroupableMixin): self._sum_photos_recursive = None self._sum_bytes_local = None self._sum_bytes_recursive = None - parent = self.parent() + parent = self.get_parent() if parent is not None: parent._uncache_sums() @@ -409,7 +409,7 @@ class Album(ObjectBase, GroupableMixin): @decorators.required_feature('album.edit') def leave_group(self, *args, **kwargs): - parent = self.parent() + parent = self.get_parent() if parent is not None: parent._uncache_sums() result = super().leave_group(*args, **kwargs) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index d8c8615..0798cd9 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -96,7 +96,7 @@ class PDBAlbumMixin: def get_root_albums(self): for album in self.get_albums(): - if album.parent() is None: + if album.get_parent() is None: yield album @decorators.required_feature('album.new') @@ -722,7 +722,7 @@ class PDBTagMixin: Yield all Tags that have no parent. ''' for tag in self.get_tags(): - if tag.parent() is None: + if tag.get_parent() is None: yield tag @decorators.required_feature('tag.new') @@ -1109,7 +1109,7 @@ class PhotoDB(PDBAlbumMixin, PDBBookmarkMixin, PDBPhotoMixin, PDBTagMixin, PDBUs return current_album def orphan_join_parent_album(albums_by_path, current_album, current_directory): - if current_album.parent() is None: + if current_album.get_parent() is None: parent = albums_by_path.get(current_directory.parent.absolute_path, None) if parent is not None: parent.add_child(current_album, commit=False) diff --git a/etiquette/tag_export.py b/etiquette/tag_export.py index d75ca16..fc0b38e 100644 --- a/etiquette/tag_export.py +++ b/etiquette/tag_export.py @@ -99,5 +99,5 @@ def stdout(tags, depth=0): stdout(children, depth=depth+1) - if tag.parent() is None: + if tag.get_parent() is None: print() diff --git a/frontends/etiquette_flask/templates/album.html b/frontends/etiquette_flask/templates/album.html index 76de3fb..87bec78 100644 --- a/frontends/etiquette_flask/templates/album.html +++ b/frontends/etiquette_flask/templates/album.html @@ -64,7 +64,7 @@ p