user_dao module
- class user_dao.user_dao
Bases:
objectClass that contains required functions for user_dao.
- create_user(name, email, password, gender, location)
Creates a user based on the details provided.
- Parameters
name (string) – Name of the user.
email (string) – email with which the user wishes to log in.
password (string) – Password to log in.
gender (string) – Gender of the user.
location (string) – Location where the user is currently present.
- Returns
Executes the query to create a user and returns the execution status.
- Return type
bool
- delete_user()
Deletes the user.
- get_auth_user(email)
Looks for the authenticated user into the WolfTrackPlus portal, and fetches their details.
- Parameters
email (string) – Email identifier of the user.
- Returns
Returns an array/list of user details - full name, gender, location, user id.
- Return type
array[]
- get_user(email, password)
Fetches an existing user from the database.
- Parameters
email (string) – email required for the user’s login.
password (string) – Password for the user’s login.
- Returns
Executes the query to fetch a user and returns the execution status.
- Return type
bool
- get_user_id(email)
Gets the user ID from given email.
- Parameters
email (string) – email of the user whose ID you wish to fetch.
- update_details(user_id, name, gender, location)
Updates the details of an existing user.
- Parameters
user_id (string) – New user ID to update.
name (string) – New name to update.
gender (string) – New gender to update.
location (string) – New location to update.
- Returns
Executes the query to update a user and returns the execution status.
- Return type
bool