mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-24 10:34:10 +03:00
775d2e3523
* Update travis and tox * Use xenial distribution * Don't install coveralls twice * Add black and flake8 tox commands * Remove Python 3.5 test for Django master * Fix indent * Ignore migrations * Remove black for now * Run black formatting (#668) * Run black format * Update makefile * Add black to travis build
23 lines
504 B
Python
23 lines
504 B
Python
from django.db import models
|
|
|
|
|
|
class Category(models.Model):
|
|
class Meta:
|
|
verbose_name_plural = "Categories"
|
|
|
|
name = models.CharField(max_length=100)
|
|
|
|
def __str__(self):
|
|
return self.name
|
|
|
|
|
|
class Ingredient(models.Model):
|
|
name = models.CharField(max_length=100)
|
|
notes = models.TextField(null=True, blank=True)
|
|
category = models.ForeignKey(
|
|
Category, related_name="ingredients", on_delete=models.CASCADE
|
|
)
|
|
|
|
def __str__(self):
|
|
return self.name
|