Workout With Friends Stay fit with a little motivation

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Properties
Public Member Functions | Static Public Attributes | Properties | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
wowf.models.challenge.Challenge Class Reference

Base class for ALL challenges. More...

Inheritance diagram for wowf.models.challenge.Challenge:
Collaboration diagram for wowf.models.challenge.Challenge:

## Public Member Functions
def | add_competitor
| Add the user to the list of competitors.
def | remove_competitor
| Remove the user from the list of competitors.
def | is_device_challenge
| Check if the challenge requires the use of a heart rate device.
def | is_weight_challenge
| Check if the challenge is a weight lifting challenge.
def | is_speed_challenge
| Check if the challenge is a speed challenge.
def | is_endurance_challenge
| Check if the challenge is an endurance challenge.
def | is_bench_press_challenge
| Check if the challenge is a bench press challenge.
def | is_squat_challenge
| Check if the challenge is a squat challenge.
def | is_completed
| Check if both competitors have uploaded a workout.
def | user_is_winner
| Check if given user is the winner of the challenge.
Public Member Functions inherited from wowf.models.meta.Base
def | __str__
def | __repr__
def | __unicode__
def | get_by_id
def | create
def | delete
Public Member Functions inherited from wowf.lib.fulltext.FulltextBase
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.

## Static Public Attributes
tuple | id = Column(Integer(unsigned=True), primary_key=True)
tuple | user_id = Column(Integer(unsigned=True), ForeignKey('users.id'), nullable=False)
tuple | challenge_type_id
tuple | created_at = Column(DateTime, nullable=False, default=current_timestamp)
tuple | competitors
Static Public Attributes inherited from wowf.models.meta.Base
tuple | query = DBSession.query_property()
Static Public Attributes inherited from wowf.lib.fulltext.FulltextBase
list | index_fields = []

## Properties
| creator = property(_get_creator, _set_creator)

## Private Member Functions
def | _get_creator
def | _set_creator
| Set the creator, and accept the challenge for him.

## Private Attributes
| _creator

## Static Private Attributes
string | __tablename__ = 'challenges'
dictionary | __mapper_args__ = {'polymorphic_on': 'challenge_type_id', 'with_polymorphic': '*'}
tuple | _creator = relationship('User', lazy='joined')

## Detailed Description

Base class for ALL challenges.

Definition at line 16 of file challenge.py.

## Member Function Documentation

def wowf.models.challenge.Challenge._get_creator | ( |  | self | ) |
| private

Definition at line 32 of file challenge.py.

def wowf.models.challenge.Challenge._set_creator | ( |  | self,
|  |  | creator
| ) |  |
| private

Set the creator, and accept the challenge for him.

Definition at line 39 of file challenge.py.

def wowf.models.challenge.Challenge.add_competitor | ( |  | self,
|  |  | user
| ) |  |

Add the user to the list of competitors.

Definition at line 50 of file challenge.py.

def wowf.models.challenge.Challenge.is_bench_press_challenge | ( |  | self | ) |

Check if the challenge is a bench press challenge.

Definition at line 94 of file challenge.py.

def wowf.models.challenge.Challenge.is_completed | ( |  | self | ) |

Check if both competitors have uploaded a workout.

Definition at line 108 of file challenge.py.

def wowf.models.challenge.Challenge.is_device_challenge | ( |  | self | ) |

Check if the challenge requires the use of a heart rate device.

Definition at line 66 of file challenge.py.

def wowf.models.challenge.Challenge.is_endurance_challenge | ( |  | self | ) |

Check if the challenge is an endurance challenge.

Definition at line 87 of file challenge.py.

def wowf.models.challenge.Challenge.is_speed_challenge | ( |  | self | ) |

Check if the challenge is a speed challenge.

Definition at line 80 of file challenge.py.

def wowf.models.challenge.Challenge.is_squat_challenge | ( |  | self | ) |

Check if the challenge is a squat challenge.

Definition at line 101 of file challenge.py.

def wowf.models.challenge.Challenge.is_weight_challenge | ( |  | self | ) |

Check if the challenge is a weight lifting challenge.

Definition at line 73 of file challenge.py.

def wowf.models.challenge.Challenge.remove_competitor | ( |  | self,
|  |  | user
| ) |  |

Remove the user from the list of competitors.

Definition at line 58 of file challenge.py.

def wowf.models.challenge.Challenge.user_is_winner | ( |  | self,
|  |  | user
| ) |  |

Check if given user is the winner of the challenge.

Definition at line 115 of file challenge.py.

## Member Data Documentation

dictionary wowf.models.challenge.Challenge.__mapper_args__ = {'polymorphic_on': 'challenge_type_id', 'with_polymorphic': '*'}
| static private

Definition at line 19 of file challenge.py.

string wowf.models.challenge.Challenge.__tablename__ = 'challenges'
| static private

Definition at line 18 of file challenge.py.

tuple wowf.models.challenge.Challenge._creator = relationship('User', lazy='joined')
| static private

Definition at line 27 of file challenge.py.

wowf.models.challenge.Challenge._creator
| private

Definition at line 40 of file challenge.py.

tuple wowf.models.challenge.Challenge.challenge_type_id
| static

Initial value:
Column(
Integer(unsigned=True), ForeignKey('challenge_types.id', ondelete='cascade'),
nullable=False)

Definition at line 22 of file challenge.py.

tuple wowf.models.challenge.Challenge.competitors
| static

Initial value:
relationship(
'User', backref=backref('challenges', lazy='dynamic'),
secondary='users_challenges', lazy='dynamic')

Definition at line 28 of file challenge.py.

tuple wowf.models.challenge.Challenge.created_at = Column(DateTime, nullable=False, default=current_timestamp)
| static

Definition at line 25 of file challenge.py.

tuple wowf.models.challenge.Challenge.id = Column(Integer(unsigned=True), primary_key=True)
| static

Definition at line 20 of file challenge.py.

tuple wowf.models.challenge.Challenge.user_id = Column(Integer(unsigned=True), ForeignKey('users.id'), nullable=False)
| static

Definition at line 21 of file challenge.py.

## Property Documentation

wowf.models.challenge.Challenge.creator = property(_get_creator, _set_creator)
| static

Definition at line 44 of file challenge.py.

The documentation for this class was generated from the following file:

- wowf/models/challenge.py