﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30915	Implication for Q object	Bartłomiej Biernacki	Bartłomiej Biernacki	"Starting with Django 2.2 we have CheckConstraints where we can use `Q` objects to create Database level checks. 
I found that it's common to have some conditional check constrains i.e. ""if some field_a has value 'x'  then field_b have value greater than 0"". 
In basic logic we can write this as `p => q` which can be translated to `~p or q`. 
Using Django `Q` we can write this constraints as `~Q(field='x') or Q(field_b__gt=0)`.
While this serves the purpose it might be more readable if we will have a dedicated ""implication"" function.

I propose to use binary operator `>>` for that purpose, so in Django `Q` we could write a `Q(field='x') >> Q(field_b__gt=0)` which in mine opinion looks much more readable and can encourage people to use more database level constratins in their projects

I have provided a patch with this functionality: https://github.com/django/django/pull/11978
If this will be accepted I will add documentation to it."	New feature	assigned	Database layer (models, ORM)	dev	Normal				Unreviewed	0	0	0	0	0	0
