Workout With Friends
Stay fit with a little motivation
|
Public Member Functions | |
def | age |
Calculate this users age. | |
def | bmi |
Calculate this users Body Mass Index, which is a useful indicator of health. | |
def | bmi_category |
Return the category this user belongs to based on BMI. | |
def | total_points |
Calculate how many points this user has in total. | |
def | __init__ |
def | __unicode__ |
def | get_by_username |
Search by username. | |
def | get_by_email |
Search by email. | |
def | create |
def | search |
Perform a fulltext search, matching the given terms. | |
def | count_search_results |
def | is_user |
Quick and easy test to check if the given user is this user. | |
def | update_profile |
Update this users profile, with both required and optional data. | |
def | update_password |
Update this users password. | |
def | update_avatar |
Update this users avatar (profile pic) | |
def | get_average_speed |
Calculate the average speed (speed challenge) for a given distance. | |
def | get_average_heart_rate |
Calculate the average heart rate (endurance challenge) for a given duration. | |
def | get_average_calories_burned |
Calculate the average calories burned (endurance challenge) for a given duration. | |
def | get_average_bench_press_repetitions |
Calculate the average bench press repetitions (bench press challenge) for a given percentage. | |
def | get_average_squat_repetitions |
Calculate the average squat repetitions (squat challenge) for a given percentage. | |
def | group_average_speed |
Calculate the average speed by day for a given distance. | |
def | group_average_heart_rate |
Calculate the average heart rate by day for a given duration. | |
def | group_average_calories_burned |
Calculate the average calories burned by day for a given duration. | |
def | group_average_bench_press_repetitions |
Calculate the average bench press by day for a given percentage. | |
def | group_average_squat_repetitions |
Calculate the average squat repetitions by day for a given percentage. | |
def | get_buddies |
Return all of this users workout buddies. | |
def | count_buddies |
Count how many workout buddies this user has. | |
def | is_buddy |
Check whether the given user is a workout buddy. | |
def | add_buddy |
Add the user to the list of workout buddies. | |
def | remove_buddy |
Remove the user from the list of workout buddies. | |
def | get_challenges |
Return all challenges this user is apart of (paginated). | |
def | get_workout_for_challenge |
Return this users workout for the given challenge. | |
def | count_challenges |
Count all challenges this user is a competitor in. | |
def | create_speed_challenge |
def | create_endurance_challenge |
def | create_bench_press_challenge |
def | create_squat_challenge |
def | create_speed_workout |
def | create_endurance_workout |
def | create_bench_press_workout |
def | create_squat_workout |
def | in_challenge |
Check whether this user is a competitor in the given challenge. | |
def | owns_challenge |
Check whether this user is the creator of the given challenge. | |
def | accepted_challenge |
Check whether this user has accepted the given challenge. | |
def | denied_challenge |
Check whether this user has denied the given challenge. | |
def | accept_challenge |
Change the status between this user and the given challenge to accepted, and send all other competitors a notification. | |
def | deny_challenge |
Change the status between this user and the given challenge to denied, and send all other competitors a notification. | |
def | get_all_notifications |
Return all notifications, regardless of status (paginated). | |
def | count_all_notifications |
Count all notifications, regardless of status. | |
def | get_unconfirmed_notifications |
Return all notifications which have not been confirmed. | |
def | count_unconfirmed_notifications |
Count all notifications which have not been confirmed. | |
def | confirm_all_notifications |
Mark all notifications as confirmed (read). | |
def | has_unconfirmed_notifications |
Check whether this user has any unconfirmed (unread) notifications. | |
![]() | |
def | __str__ |
def | __repr__ |
def | get_by_id |
def | create |
def | delete |
![]() | |
def | index_type |
def | index_id |
def | index_data |
def | add_index |
Add a fulltext index for this instance. | |
def | delete_index |
Delete the fulltext index for this instance. | |
def | update_index |
Update the fulltext index for this instance. |
Public Attributes | |
username | |
password | |
gender | |
dob | |
weight | |
height | |
timezone | |
avatar |
Static Public Attributes | |
list | index_fields = ['username'] |
tuple | id = Column(Integer(unsigned=True), primary_key=True) |
tuple | username = Column(Unicode(10), nullable=False, unique=True) |
tuple | email = Column(Unicode(254), nullable=False, unique=True) |
tuple | gender = Column(Enum('F', 'M', name='user_genders'), nullable=False) |
tuple | dob = Column(Date, nullable=False) |
tuple | weight = Column(Numeric(7, 4), nullable=False, doc='weight in kilograms') |
tuple | height = Column(Numeric(5, 4), nullable=False, doc='height in meters') |
tuple | timezone = Column(Unicode(50)) |
tuple | is_active = Column(Boolean, nullable=False, default=True) |
tuple | created_at = Column(DateTime, nullable=False, default=current_timestamp) |
tuple | last_active_at = Column(DateTime, nullable=False, default=current_timestamp) |
tuple | password = synonym('_password', descriptor=property(_get_password, _set_password)) |
tuple | avatar = synonym('_avatar', descriptor=property(_get_avatar, _set_avatar)) |
![]() | |
tuple | query = DBSession.query_property() |
![]() | |
list | index_fields = [] |
Private Member Functions | |
def | _get_password |
def | _set_password |
Hash the given password. | |
def | _get_avatar |
Return a stored image, to allow different versions of the avatar to be served. | |
def | _set_avatar |
Upload the avatar and set the necessary reference to it. | |
def | _get_search_query |
def | _create_challenge |
Add the competitor to the challenge and send them a notification. | |
def | _create_workout |
Send the other competitor(s) a notification. | |
def | _get_buddies_query |
Query for all of this users buddies. | |
def | _get_buddy |
Return the buddy link between this user and the given user. | |
def | _get_challenge_link |
Return the link between this user and the given challenge. | |
def | _get_notifications_query |
Private Attributes | |
_password | |
_avatar |
Static Private Attributes | |
string | __tablename__ = 'users' |
tuple | _password = Column('password', CHAR(60), nullable=False) |
tuple | _avatar = Column('avatar', Unicode(40)) |
def wowf.models.user.User.__init__ | ( | self, | |
username, | |||
email, | |||
password, | |||
gender, | |||
dob, | |||
weight, | |||
height | |||
) |
def wowf.models.user.User.__unicode__ | ( | self | ) |
Reimplemented from wowf.models.meta.Base.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
def wowf.models.user.User.accept_challenge | ( | self, | |
challenge | |||
) |
def wowf.models.user.User.accepted_challenge | ( | self, | |
challenge | |||
) |
def wowf.models.user.User.add_buddy | ( | self, | |
user | |||
) |
def wowf.models.user.User.age | ( | self | ) |
def wowf.models.user.User.bmi | ( | self | ) |
def wowf.models.user.User.bmi_category | ( | self | ) |
def wowf.models.user.User.confirm_all_notifications | ( | self | ) |
def wowf.models.user.User.count_all_notifications | ( | self | ) |
def wowf.models.user.User.count_buddies | ( | self | ) |
def wowf.models.user.User.count_challenges | ( | self | ) |
def wowf.models.user.User.count_search_results | ( | cls, | |
terms | |||
) |
def wowf.models.user.User.count_unconfirmed_notifications | ( | self | ) |
def wowf.models.user.User.create | ( | cls, | |
username, | |||
email, | |||
password, | |||
gender, | |||
dob, | |||
weight, | |||
height | |||
) |
def wowf.models.user.User.create_bench_press_challenge | ( | self, | |
competitor, | |||
percentage | |||
) |
def wowf.models.user.User.create_bench_press_workout | ( | self, | |
challenge, | |||
repetitions | |||
) |
def wowf.models.user.User.create_endurance_challenge | ( | self, | |
competitor, | |||
duration | |||
) |
def wowf.models.user.User.create_endurance_workout | ( | self, | |
challenge, | |||
samples | |||
) |
def wowf.models.user.User.create_speed_challenge | ( | self, | |
competitor, | |||
distance | |||
) |
def wowf.models.user.User.create_speed_workout | ( | self, | |
challenge, | |||
samples | |||
) |
def wowf.models.user.User.create_squat_challenge | ( | self, | |
competitor, | |||
percentage | |||
) |
def wowf.models.user.User.create_squat_workout | ( | self, | |
challenge, | |||
repetitions | |||
) |
def wowf.models.user.User.denied_challenge | ( | self, | |
challenge | |||
) |
def wowf.models.user.User.deny_challenge | ( | self, | |
challenge | |||
) |
def wowf.models.user.User.get_all_notifications | ( | self, | |
limit = 50 , |
|||
page = 1 |
|||
) |
def wowf.models.user.User.get_average_bench_press_repetitions | ( | self, | |
percentage | |||
) |
def wowf.models.user.User.get_average_calories_burned | ( | self, | |
duration | |||
) |
def wowf.models.user.User.get_average_heart_rate | ( | self, | |
duration | |||
) |
def wowf.models.user.User.get_average_speed | ( | self, | |
distance | |||
) |
def wowf.models.user.User.get_average_squat_repetitions | ( | self, | |
percentage | |||
) |
def wowf.models.user.User.get_buddies | ( | self, | |
limit = 50 , |
|||
page = 1 |
|||
) |
def wowf.models.user.User.get_by_email | ( | cls, | |
) |
def wowf.models.user.User.get_by_username | ( | cls, | |
username | |||
) |
def wowf.models.user.User.get_challenges | ( | self, | |
limit = 50 , |
|||
page = 1 |
|||
) |
def wowf.models.user.User.get_unconfirmed_notifications | ( | self, | |
limit = 50 , |
|||
page = 1 |
|||
) |
def wowf.models.user.User.get_workout_for_challenge | ( | self, | |
challenge | |||
) |
def wowf.models.user.User.group_average_bench_press_repetitions | ( | self, | |
percentage | |||
) |
def wowf.models.user.User.group_average_calories_burned | ( | self, | |
duration | |||
) |
def wowf.models.user.User.group_average_heart_rate | ( | self, | |
duration | |||
) |
def wowf.models.user.User.group_average_speed | ( | self, | |
distance | |||
) |
def wowf.models.user.User.group_average_squat_repetitions | ( | self, | |
percentage | |||
) |
def wowf.models.user.User.has_unconfirmed_notifications | ( | self | ) |
def wowf.models.user.User.in_challenge | ( | self, | |
challenge | |||
) |
def wowf.models.user.User.is_buddy | ( | self, | |
user | |||
) |
def wowf.models.user.User.is_user | ( | self, | |
user | |||
) |
def wowf.models.user.User.owns_challenge | ( | self, | |
challenge | |||
) |
def wowf.models.user.User.remove_buddy | ( | self, | |
user | |||
) |
def wowf.models.user.User.search | ( | cls, | |
terms, | |||
limit = 50 , |
|||
page = 1 |
|||
) |
def wowf.models.user.User.total_points | ( | self | ) |
def wowf.models.user.User.update_avatar | ( | self, | |
avatar | |||
) |
def wowf.models.user.User.update_password | ( | self, | |
password | |||
) |
def wowf.models.user.User.update_profile | ( | self, | |
username, | |||
email, | |||
gender, | |||
dob, | |||
weight, | |||
height, | |||
timezone | |||
) |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |