      from django.db.models import Field
  
      @Field.register_lookup
      class NotEqualLookup(Lookup):
          # ...
  
  We can now use ``foo__ne`` for any field ``foo``. You will need to ensure that
  this registration happens before you try to create any querysets using it. You
  could place the implementation in a ``models.py`` file, or register the lookup
  in the ``ready()`` method of an ``AppConfig``.
 
</s> remove 32-bit, 8 character digest in the constraint name; for example::
 </s> add 32-bit, 8 character digest in the constraint name; for example:

.. code-block:: sql </s> remove     >>>     avg_rating=Window(
    >>>         expression=Avg('rating'),
    >>>         partition_by=[F('studio'), F('genre')],
    >>>         order_by='released__year',
    >>>     ),
    >>> )
 </s> add     ...     avg_rating=Window(
    ...         expression=Avg('rating'),
    ...         partition_by=[F('studio'), F('genre')],
    ...         order_by='released__year',
    ...     ),
    ... ) </s> remove     >>>     p2.restaurant
    >>> except ObjectDoesNotExist:
    >>>     print("There is no restaurant here.")
 </s> add     ...     p2.restaurant
    ... except ObjectDoesNotExist:
    ...     print("There is no restaurant here.") </s> remove explaining how this would work for a dynamically generated web page::
 </s> add explaining how this would work for a dynamically generated web page:

.. code-block:: text </s> remove 2-tuple containing::
 </s> add 2-tuple containing:

.. code-block:: text
        ...
      from django.db.models import Field
  
      @Field.register_lookup
      class NotEqualLookup(Lookup):
        ...
  
  We can now use ``foo__ne`` for any field ``foo``. You will need to ensure that
  this registration happens before you try to create any querysets using it. You
  could place the implementation in a ``models.py`` file, or register the lookup
  in the ``ready()`` method of an ``AppConfig``.
keep keep keep keep replace keep keep keep keep keep
 Refs #34140 -- Corrected rst code-block and various formatting issues in docs. 
docs/howto/custom-lookups.txt