We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
had a real world example of a using-scope vs data structures outside of scope pop up
thought it might be helpful to rework for cookbook or docs -- showing a relatively simple case how both approaches work
def totally_outside_glom(): models = queryset() models_by_id = { model.id: model for model in models} values = models.values('id', 'bar') for valdict in values: valdict['model'] = models_by_id[val_dict[['id']]] glom(values, [{ 'foo': ('model.foo', T()), 'bar': 'bar' }]) def using_scope(): models = queryset() values = models.values('id', 'bar') glom(values, [{ 'foo': S['models-by-id'][T['id']].foo(), 'bar': 'bar', }], scope={ 'models-by-id': { model.id: model for model in models} } )
maybe it could be pushed even further down into the scope
The text was updated successfully, but these errors were encountered:
neither approach is really perfect, they both have a little bit of rough edges
Sorry, something went wrong.
No branches or pull requests
had a real world example of a using-scope vs data structures outside of scope pop up
thought it might be helpful to rework for cookbook or docs -- showing a relatively simple case how both approaches work
maybe it could be pushed even further down into the scope
The text was updated successfully, but these errors were encountered: