You have encountered the difference in format/structure between the new
style schema and the old style schema. The new style schema consists of a
python dictionary whereas the old style schema was a list. Consequently,
you need a slightly different approach when extending the new style schema.
Have a look at Extending the existing schema with a new type
<http://weewx.com/docs/customizing.htm#add_archive_type> in the
Customisation Guide.
Gary
On Sunday, 4 October 2020 08:03:11 UTC+10, rich T wrote:
>
> I'm attempting to add a column to the extended schema but I get the
> following error:
>
> pi@raspberrypi:/home/weewx/bin $ sudo ./wee_database
> /home/weewx/weewx.conf --reconfigure
> Traceback (most recent call last):
> File "./wee_database", line 23, in <module>
> import user.extensions # @UnusedImport
> File "/home/weewx/bin/user/extensions.py", line 20, in <module>
> schema_extended = schemas.wview_extended.schema + [('forecastRule',
> 'INTEGER')]
> TypeError: unsupported operand type(s) for +: 'dict' and 'list'
>
> Here is what I have in the extensions file.
>
> User extensions module
> ....
>
> import schemas.wview_extended
> schema_extended = schemas.wview_extended.schema + [('forecastRule',
> 'INTEGER')]
>
> thanks
>
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/2d9e2e20-8baf-44cf-ba55-9e3b4c91396do%40googlegroups.com.