I am completely new to Django, so forgive me if this is the wrong approach. While I'm trying to learn Django, I like to do my own little practice problems to solidify my understanding.
Working with models I created the example model objects:
from django.db import models
class Food(models.Model):
name = models.CharField(
max_length=50,
help_text="Name of Fruit or Vegetable"
)
food_group = models.CharField(
max_length=9,
class Vitamins(models.Model):
name = models.ForeignKey(
Food,
on_delete=models.CASCADE
)
vitamin_A = models.CharField(
max_length=20,
)
.
.
.
folate = models.CharField(
max_length=20,
help_text="Folic Acid"
)
In my object, I have 5 identical fields that store text i.e. (Trace amounts, 5mg, No Information). However it seems tedious to type out every field. Is there a more efficient way to do this?