Unfortunately your new tags.py did not fix my problem. If I put a simple print into the def records(self, data_binding=None): manager = self.db_lookup(data_binding) for record in manager.genBatchRecords(self.timespan.start, self.timespan.stop): yield CurrentObj(self.db_lookup, data_binding, record['dateTime'], self.formatter, self.converter, record=record)
routine, then it shows that data_binding is always None. But I don't know how to work back up to find out where the data_binding gets lost. Regards Mike On Wednesday, September 26, 2018 at 1:19:12 AM UTC+1, Thomas Keffer wrote: > > This is a bug. Try this version of tags.py. > > To answer your other questions, there are a bunch of tests that use $day, > as well as other tags. Look in bin/weewx/test/test_skins/StandardTest. > > The "context" used in the tags is for formatting. It's how it knows to > format a day related time as hh:mm, but a month related time as hh:mm > dd-MM. Nothing to do with databases. > > Let me know if this new tags.py solves your problem! > > -tk > > On Tue, Sep 25, 2018 at 4:31 PM mwall <goo...@lancet.mit.edu <javascript:>> > wrote: > >> tom and gary, >> >> do you know if there is a unit test for the $day tag (or any other tag, >> for that matter)? i'm not finding anything. >> >> also, this looks suspect, but perhaps not relevant to this problem. in >> tags.py i see this: >> >> >> def hour(self, data_binding=None, hours_ago=0): >> >> return >> TimespanBinder(weeutil.weeutil.archiveHoursAgoSpan(self.report_time, >> hours_ago=hours_ago), >> >> self.db_lookup, data_binding=data_binding, >> >> context='day', formatter=self.formatter, >> converter=self.converter, >> >> **self.option_dict) >> >> >> should the context be 'hour' not 'day'? >> >> m >> >> -- >> 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 weewx-user+...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- 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 weewx-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.