projects
/
climbing.kerkeslager.com
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Admin interface for nutrition and training
[climbing.kerkeslager.com]
/
src
/
nutrition
/
models.py
diff --git
a/src/nutrition/models.py
b/src/nutrition/models.py
index
ba7d415
..
67ccd61
100644
(file)
--- a/
src/nutrition/models.py
+++ b/
src/nutrition/models.py
@@
-1,6
+1,9
@@
from django.db import models
class Food(models.Model):
from django.db import models
class Food(models.Model):
- name = models.
Text
Field(max_length=64)
- brand = models.
Text
Field(max_length=64)
+ name = models.
Char
Field(max_length=64)
+ brand = models.
Char
Field(max_length=64)
calories = models.PositiveIntegerField()
calories = models.PositiveIntegerField()
+
+ def __str__(self):
+ return '{} ({})'.format(self.name, self.brand)