      >>> from django import forms
      >>> from django.utils.html import html_safe
      >>>
      >>> @html_safe
      >>> class JSPath:
      ...     def __str__(self):
      ...         return '<script src="https://example.org/asset.js" rel="stylesheet">'
  
      >>> class SomeWidget(forms.TextInput):
      ...     class Media:
 
</s> remove         >>> file_data = {'img': SimpleUploadedFile('test.png', <file data>)}
 </s> add         >>> file_data = {'img': SimpleUploadedFile('test.png', b"file data")} </s> remove     >>>     avg_rating=Window(
    >>>         expression=Avg('rating'),
    >>>         partition_by=[F('studio'), F('genre')],
    >>>         order_by='released__year',
    >>>         frame=ValueRange(start=-12, end=12),
    >>>     ),
    >>> )
 </s> add     ...     avg_rating=Window(
    ...         expression=Avg('rating'),
    ...         partition_by=[F('studio'), F('genre')],
    ...         order_by='released__year',
    ...         frame=ValueRange(start=-12, end=12),
    ...     ),
    ... ) </s> remove     >>>    'partition_by': [F('studio'), F('genre')],
    >>>    'order_by': 'released__year',
    >>> }
 </s> add     ...    '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     >>>     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',
    ...     ),
    ... )
    ... class JSPath:
      >>> from django import forms
      >>> from django.utils.html import html_safe
      >>>
      >>> @html_safe
    ... class JSPath:
      ...     def __str__(self):
      ...         return '<script src="https://example.org/asset.js" rel="stylesheet">'
  
      >>> class SomeWidget(forms.TextInput):
      ...     class Media:
keep keep keep keep replace keep keep keep keep keep
 Refs #34140 -- Corrected rst code-block and various formatting issues in docs. 
docs/topics/forms/media.txt