python - Does with_entities result in smaller objects? -


when need column values , don't need else provided model, use with_entities , iterate on tuple-like sqlalchemy.util._collections.result objects result.

am correct these objects smaller full-blown model objects otherwise getting?

example:

models = thing.query.filter_by(user_id=3).all() type(models[0]) # => project.models.thing # # vs # tuples = thing.query.with_entities(thing.id).filter_by(user_id=3).all() type(tuples[0]) # => sqlalchemy.util._collections.result 


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -