11 lines
354 B
Python
11 lines
354 B
Python
|
|
__all__ = ['RequestParamMixin']
|
||
|
|
|
||
|
|
class RequestParamMixin:
|
||
|
|
"""Resolve a named parameter from the query string, falling back to the request body."""
|
||
|
|
|
||
|
|
def _get_param(self, name: str) -> str | None:
|
||
|
|
value = self.request.query_params.get(name)
|
||
|
|
if not value:
|
||
|
|
value = self.request.data.get(name)
|
||
|
|
return value or None
|