mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 13:14:30 +03:00
c7acdd6006
In the "Creating custom mixins" documentation, the code example recommends using ```python if self.kwargs[field] ``` However, if the correct field is not present in kwargs, a KeyError arises. A more secure option is tu use .get() to validate that the field is contained in the kwargs dictionary: ```python if self.kwargs.get(field) ``` |
||
---|---|---|
.. | ||
api-guide | ||
community | ||
coreapi | ||
img | ||
topics | ||
tutorial | ||
CNAME | ||
index.md |