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:
committed by
Mariusz Felisiak
parent
2f72480fbd
commit
31174031f1
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user