-
Notifications
You must be signed in to change notification settings - Fork 828
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
Include extra data in Meta in _meta #1328
base: master
Are you sure you want to change the base?
Include extra data in Meta in _meta #1328
Conversation
88720b3
to
d707459
Compare
Hey, could anyone have a look on this? |
Now the tests are broken... I have no idea, why... |
Codecov Report
@@ Coverage Diff @@
## master #1328 +/- ##
=======================================
Coverage 95.44% 95.45%
=======================================
Files 49 49
Lines 1582 1583 +1
=======================================
+ Hits 1510 1511 +1
Misses 72 72
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -43,6 +43,7 @@ def __init_subclass_with_meta__( | |||
return | |||
_meta.name = name or cls.__name__ | |||
_meta.description = description or trim_docstring(cls.__doc__) | |||
_meta.extra = _kwargs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the extra
field should be an explicit class attribute of the BaseOptions
class so that it can be properly documented. Otherwise users will be confused about the meaning or the purpose/won't find it at all. LMK what you think.
I'm building an authorization middleware and I want to include functions/data in the Meta class to store the relevant information in the class itself.
However, all custom args in Meta are dropped at the moment.
I think there shouldn't be an issue to include other args in an extra attribute of _meta.