orientechnologies / orientdb-docs

Repository of the entire OrientDB documentation.
Apache License 2.0
58 stars 167 forks source link

Python API (Pyorient) a BUG in client.command docs #353

Open MaverickMei opened 5 years ago

MaverickMei commented 5 years ago

official docs example: ... for sensor in pollen_sensors: client.command( "INSERT INTO PollenSensor " "('device_id', 'read_time', 'read') " "VALUES('%s', '%s', %s')" % (sensor.get_id() time.now(), sensor.get_data())) ... but I test it in Python3.7 Pycharm run with Python console, I find ('device_id', 'read_time', 'read') will return error. Only if remove ‘ ’ it will have proper execution.

correct:

... for sensor in pollen_sensors: client.command( "INSERT INTO PollenSensor " "(device_id, read_time, read) " "VALUES('%s', '%s', %s')" % (sensor.get_id() time.now(), sensor.get_data())) ...

So maybe the example is wrong.