On 20 sep, 09:33, Arthur <
subtlel...@gmail.com> wrote:
> Pierre
Hi,
>
> I just looked at the svn version with ipython 2.6.5, and now, when one
> does
> x=db.select_for_update(...
> x[0].field = 'new value'
> the new value is only set in x[0], and *not* in the database, i.e. if x[0]
> corresponds to db[5]
> then db[5].field will remain unchanged.
It was the same in the previous versions : the syntax to update a
record in the database is
x[0].update(field='new value')
>
> also what i meant when i said "will return the empty list" previously was
> that the entry with __id__ = 5 will not show up in the search results.
This is what I had with the previous version, but now this code works
as expected :
============
import buzhug
db = buzhug.Base('test.bzg')
db.create(('field1',str),('field2',int),mode="override")
for i in range(10):
db.insert('x%s' %i,2*i)
res = db.select_for_update(['field1'],field2=10)
print res[0].field1
res[0].update(field1="new value")
res = db.select_for_update(['field1'],field2=10)
print res[0].field1
============
>
> the quick fix to to the "select_for_update, "bug" is to just use None in the
> fields you are requesting to retrieve.
>
> side note:
> the __init__.py is broken as the line
> from buzhug_client import ProxyBase, shouldn't be there, as there is no file
> ProxyBase.py
Shame on me...
>
> also setup.py has the wrong version listed
Shame on me again...
>
> thanks
> John
Thank you
Pierre
> >
buzhug+un...@googlegroups.com<
buzhug%2Bunsu...@googlegroups.com>
> > .
> > Pour plus d'options, consultez la page de ce groupe :
> >
http://groups.google.com/group/buzhug?hl=fr- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -