File: models.py

package info (click to toggle)
strawberry-graphql-django 0.62.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,968 kB
  • sloc: python: 27,530; sh: 17; makefile: 16
file content (16 lines) | stat: -rw-r--r-- 331 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from django.db import models


class Fruit(models.Model):
    name = models.CharField(max_length=20)
    color = models.ForeignKey(
        "Color",
        blank=True,
        null=True,
        related_name="fruits",
        on_delete=models.CASCADE,
    )


class Color(models.Model):
    name = models.CharField(max_length=20)