Skip to content

Instantly share code, notes, and snippets.

@klement97
Created January 4, 2021 21:05
Show Gist options
  • Save klement97/f1c6b931016f54f7e8d8cd47d8940d49 to your computer and use it in GitHub Desktop.
Save klement97/f1c6b931016f54f7e8d8cd47d8940d49 to your computer and use it in GitHub Desktop.
pizza = Pizza.objects.create(name='Margarita')
topping1 = Topping.objects.create(description='Pizza sauce', price=1.5)
topping2 = Topping.objects.create(description='Mozzarella', price=1.65)
pizza.toppings.add(topping1)
pizza.toppings.add(topping2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment