mirror of
https://github.com/NovaOSS/nova-api.git
synced 2024-11-25 12:33:58 +01:00
Small fixes
This commit is contained in:
parent
d1085b00c3
commit
d1c7180d5d
12
api/db/helpers.py
Normal file
12
api/db/helpers.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
import os
|
||||
|
||||
def find_project_root():
|
||||
current_path = os.getcwd()
|
||||
while not os.path.isfile(os.path.join(current_path, 'LICENSE')):
|
||||
current_path = os.path.dirname(current_path)
|
||||
return current_path
|
||||
|
||||
root = find_project_root()
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(find_project_root())
|
|
@ -22,16 +22,6 @@ with open(os.path.join(helpers.root, 'api', 'config', 'config.yml'), encoding='u
|
|||
class UserManager:
|
||||
"""
|
||||
Manager of all users in the database.
|
||||
Following methods are available:
|
||||
|
||||
- `_get_collection(collection_name)`
|
||||
- `create(discord_id)`
|
||||
- `user_by_id(user_id)`
|
||||
- `user_by_discord_id(discord_id)`
|
||||
- `user_by_api_key(api_key)`
|
||||
- `update_by_id(user_id, new_obj)`
|
||||
- `update_by_filter(filter_object, new_obj)`
|
||||
- `delete(user_id)`
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
|
|
Loading…
Reference in a new issue