Skip to content

Commit

Permalink
Renamed Model.check method (#1559) (#1550)
Browse files Browse the repository at this point in the history
  • Loading branch information
abondar committed May 22, 2024
1 parent aea4c83 commit a5be9b6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Changed
- Change `utils.chunk` from function to return iterables lazily.
- Removed lower bound of id keys in generated pydantic models. (#1602)
- Rename Field initial arguments `pk`/`index` to `primary_key`/`db_index`. (#1621)
- Renamed `Model.check` method to `Model._check` to avoid naming collision issues (#1559) (#1550)

Breaking Changes
^^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Contributors
* ``@WizzyGeek``
* Ivan Pakeev ``@ipakeev``
* Abdeldjalil Hezouat ``@Abdeldjalil-H``
* Andrea Magistà ``@vlakius``

Special Thanks
==============
Expand Down
2 changes: 1 addition & 1 deletion tortoise/backends/base/schema_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def _get_models_to_create(self, models_to_create: "List[Type[Model]]") -> None:
for app in Tortoise.apps.values():
for model in app.values():
if model._meta.db == self.client:
model.check()
model._check()
models_to_create.append(model)

def get_create_schema_sql(self, safe: bool = True) -> str:
Expand Down
2 changes: 1 addition & 1 deletion tortoise/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ async def fetch_for_list(
await db.executor_class(model=cls, db=db).fetch_for_list(instance_list, *args)

@classmethod
def check(cls) -> None:
def _check(cls) -> None:
"""
Calls various checks to validate the model.
Expand Down

0 comments on commit a5be9b6

Please sign in to comment.