Initial version of workout choice field
This commit is contained in:
@@ -398,17 +398,23 @@ class Workout(models.Model):
|
||||
privacy = models.CharField(default='visible',max_length=30,
|
||||
choices=privacychoices)
|
||||
|
||||
def __str__(self):
|
||||
def __unicode__(self):
|
||||
|
||||
date = self.date
|
||||
name = self.name
|
||||
distance = str(self.distance)
|
||||
ownerfirst = self.user.user.first_name
|
||||
ownerlast = self.user.user.last_name
|
||||
duration = self.duration
|
||||
|
||||
try:
|
||||
stri = date.strftime('%Y-%m-%d')+'_'+name
|
||||
except AttributeError:
|
||||
stri = str(date)+'_'+name
|
||||
|
||||
|
||||
stri = u'{d}_{n}_{dist}m_{duration:%H:%M:%S}_{ownerfirst}_{ownerlast}'.format(
|
||||
d = date.strftime('%Y-%m-%d'),
|
||||
n = name,
|
||||
dist = distance,
|
||||
duration = duration,
|
||||
ownerfirst = ownerfirst,
|
||||
ownerlast = ownerlast,
|
||||
)
|
||||
|
||||
return stri
|
||||
|
||||
@@ -890,7 +896,7 @@ class WorkoutComment(models.Model):
|
||||
|
||||
def __unicode__(self):
|
||||
return u'Comment to: {w} by {u1} {u2}'.format(
|
||||
w=self.workout.name,
|
||||
w=self.workout,
|
||||
u1 = self.user.first_name,
|
||||
u2 = self.user.last_name,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user