diff --git a/etiquette/objects.py b/etiquette/objects.py index 1604d21..00db82b 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -123,7 +123,7 @@ class GroupableMixin(metaclass=abc.ABCMeta): 'parentid': self.id, 'memberid': member.id, } - self.photodb.insert(table=self.group_table, data=data) + self.photodb.insert(table=self.group_table, pairs=data) @abc.abstractmethod def add_child(self, member): @@ -333,7 +333,7 @@ class Album(ObjectBase, GroupableMixin): log.info('Adding directory "%s" to %s.', path.absolute_path, self) data = {'albumid': self.id, 'directory': path.absolute_path} - self.photodb.insert(table='album_associated_directories', data=data) + self.photodb.insert(table='album_associated_directories', pairs=data) @decorators.required_feature('album.edit') @worms.atomic @@ -376,7 +376,7 @@ class Album(ObjectBase, GroupableMixin): def _add_photo(self, photo): log.info('Adding photo %s to %s.', photo, self) data = {'albumid': self.id, 'photoid': photo.id} - self.photodb.insert(table='album_photo_rel', data=data) + self.photodb.insert(table='album_photo_rel', pairs=data) @decorators.required_feature('album.edit') @worms.atomic @@ -962,7 +962,7 @@ class Photo(ObjectBase): 'photoid': self.id, 'tagid': tag.id } - self.photodb.insert(table='photo_tag_rel', data=data) + self.photodb.insert(table='photo_tag_rel', pairs=data) data = { 'id': self.id, 'tagged_at': helpers.now().timestamp(), @@ -1667,7 +1667,7 @@ class Tag(ObjectBase, GroupableMixin): 'name': synname, 'mastername': self.name, } - self.photodb.insert(table='tag_synonyms', data=data) + self.photodb.insert(table='tag_synonyms', pairs=data) if self._cached_synonyms is not None: self._cached_synonyms.add(synname) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 629e0a2..ed72351 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -117,7 +117,7 @@ class PDBAlbumMixin: 'thumbnail_photo': None, 'author_id': author_id, } - self.insert(table=objects.Album, data=data) + self.insert(table=objects.Album, pairs=data) album = self.get_cached_instance(objects.Album, data) @@ -208,7 +208,7 @@ class PDBBookmarkMixin: 'created': helpers.now().timestamp(), 'author_id': author_id, } - self.insert(table=objects.Bookmark, data=data) + self.insert(table=objects.Bookmark, pairs=data) bookmark = self.get_cached_instance(objects.Bookmark, data) @@ -375,7 +375,7 @@ class PDBPhotoMixin: 'duration': None, 'thumbnail': None, } - self.insert(table=objects.Photo, data=data) + self.insert(table=objects.Photo, pairs=data) photo = self.get_cached_instance(objects.Photo, data) @@ -983,7 +983,7 @@ class PDBTagMixin: 'created': helpers.now().timestamp(), 'author_id': author_id, } - self.insert(table=objects.Tag, data=data) + self.insert(table=objects.Tag, pairs=data) tag = self.get_cached_instance(objects.Tag, data) @@ -1152,7 +1152,7 @@ class PDBUserMixin: 'display_name': display_name, 'created': helpers.now().timestamp(), } - self.insert(table=objects.User, data=data) + self.insert(table=objects.User, pairs=data) return self.get_cached_instance(objects.User, data)