@@ 1,6 1,7 @@
import datetime
from . import constants
from .utils import pull_date
+from .exceptions import TinderError
class FieldDescriptor(object):
@@ 171,6 172,25 @@ class User(BaseModel):
def distance(self):
return self._data.get('distance_mi', self._data.get('distance_km', 0))
+ @property
+ def jobs(self):
+ return [
+ [
+ job.get('title', {}).get('name', None),
+ job['company']['name']
+ ] for job in self._data.get('jobs', [])
+ ]
+
+ @property
+ def jobs_pretty(self):
+ return [
+ u'{0} @ {1}'.format(x[0] or u'Untitled', x[1]) for x in self.jobs
+ ]
+
+ @property
+ def schools(self):
+ return [x['name'] for x in self._data.get('schools', [])]
+
def like(self):
return self._api.like(self.id)
@@ 208,6 228,15 @@ class Profile(User):
def matches(self, since_date=None):
return self._api.matches(since_date=since_date)
+ def like(self):
+ raise TinderError('You can\'t like yourself')
+
+ def super_like(self):
+ raise TinderError('You can\'t super like yourself')
+
+ def nope(self):
+ raise TinderError('You can\'t dislike yourself')
+
def __unicode__(self):
return u'Profile: {name}'.format(name=self.name)