Commit Graph
6 Commits
Author SHA1 Message Date
rolandcrosby-check 30bf4dab6c Update media render return values to SafeString (#923) 2022-04-14 23:53:52 +03:00
rolandcrosby-check 850df1655a Make formfield_from_dbfield return forms.Field instead of models.Field (#857) 2022-02-22 20:44:44 +03:00
rolandcrosby-check 5d3768e593 Allow *args to be Any for generic views (#831) 2022-01-26 10:00:26 +03:00
rolandcrosby-check 1da693ebff Fix extra_context argument type in admin views (#816)
The `extra_context` argument to `ModelAdmin.changeform_view`,
`add_view`, `change_view`, `changelist_view`, `delete_view`, and
`history_view` is used to pass extra context variables to a template, so
all of these arguments should have type `Optional[Dict[str, Any]]`.
Instead, these are currently typed as `Optional[Dict[str, bool]]`,
`Optional[Dict[str, str]]`, or `None`.
2022-01-13 23:03:03 +03:00
rolandcrosby-check 3c1e9e3884 Allow Iterable[Iterable[Any]] as args_generator argument to format_html_join (#722)
* Allow List[Tuple[Any]] as args_generator argument to format_html_join

format_html_join's args_generator argument can be anything that contains
tuples of things that can be coerced to strings or that have a
`__html__` method.

Fixes #721.

* Use `Iterable[Iterable[Any]]` as `args_generator` type

* Run linter
2022-01-12 09:44:14 +03:00
rolandcrosby-check 7701957e4f Fix annotation of ModelAdmin.get_object (#812)
* Fix annotation of ModelAdmin.get_object

The type annotation in django-stubs indicated that the type of the
`from_field` argument to `ModelAdmin.get_object` should be `None`. In
fact, `None` is the default value of that argument. If the argument is
not `None`, [it is passed to a model's `_meta.get_field` method][impl], which
takes an argument of type `Union[Callable[..., Any], str`.

[impl]: https://github.com/django/django/blob/ac5cc6cf01463d90aa333d5f6f046c311019827b/django/contrib/admin/options.py#L767

* Fix formatting
2022-01-08 10:48:29 +03:00