- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for get_model_fields (0.13 sec)
-
tests/test_compat.py
class Model(BaseModel): foo: Union[str, Dict[str, Any]] fields = get_model_fields(Model) assert not is_scalar_field(fields[0]) def test_get_model_fields_cached(): class Model(BaseModel): foo: str non_cached_fields = get_model_fields(Model) non_cached_fields2 = get_model_fields(Model) cached_fields = get_cached_model_fields(Model)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Sep 11 07:45:30 UTC 2024 - 3.5K bytes - Viewed (0) -
fastapi/_compat.py
BodyModel: Type[BaseModel] = create_model(model_name, **field_params) # type: ignore[call-overload] return BodyModel def get_model_fields(model: Type[BaseModel]) -> List[ModelField]: return [ ModelField(field_info=field_info, name=name) for name, field_info in model.model_fields.items() ] else:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Oct 12 09:36:32 UTC 2024 - 23.4K bytes - Viewed (0)