From 7ef35a6b53d27dcfc18cc2b236201088e51c7096 Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Sun, 1 Jan 2017 17:29:12 -0600 Subject: [PATCH] Sensbile string representation --- bikeshop_project/core/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bikeshop_project/core/models.py b/bikeshop_project/core/models.py index d167290..75e3cb9 100644 --- a/bikeshop_project/core/models.py +++ b/bikeshop_project/core/models.py @@ -69,3 +69,7 @@ class Visit(models.Model): ) created_at = models.DateTimeField(auto_now_add=True) purpose = models.CharField(max_length=50, choices=visit_choices) + + def __str__(self): + return ''.format(purpose=self.purpose, + created_at=self.created_at.isoformat())