Merge branch 'master' into m2m_fields

This commit is contained in:
collerek
2021-03-05 18:13:54 +07:00
committed by GitHub
6 changed files with 9 additions and 5 deletions

View File

@ -68,7 +68,7 @@ class UndefinedType: # pragma no cover
Undefined = UndefinedType()
__version__ = "0.9.4"
__version__ = "0.9.5"
__all__ = [
"Integer",
"BigInteger",

View File

@ -1,3 +1,4 @@
import inspect
from typing import Any, List, Optional, TYPE_CHECKING, Type, Union
import sqlalchemy

View File

@ -73,7 +73,9 @@ def create_dummy_model(
"".join(choices(string.ascii_uppercase, k=2)) + uuid.uuid4().hex[:4]
).lower()
fields = {f"{pk_field.name}": (pk_field.__type__, None)}
dummy_model = create_model( # type: ignore
f"PkOnly{base_model.get_name(lower=False)}{alias}",
__module__=base_model.__module__,
**fields, # type: ignore

View File

@ -98,7 +98,7 @@ def populate_pydantic_default_values(attrs: Dict) -> Tuple[Dict, Dict]:
BaseField class.
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
ormar fields (constructed dynamically for relations).