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

Each provider must contain metadata for internal usage #621

Closed
lk-geimfari opened this issue Jan 30, 2019 · 1 comment
Closed

Each provider must contain metadata for internal usage #621

lk-geimfari opened this issue Jan 30, 2019 · 1 comment
Assignees
Labels
enhancement Enhancement proposals
Milestone

Comments

@lk-geimfari
Copy link
Owner

lk-geimfari commented Jan 30, 2019

Each provider must contain metadata for internal usage. We currently use such data on creating a custom provider, but we need to add Meta for all providers.

It will look like this:

class MyProvider(BaseProvider):
    class Meta:
        name = 'my_provider'
    
    def hi():
        return 'Hi'

To use it in the schema and generic like this:

>>> generic.add_provider(MyProvider)
>>> generic.my_provider.hi()

Related issue: #619

@lk-geimfari lk-geimfari added the enhancement Enhancement proposals label Jan 30, 2019
@lk-geimfari lk-geimfari self-assigned this Jan 30, 2019
@lk-geimfari lk-geimfari added this to the Version 4.0.0 milestone Mar 16, 2019
@lk-geimfari
Copy link
Owner Author

lk-geimfari commented Mar 17, 2019

Fixed, 8d2b7ca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement proposals
Projects
None yet
Development

No branches or pull requests

1 participant