Anyway, I have two classes, one which is the container for another:
Portfolio contains Pieces, (as in .pieces()), and Pieces have a
reference to portfolio (as in .portfolio()).
If I move a piece between portfolios, the .pieces() will be
inaccurate, since it seems to cache these backreferences as
Are these objects unique? Like, if I fetch the same object from the
store twice, will they be equal (i.e., portfolio1 is portfolio2)?
If so, should the generated code be such that:
def _removePiece(self, piece):
"""Semi-private because it must be called along with
setPortfolio or self._pieces will be incorrect"""
if self._pieces is not None:
def setPortfolio(self, portfolio):
if self._portfolio is not None:
self._portfolio = portfolio
Except for all the asserts, and (I guess?) something where you can use
objectRefs instead of the actual objects...? Maybe there needs to be
a weak-fetch from the store, so that Piece can fetch its actual
portfolio if it's been instantiated (in which case it may have an
invalid cache), but if it hasn't then it doesn't matter.
And on a slightly related note -- if when I edit a Piece I run this
piece = self._piece
And I get this error from MySQLdb:
Warning: Rows matched: 1 Changed: 1 Warnings: 1
I don't know why MySQLdb even bothers giving an error message this
lame (well Warning/error message)... but any idea what the warning is
about, or how I can fix it?