glidernet / ogn-python

A gateway with built-in database for the Open Glider Network (OGN)
http://glidernet.org
GNU Affero General Public License v3.0
17 stars 4 forks source link

Devices stats #18

Closed Meisterschueler closed 8 years ago

kerel-fs commented 8 years ago

This change breaks the follwing command:

./manage.py db.update_ddb_ogn

Traceback:

  File "/home/birke/Fliegen/ogn/ogn-python/ogn/commands/database.py", line 23, in update_ddb_ogn
    counter = result.get()
  File "/home/birke/Fliegen/ogn/ogn-python/env/lib/python3.4/site-packages/celery/result.py", line 175, in get
    raise meta['result']
sqlalchemy.exc.InterfaceError: (sqlite3.InterfaceError) Error binding parameter 0 - probably unsupported type. [SQL: 'DELETE FROM device WHERE device.address_origin = ?'] [parameters: (<AddressOrigin.ogn_ddb: 1>,)]
kerel-fs commented 8 years ago

@Meisterschueler We have to fix this line at least: https://github.com/glidernet/ogn-python/blob/master/ogn/collect/fetchddb.py#L17

...and all other occurrences of AddressOrigin.

Meisterschueler commented 8 years ago

Strage... obviously it has something to do with the Enum. But on my side everything is running (python3.5, sqlite/postgresql)

kerel-fs commented 8 years ago

I like your idea to change AddressOrigin to an enumeration, but using an IntEnum annihilates its advantages as it is possible to access the (arbitrary) integer values.