Skip to content

Commit

Permalink
Fixes stravalib#90 and re-added __repr__ to Athlete model
Browse files Browse the repository at this point in the history
  • Loading branch information
hozn committed Aug 31, 2016
1 parent c430ffd commit ac292a1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Changes

.. contents::

0.6.2
-----
* More Python3 bugfixes

0.6.1
-----
* Python3 bugfixes (Tafkas, martinogden)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pip.req import parse_requirements
from setuptools import setup, find_packages

version = '0.6.1'
version = '0.6.2'

news = os.path.join(os.path.dirname(__file__), 'docs', 'news.rst')
news = open(news).read()
Expand Down
2 changes: 1 addition & 1 deletion stravalib/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def type(self):

@type.setter
def type(self, v):
if isinstance(v, (str, bytes, unicode)):
if isinstance(v, (six.text_type, six.binary_type)):
# Supporting lazy class referencing
self._lazytype = v
else:
Expand Down
9 changes: 7 additions & 2 deletions stravalib/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,16 @@ class Athlete(LoadableEntity):
_stats = None
_is_authenticated = None

def __unicode__(self):
return u'<Athlete id={id} firstname={fname} lastname={lname}>'.format(id=self.id,
def __str__(self):
return '<Athlete id={id} firstname={fname} lastname={lname}>'.format(id=self.id,
fname=self.firstname,
lname=self.lastname)

def __repr__(self):
return '<Athlete id={id} firstname={fname!r} lastname={lname!r}>'.format(id=self.id,
fname=self.firstname,
lname=self.lastname)

def is_authenticated_athlete(self):
"""
:return: Boolean as to whether the athlete is the authenticated athlete.
Expand Down

0 comments on commit ac292a1

Please sign in to comment.