Skip to content

Storage get count - #3720

Open
joacasallas2 wants to merge 16 commits into
alexaorrico:masterfrom
joacasallas2:storage_get_count
Open

Storage get count#3720
joacasallas2 wants to merge 16 commits into
alexaorrico:masterfrom
joacasallas2:storage_get_count

Conversation

@joacasallas2

Copy link
Copy Markdown

Update DBStorage and FileStorage, adding two new methods:

A method to retrieve one object:

Prototype: def get(self, cls, id):
cls: class
id: string representing the object ID
Returns the object based on the class and its ID, or None if not found

A method to count the number of objects in storage:

Prototype: def count(self, cls=None):
cls: class (optional)
Returns the number of objects in storage matching the given class.
If no class is passed, returns the count of all objects in storage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants