Base class for ALL challenges.
More...
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 |
tuple | query = DBSession.query_property() |
list | index_fields = [] |
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 |
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': '*'} |
|
staticprivate |
string wowf.models.challenge.Challenge.__tablename__ = 'challenges' |
|
staticprivate |
tuple wowf.models.challenge.Challenge._creator = relationship('User', lazy='joined') |
|
staticprivate |
wowf.models.challenge.Challenge._creator |
|
private |
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 |
tuple wowf.models.challenge.Challenge.id = Column(Integer(unsigned=True), primary_key=True) |
|
static |
tuple wowf.models.challenge.Challenge.user_id = Column(Integer(unsigned=True), ForeignKey('users.id'), nullable=False) |
|
static |
Property Documentation
The documentation for this class was generated from the following file: