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

Pass through of SQLAlchemy relationship list #86

Open
miohtama opened this issue May 4, 2015 · 3 comments
Open

Pass through of SQLAlchemy relationship list #86

miohtama opened this issue May 4, 2015 · 3 comments

Comments

@miohtama
Copy link

miohtama commented May 4, 2015

Is it possible to pass through SQLAlchemy objects without dictifying them from relationship where uselist=True ? I need this for complexish relationship widgets which needs to get the hold of the actual SQLAlchemy objects instead of converting them to dictionary and back.

I am not sure

  • If it is possible
  • How it is possible (as this is not clearly explained in documentation)
@miohtama
Copy link
Author

miohtama commented May 4, 2015

I kind of figured out a super hacky way to do this, but I hope if there is a real way to do before unleashing the ugliness to public world.

@tisdall
Copy link
Collaborator

tisdall commented May 5, 2015

I haven't done much with relationships, but you could take a look at https://github.com/stefanofontanelli/DeformAlchemy/blob/master/deformalchemy/widget.py for an example of a widget making direct use of the sqla object. Basically the widget gets passed the object when it's created and then a later call to populate() makes sqla queries to fill the values in on the widget.

@miohtama
Copy link
Author

miohtama commented May 6, 2015

Perfect! With a quick look it looks like much cleaner what I was doing.

I'll check deformalchemy and close this issue if it is what I was looking for.

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

2 participants