From 69d110c5ab78f1c75d427f1711bb3bc0528b5c8f Mon Sep 17 00:00:00 2001 From: Ron Date: Mon, 23 Nov 2020 14:42:08 +0100 Subject: [PATCH] #124: Corrected type hint for recipe param "_model" (#128) * #124: Corrected type hint for recipe param "_model" * #124: Added changelog entry --- CHANGELOG.md | 2 ++ model_bakery/recipe.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ab2a9a7..a4f4b411 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed +- Type hinting fixed for Recipe "_model" parameter + ### Removed diff --git a/model_bakery/recipe.py b/model_bakery/recipe.py index 069c573d..51fbddfe 100644 --- a/model_bakery/recipe.py +++ b/model_bakery/recipe.py @@ -2,7 +2,6 @@ from typing import Any, Dict, List, Type, Union, cast from django.db.models import Model -from django.db.models.base import ModelBase from . import baker from .exceptions import RecipeNotFound @@ -15,7 +14,7 @@ class Recipe(object): - def __init__(self, _model: Union[str, Type[ModelBase]], **attrs) -> None: + def __init__(self, _model: Union[str, Type[Model]], **attrs) -> None: self.attr_mapping = attrs self._model = _model # _iterator_backups will hold values of the form (backup_iterator, usable_iterator).