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

Returning as dict #47

Closed
JosephShering opened this issue Nov 21, 2013 · 8 comments
Closed

Returning as dict #47

JosephShering opened this issue Nov 21, 2013 · 8 comments

Comments

@JosephShering
Copy link

I would really like it if object were returned instead of dictionaries, it would make looping over the results a lot easier

@ToffeeCrunch
Copy link

What do you mean? Could you give an example of what you would like and how it looks now?

@pudo
Copy link
Owner

pudo commented Nov 22, 2013

+1 on @ToffeeCrunch's suggestion. We can probably have a constructor argument where you pass in a class that overrides getattr, is that what you mean?

@sbirch
Copy link

sbirch commented Dec 19, 2013

This would also be nice to support indexing the columns in order (with a different kind of class, of course). Right now AFAIK it's not possible to know what the original key order is.

@gka
Copy link
Collaborator

gka commented Dec 19, 2013

@sbirch that would be possible by returning OrderedDicts instead of dicts.. Actually a good idea I think.

@gka
Copy link
Collaborator

gka commented Dec 19, 2013

OrderedDict support added in branch ordered-dicts

@sbirch
Copy link

sbirch commented Dec 20, 2013

Woohoo! That will be very useful to me. Though I still think there's value in @JosephShering's original suggestion, as it provides the flexibility to do things like what you did without forking it. (Attribute accessors would be very nice too, for example.)

@stefanw
Copy link
Collaborator

stefanw commented Jan 31, 2014

FYI: right now SQLAlchemy's RowProxy objects are returned that mostly behave like ordered dicts.

@pudo
Copy link
Owner

pudo commented May 21, 2015

It's OrderedDict now.

@pudo pudo closed this as completed May 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants