Are there any known bugs with using WDateTime to bind to a data field using the Sqlite3 driver and display it in a WTreeView. Using the following backend settings, bindings, and database schema results in "null" for all of my Date/Time records. ----- sqlite3.setDateTimeStorage(Wt::Dbo::SqlDateTime, Wt::Dbo::backend::Sqlite3::ISO8601AsText); m_dbSession.setConnection(sqlite3); ----- #pragma once #include <Wt/Dbo/Dbo> #include <Wt/Dbo/WtSqlTraits> #include <string> #include <Wt/WDate> namespace dbo = Wt::Dbo; using namespace Wt; using namespace std; class HydrovoltsConnectOpHistory { public: HydrovoltsConnectOpHistory (){}; virtual ~HydrovoltsConnectOpHistory (){}; template<class Action> void persist(Action& a) { dbo::field(a, projectId, "TurbineId"); dbo::field(a, timestamp, "TimeStamp"); dbo::field(a, freq, "Frequency"); dbo::field(a, rotorSpeed, "RotorSpeed"); dbo::field(a, volts, "Volts"); dbo::field(a, amps, "Amps"); dbo::field(a, flow1, "Flow1"); dbo::field(a, flow2, "Flow2"); dbo::field(a, strain, "Strain"); dbo::field(a, genTemp, "GenTemp"); dbo::field(a, alarm, "Alarm"); } // C++ Variable SQLite Schema Example // id //integer id 4142 // version //integer version int projectId; //numeric TurbineId; 1 WDateTime timestamp; //text TimeStamp; 20120329T214733Z float freq; //numeric Frequency; 28.5 int rotorSpeed; //numeric RotoSpeed; 419 float volts; //numeric Volts; 467.74 float amps; //numeric Amps; 15.25 int flow1; //numeric Flow1; 12 int flow2; //numeric Flow2; 12 int strain; //numeric Strain; 0 float genTemp; //numeric GenTemp; 0.118 bool alarm; //numeric Alarm; 0 private: /* data */ }; ------- sqlite> .schema OpHistory CREATE TABLE "OpHistory" ( "id" integer primary key autoincrement, "version" integer not null, "TurbineId" integer not null, "TimeStamp" text, "Frequency" real not null, "RotorSpeed" integer not null, "Volts" real not null, "Amps" real not null, "Flow1" integer not null, "Flow2" integer not null, "Strain" integer not null, "GenTemp" real not null, "Alarm" boolean not null ); ------- The rest of the fields work great. WDate in another part of my app works great. Binding as a std::string indicates the data is in good shape (See attached screenshot). If I switch that binding to use WDateTime the TimeStamp values get reported as null in the WTableView. Thoughts? |
------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________ witty-interest mailing list witty-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/witty-interest