1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #30841 -- Deprecated using non-boolean values for isnull lookup.

This commit is contained in:
André Ericson
2019-10-11 20:10:31 +02:00
committed by Mariusz Felisiak
parent 2f72480fbd
commit 31174031f1
6 changed files with 59 additions and 1 deletions

View File

@@ -96,3 +96,15 @@ class Product(models.Model):
class Stock(models.Model):
product = models.ForeignKey(Product, models.CASCADE)
qty_available = models.DecimalField(max_digits=6, decimal_places=2)
class Freebie(models.Model):
gift_product = models.ForeignKey(Product, models.CASCADE)
stock_id = models.IntegerField(blank=True, null=True)
stock = models.ForeignObject(
Stock,
from_fields=['stock_id', 'gift_product'],
to_fields=['id', 'product'],
on_delete=models.CASCADE,
)