Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type support and mypy checking #100

Merged
merged 22 commits into from
Oct 5, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't use test class in main code!
  • Loading branch information
palfrey committed Sep 5, 2020
commit f48ade21b6cc9333d20f751e5dd4af3e48556809
4 changes: 1 addition & 3 deletions model_bakery/baker.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
)
from django.db.models.fields.reverse_related import ManyToOneRel, OneToOneRel

from tests.generic.fields import CustomForeignKey

from . import generators, random_gen
from .exceptions import (
AmbiguousModelName,
Expand Down Expand Up @@ -493,7 +491,7 @@ def _handle_m2m(self, instance: Model):
make(through_model, **base_kwargs)

def _remote_field(
self, field: Union[CustomForeignKey, ForeignKey, OneToOneField]
self, field: Union[ForeignKey, OneToOneField]
) -> Union[OneToOneRel, ManyToOneRel]:
return field.remote_field

Expand Down