diff --git a/beer/models.py b/beer/models.py index dd9e54b..efe4aa5 100644 --- a/beer/models.py +++ b/beer/models.py @@ -50,9 +50,15 @@ class Unit(CustomModel): name = models.CharField(max_length=50) unit_type = models.CharField(max_length=3, choices=unit_types, default='WT') + def __str__(self): + return self.name + class Supplier(CustomModel): name = models.CharField(max_length=50) - + + def __str__(self): + return self.name + class CustomIngredient(CustomModel): """ Custom model class with default fields to use. """ created_date = models.DateTimeField(default=timezone.now) @@ -171,6 +177,9 @@ class RecipeMisc(CustomModel): misc = models.ForeignKey(Misc, on_delete=models.CASCADE) quantity = models.DecimalField(max_digits=6, decimal_places=4) + def __str__(self): + return self.name + class RecipeYeast(CustomModel): recipe = models.ForeignKey(BatchRecipe, on_delete=models.CASCADE) yeast = models.ForeignKey('yeast.Strain', on_delete=models.CASCADE)