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
Clarify what app.config.from_object accepts #1457
Comments
from_object doesn't read from dictionary keys, instead it traverses This is something that should be clarified in the docs though. |
Thanks for getting back so quickly I happen to be working inside of a larger example that should be turning the dict into an attribute dict. Let me look closer to verify that functionality is working as expected. edited |
Could you post a link to that example? AFAIK from_object was never supposed to work that way. |
Yeah, it may be a bigger oversight on part. Checking it. |
What I was doing is totally wrong then.
If I wanted to go that approach, I think my only option to write my own config parser. |
According to the code above, |
class AttributeDict(dict):
def __getattr__(self, name):
if not name in self:
raise AttributeError("'{}' object has no attribute '{}'".format(
self.__class__,
name,
))
return self[name] |
Removed the Perhaps if I gave the |
You could also just set your attributes on your AttributeDict instance instead of defining |
…, move current_dir objects to root. pallets/flask#1457
looking at this for #pycon2016 sprints |
Expected behavior would be to accept to setting in the flask application object.
The text was updated successfully, but these errors were encountered: