sql example code

Posted on
Thu Mar 06, 2014 10:36 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: sql example code

That code that you are looking at (unless you modified it) is indeed sending back a string designed for JSON consumption or for verifying the output; the return is likely still str(sqlConn.FetchAll()). I believe that you are going to want to remove the "str" wrapper converting to a string and instead use the return directly.

If that doesn't work I can help you in more detail tomorrow.

Adam

Posted on
Thu Mar 06, 2014 10:37 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: sql example code

removed the str() .. trying .. thanks

Posted on
Thu Mar 06, 2014 10:45 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: sql example code

... still confused.. do I need to do anything with it after removing str() to make it a list..

sqlDeviceHistory = self.getDeviceHistory(theDeviceId,100)

should produce a list in sqlDeviceHistory... ?

Posted on
Thu Mar 06, 2014 11:16 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: sql example code

again... answering my own questions.. figured it out .. thanks for your help..

Posted on
Fri Mar 07, 2014 9:06 am
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: sql example code

Cool, sounds like you got it... I should be more connected now, though, if you run into any other questions.

Posted on
Fri Mar 07, 2014 11:17 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: sql example code

I am now in the middle of mapping an event based set of data (sql) to a fixed bin based system histogram... a lot of if's

again, thx for your help.

Karl

Posted on
Sat Jan 17, 2015 8:37 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: sql example code

RogueProeliator wrote:
Are you referring to the SQL Logger plugin's data? If so, send me a PM with your email and I can send some code your way that you can pretty much drop in to a plugin.

Adam


A bit old - but would love it if could post python sql code as wish to play a bit.
Think I have found - the dataAccess folder within the indigoPlot plugin I presume- will fiddle.


(mainly to solve the randon presence issue - as best way to not appear randon - is not to be! Would seem ideal to play back last days/weeks usage as way of faking a presence)

THanks

Who is online

Users browsing this forum: No registered users and 2 guests