Skip to content

how to use custom provider in Field object #1086

Closed Answered by lk-geimfari
ilia4bit asked this question in Q&A
Discussion options

You must be logged in to vote

You can pass a sequence (list, tuple, etc.) of the custom providers: https://mimesis.name/api.html#field

Like this:

class Custom(BaseProvider):
    class Meta:
          name = 'custom'

_ = Field(locale=en, providers=[Custom])
desc = (lambda: {'custom': _('custom.some_method', generic_class=generic)})
schema = Schema(schema=desc)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ilia4bit
Comment options

Answer selected by ilia4bit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question The question
2 participants