alternate way of updating selected row

Issue #117 resolved
shgoh created an issue

Example:

c = users.select().execute()
row = c.fetchone()
row['password']('password') = 'abc123'

To mark objects as to be updated, use the new "update" method on UnitOfWork:-

objectstore.update(row)

Subsequence reference of "row" should now point to updated row.

Comments (1)

  1. Mike Bayer repo owner

    youre looking for a "row data gateway" here http://www.martinfowler.com/eaaCatalog/rowDataGateway.html. which is a different pattern altogether, also the kind of pattern that slowly morphs its way into becoming just another active record ORM. You might want to look at Jonathan Ellis' SQLSoup package, which I guess is not at all like what you have above...but it is a little more ad-hoc feeling, in case thats what youre looking for.

    as for SA proper, its very important that its ORM sticks to the "data mapper" / "unit of work" pattern....and its utterly important that the concepts of SQL statements and rows dont get conflated with units of work in any way (you will not find any sql awareness whatsoever in the objectstore or unitofwork packages). if you want other patterns, thats a different ORM.

  2. Log in to comment