Merge branch 'master' into m2m_fields
This commit is contained in:
@ -58,7 +58,7 @@ async def shutdown() -> None:
|
|||||||
|
|
||||||
Define ormar models with appropriate fields.
|
Define ormar models with appropriate fields.
|
||||||
|
|
||||||
Those models will be used insted of pydantic ones.
|
Those models will be used instead of pydantic ones.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
class Category(ormar.Model):
|
class Category(ormar.Model):
|
||||||
|
|||||||
@ -68,7 +68,7 @@ class UndefinedType: # pragma no cover
|
|||||||
|
|
||||||
Undefined = UndefinedType()
|
Undefined = UndefinedType()
|
||||||
|
|
||||||
__version__ = "0.9.4"
|
__version__ = "0.9.5"
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"Integer",
|
"Integer",
|
||||||
"BigInteger",
|
"BigInteger",
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import inspect
|
||||||
from typing import Any, List, Optional, TYPE_CHECKING, Type, Union
|
from typing import Any, List, Optional, TYPE_CHECKING, Type, Union
|
||||||
|
|
||||||
import sqlalchemy
|
import sqlalchemy
|
||||||
|
|||||||
@ -73,7 +73,9 @@ def create_dummy_model(
|
|||||||
"".join(choices(string.ascii_uppercase, k=2)) + uuid.uuid4().hex[:4]
|
"".join(choices(string.ascii_uppercase, k=2)) + uuid.uuid4().hex[:4]
|
||||||
).lower()
|
).lower()
|
||||||
fields = {f"{pk_field.name}": (pk_field.__type__, None)}
|
fields = {f"{pk_field.name}": (pk_field.__type__, None)}
|
||||||
|
|
||||||
dummy_model = create_model( # type: ignore
|
dummy_model = create_model( # type: ignore
|
||||||
|
|
||||||
f"PkOnly{base_model.get_name(lower=False)}{alias}",
|
f"PkOnly{base_model.get_name(lower=False)}{alias}",
|
||||||
__module__=base_model.__module__,
|
__module__=base_model.__module__,
|
||||||
**fields, # type: ignore
|
**fields, # type: ignore
|
||||||
|
|||||||
@ -98,7 +98,7 @@ def populate_pydantic_default_values(attrs: Dict) -> Tuple[Dict, Dict]:
|
|||||||
BaseField class.
|
BaseField class.
|
||||||
|
|
||||||
Trigger conversion of ormar field into pydantic FieldInfo, which has all needed
|
Trigger conversion of ormar field into pydantic FieldInfo, which has all needed
|
||||||
paramaters saved.
|
parameters saved.
|
||||||
|
|
||||||
Overwrites the annotations of ormar fields to corresponding types declared on
|
Overwrites the annotations of ormar fields to corresponding types declared on
|
||||||
ormar fields (constructed dynamically for relations).
|
ormar fields (constructed dynamically for relations).
|
||||||
|
|||||||
3
setup.py
3
setup.py
@ -45,7 +45,8 @@ setup(
|
|||||||
description="A simple async ORM with fastapi in mind and pydantic validation.",
|
description="A simple async ORM with fastapi in mind and pydantic validation.",
|
||||||
long_description=get_long_description(),
|
long_description=get_long_description(),
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
keywords=['orm', 'sqlalchemy', 'fastapi', 'pydantic', 'databases', 'async', 'alembic'],
|
keywords=['orm', 'sqlalchemy', 'fastapi', 'pydantic', 'databases', 'async',
|
||||||
|
'alembic'],
|
||||||
author="Radosław Drążkiewicz",
|
author="Radosław Drążkiewicz",
|
||||||
author_email="collerek@gmail.com",
|
author_email="collerek@gmail.com",
|
||||||
packages=get_packages(PACKAGE),
|
packages=get_packages(PACKAGE),
|
||||||
|
|||||||
Reference in New Issue
Block a user