      from django.db.models.functions import Length, Upper
      from django.db.models.lookups import GreaterThan
  
      # Find companies that have more employees than chairs.
      Company.objects.filter(num_employees__gt=F('num_chairs'))
  
      # Find companies that have at least twice as many employees
      # as chairs. Both the querysets below are equivalent.
      Company.objects.filter(num_employees__gt=F('num_chairs') * 2)
      Company.objects.filter(
 
</s> remove     from django.db.models import Count, F, Value
    from django.db.models.functions import Length, Upper
    from django.db.models.lookups import GreaterThan
 </s> add     >>> from django.db.models import Count, F, Value
    >>> from django.db.models.functions import Length, Upper
    >>> from django.db.models.lookups import GreaterThan </s> remove     Company.objects.filter(num_employees__gt=F('num_chairs') * 2)
    Company.objects.filter(
        num_employees__gt=F('num_chairs') + F('num_chairs'))
 </s> add     >>> Company.objects.filter(num_employees__gt=F('num_chairs') * 2)
    >>> Company.objects.filter(
    ...     num_employees__gt=F('num_chairs') + F('num_chairs')) </s> remove .. code-block:: python
 </s> add .. code-block:: pycon </s> remove     * Both sides of a :class:`~django.db.models.ManyToManyField` relation::
 </s> add     * Both sides of a :class:`~django.db.models.ManyToManyField` relation
      :: </s> remove         # Your code here...
 </s> add         # Your code here
        ...
    >>> Company.objects.filter(num_employees__gt=F('num_chairs'))
      from django.db.models.functions import Length, Upper
      from django.db.models.lookups import GreaterThan
  
      # Find companies that have more employees than chairs.
    >>> Company.objects.filter(num_employees__gt=F('num_chairs'))
  
      # Find companies that have at least twice as many employees
      # as chairs. Both the querysets below are equivalent.
      Company.objects.filter(num_employees__gt=F('num_chairs') * 2)
      Company.objects.filter(
keep keep keep keep replace keep keep keep keep keep
 Refs #34140 -- Corrected rst code-block and various formatting issues in docs. 
docs/ref/models/expressions.txt