-
Notifications
You must be signed in to change notification settings - Fork 13
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
Editing individual entries from the API #155
Comments
@PhatWabbit - I'm not sure we built out all of the update functions on the API yet. We focused first on the read and create functions. @emiliom and @lsetiawan - do you have any additional thoughts on this? |
That's correct. The My suggestion would be to reuse the connection setup at the start of an odm2api session, then construct and issue a direct from odm2api.ODMconnection import dbconnection
session_factory = dbconnection.createConnection('postgresql', **db_cred)
DBSession = session_factory.getSession()
sq_str = " UPDATE mytable SET variablecode = 'xyz' WHERE variablecode = 'abc' "
DBSession.execute(sql_str)
DBSession.commit() |
We should probably close this issue. @aufdenkampe and @horsburgh, what do you think? If you think the code snippet I included is useful enough, we could think about folding it somewhere into the Sphinx documentation. |
@emiliom, I like your idea of including your #155 (comment) into the Sphinx documentation. I was recently looking at this with @roelofversteeg and @erekalper and noticing that those functions were indeed in need or work and documentation. It would be good to include that message in the docs. |
Adding this example to the Sphinx docs now, so I'm closing the issue. |
Hi there,
I want to change the VariableCode of a variable that I created a while back - is there any way to do this from the API?
Thanks,
Dan W
The text was updated successfully, but these errors were encountered: