X-Git-Url: https://code.kerkeslager.com/?p=climbing.kerkeslager.com;a=blobdiff_plain;f=src%2Fnutrition%2Fmodels.py;h=67ccd61d22d86d077bca4f2294f884ba925eba35;hp=ba7d41551d67145cd99dd33efbfa568aefb0b1a5;hb=dd2225e0e296d6c6a5f37d75242abaaeb4c3db33;hpb=d468f7a76724652dab912b13ee9242d9b220d961 diff --git a/src/nutrition/models.py b/src/nutrition/models.py index ba7d415..67ccd61 100644 --- a/src/nutrition/models.py +++ b/src/nutrition/models.py @@ -1,6 +1,9 @@ from django.db import models class Food(models.Model): - name = models.TextField(max_length=64) - brand = models.TextField(max_length=64) + name = models.CharField(max_length=64) + brand = models.CharField(max_length=64) calories = models.PositiveIntegerField() + + def __str__(self): + return '{} ({})'.format(self.name, self.brand)