On Monday, 23 January 2017 15:37:18 UTC-8, Tom Keffer wrote: > > On Mon, Jan 23, 2017 at 3:20 PM, Louis De Lange <[email protected] > <javascript:>> wrote: > >> >> 1. The meteotemplate database uses a type datetime primary key, rather >> than unix epoch. I could not get addRecord to work in that circumstance so >> I ended up using a getsql function to write the record to meteotemplate. >> >> > One option would be to augment the record with the datetime object that > Meteotemplate needs. Then dateTime just gets carried along for the ride. > Or, maybe I'm misunderstanding your architecture. >
I tried doing just this, but then the day calcs failed when the DateTime type was text. However, after changing the manager to class Manager the day summaries wont be filled and I can see that this will work. > > >> 2. I had to add a usUnit column to the meteotemplate database because >> weewx does a unit check and wont allow to post a new record unless the >> usUnits column match. This is not a big deal, but is there a way around >> that? In particular, the individual records in the meteotemplate database >> can be any combination of units - which makes a single unit indicator >> irrelevant, apart from making the database write possible >> > > You could subclass Manager, overriding function _check_unit_system() so > it does not do the check, or does some other check. > This can be my next project to figure out how to do this... > > >> >> 3. The standard db_manager = >> self.engine.db_binder.get_manager(data_binding='name_of_binding', >> initialize=True) function insists on adding day summary tables, and >> when I set initialize to false and delete the unnecessary tables it >> gives an error that the tables are missing. Is there a way to eliminate >> the creation of the day summary tables? >> > > Yes. Use class Manager, rather than DaySummaryManager. > Works! Thanks. > Hope this helps. > > -tk > > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
