def __str__(self): date = self.date.strftime("%Y-%m-%d %H:%M") if self.comments: return "Purchase %s by %s at %s: %s" % (date, self.user, truncate(self.place), truncate(self.comments)) else: return "Purchase %s by %s at %s" % (date, self.user, truncate(self.place))
def __str__(self): date = self.date.strftime("%Y-%m-%d %H:%M") if self.comments: return "Update %s by %s: %s" % (date, self.user, truncate(self.comments)) else: return "Update %s by %s" % (date, self.user)