Skip to content

Commit

Permalink
Obsoleted db_adapter.add_object. Renamed add_object2 to add_object.
Browse files Browse the repository at this point in the history
  • Loading branch information
lingthio committed Sep 12, 2017
1 parent fa5191d commit 041cbef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
22 changes: 8 additions & 14 deletions flask_user/db_adapters/db_adapter_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ def find_objects(self, ObjectClass, **kwargs):
""" Retrieve all objects of type ``ObjectClass``,
matching the filters specified in ``**kwargs`` -- case sensitive.
"""

raise NotImplementedError

def get_object(self, ObjectClass, id):
""" Retrieve object of type ``ObjectClass`` by ``id``.
| Returns object on success.
| Returns None otherwise.
"""
raise NotImplementedError

def find_first_object(self, ObjectClass, **kwargs):
Expand All @@ -60,15 +51,18 @@ def find_first_object(self, ObjectClass, **kwargs):
"""
raise NotImplementedError

def ifind_first_object(self, ObjectClass, **kwargs):
""" Retrieve the first object of type ``ObjectClass``,
matching the filters specified in ``**kwargs`` -- case insensitive.
def get_object(self, ObjectClass, id):
""" Retrieve object of type ``ObjectClass`` by ``id``.
``ifind_first_object(User, email='[email protected]')`` translates to
``User.query.filter(User.email.ilike('[email protected]')).first()``.
| Returns object on success.
| Returns None otherwise.
"""
raise NotImplementedError

def save_object(self, object, **kwargs):
""" Save object. Only for non-session centric Object-Database Mappers."""
raise NotImplementedError


# Database management methods
# ---------------------------
Expand Down
2 changes: 1 addition & 1 deletion flask_user/db_adapters/dynamo_db_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def find_first_object(self, ObjectClass, **kwargs):

def save_object(self, object, **kwargs):
""" Save object. Only for non-session centric Object-Database Mappers."""
pass
self.db.engine.sync(object)

def delete_object(self, object):
""" Delete object specified by ``object``. """
Expand Down

0 comments on commit 041cbef

Please sign in to comment.