Skip to content

Instantly share code, notes, and snippets.

@toxinu
Created September 24, 2020 01:23
Show Gist options
  • Select an option

  • Save toxinu/67504abbff4a0eefda4152e65c94e4c0 to your computer and use it in GitHub Desktop.

Select an option

Save toxinu/67504abbff4a0eefda4152e65c94e4c0 to your computer and use it in GitHub Desktop.
blog/filtering-and-ordering-with-restless
from django.db import models
class Pizza(models.Model):
name = models.CharField(max_length=100)
price = models.FloatField()
is_vegetarian = models.BooleanField(default=False)
class Ingredient(models.Model):
name = models.CharField(max_length=100)
class PizzaIngredient(models.Model):
pizza = models.ForeignKey('Pizza', related_name='ingredients')
ingredient = models.ForeignKey('Ingredient')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment