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
Choice returns UnsupportedField when used with Field #619
Comments
Seems like a bug. Field and Schema use Generic which has an attribute choice, so it must work. |
It happens because of implementation of |
@cryocaustik Here is a workaround if you really need to use it: from mimesis.schema import Field, Schema
from mimesis.providers import Choice
class Choice(Choice):
def choice(self, *args, **kwargs):
return self.__call__(*args, **kwargs)
_ = Field('en', providers=(Choice,))
_('choice', items=[1, 3, 4]) |
Thanks! I ended doing something similar but with a custom provider. |
I would like to fix that bug and create a new release, but I'm really extremely busy, so I hope that I can fix it on weekends. |
So, this issue has been fixed. We will publish a release as soon as possible. |
It's done. 3.1.0 has been released. Thanks for the bug report! |
Bug report
What's wrong
I was attempting to use
choice
within Schema generation to pick from a list of options but ran into anUnsupportedField
error.It would appear that AbsrtractField returns UnsupportedField when used with on
Choice
provider.Example:
System information
Python version: 3.6.5
Mimesis version: 3.0.0
OS: Windows 10
The text was updated successfully, but these errors were encountered: