pythonpython-3.xpython-3.8ponyorm

NameError: name 'update' is not defined PONYORM


I run the following code to update a record with where condition by ponyorm in Python 3.8.5

from pony.orm import *

customer = update(c.set(CustomerCode = '123') for c in Customers if c.CustomerCode == '456')

But, I got NameError as follows.

NameError: name 'update' is not defined

Any idea?

Thaks for any help


Solution

  • PonyORM does not currently support bulk update in the way that you are trying to use it, as mentioned in the documentation.

    Relevant snippet:

    unsupported

    So to answer your question: PonyORM does not have an update function.