imization ticket
> to allow direct usage of Q objects for boolean field lookup right hand sides
>
> Cheers,
> Simon
>
> https://docs.djangoproject.com/en/3.0/ref/models/expressions/#django.db.models.ExpressionWrapper
>
> Le lundi 27 janvier 2020 14:32:24 UTC-5, Peter Law a écr
le = BooleanField()
>
> class Meta:
> constraints = [
>
> CheckConstraint(check=Q(is_on_sale=Q(price__lt=F('full_price'
> ]
>
> I haven't tried it myself but I would expect it to work on Django 3.0.
>
> Cheers,
> Simon
>
> Le lundi 2
/ref/models/expressions/#using-f-with-annotations
>
> Item.objects.annotate(is_on_sale=(F('price') < F('full_price')))
>
>
>
> On Mon, Jan 27, 2020 at 11:47 AM Peter Law >
> wrote:
>
>> Hi,
>>
>> Thanks for adding support for chec
Hi,
Thanks for adding support for check constraints in Django 2.2, it's
great to be able to move constraints into the model definitions.
I've been trying to work out how to express a constraint which
validates that the value of one field expresses a relation between two
other fields, but can't fi
4 matches
Mail list logo