[ome-devel] possible bug in components/tools/OmeroPy/src/omero/tables.py

Gianluigi Zanetti gianluigi.zanetti at crs4.it
Mon Apr 11 11:46:01 BST 2011


Greetings.
It appears that the current (as of the current git src) implementation
of table.update() will only work if one is updating the first row of a
table. 

----------------------------------------------------------------------------
    @stamped
    def update(self, stamp, data):
        if data:
            for rn in data.rowNumbers:
                for col in data.columns:
                    getattr(self.__mea.cols, col.name)[rn] = col.values[rn]
        self.__mea.flush()
----------------------------------------------------------------------------

a possible fix could be:

----------------------------------------------------------------------------
    @stamped
    def update(self, stamp, data):
        if data:
            for i, rn in enumerate(data.rowNumbers):
                for col in data.columns:
                    getattr(self.__mea.cols, col.name)[rn] = col.values[i]
        self.__mea.flush()
----------------------------------------------------------------------------


--gianluigi

p.s.
I had to add this patch to get 4.2 working, I did not check if it creates problems in the 4.3dev



More information about the ome-devel mailing list