Update version 1.8.1
This commit is contained in:
parent
145d2fc0f2
commit
7492af5acf
@ -137,8 +137,11 @@ the List type
|
|||||||
|
|
||||||
.. code-block:: python3
|
.. code-block:: python3
|
||||||
|
|
||||||
|
from typing import List
|
||||||
|
from pydantic import Field
|
||||||
|
|
||||||
class AccountView(PydanticView):
|
class AccountView(PydanticView):
|
||||||
async def get(self, tags: List[str] = []):
|
async def get(self, tags: List[str] = Field(default_factory=list)):
|
||||||
...
|
...
|
||||||
|
|
||||||
app = web.Application()
|
app = web.Application()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from .view import PydanticView
|
from .view import PydanticView
|
||||||
|
|
||||||
__version__ = "1.8.0"
|
__version__ = "1.8.1"
|
||||||
|
|
||||||
__all__ = ("PydanticView", "__version__")
|
__all__ = ("PydanticView", "__version__")
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from typing import Optional, List
|
from typing import Optional, List
|
||||||
|
from pydantic import Field
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
|
||||||
from aiohttp_pydantic import PydanticView
|
from aiohttp_pydantic import PydanticView
|
||||||
@ -11,7 +11,7 @@ class ArticleView(PydanticView):
|
|||||||
with_comments: bool,
|
with_comments: bool,
|
||||||
age: Optional[int] = None,
|
age: Optional[int] = None,
|
||||||
nb_items: int = 7,
|
nb_items: int = 7,
|
||||||
tags: List[str] = [],
|
tags: List[str] = Field(default_factory=list)
|
||||||
):
|
):
|
||||||
return web.json_response(
|
return web.json_response(
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user