I have a situation wherein a change made to an attribute(a list) of a ZODB obj, is not being recognized.I have set the _p_changed = 1.<br>But still the ZODB doesnt recognize the change.On debugging i realised that the obj has the change and then i do a transaction.commit() and close the database.But on reaccessing the database i realise that the change hasnt been registered.<br>
Could someone please help me out on this one<br><br>The code is ::::<br>s=open_zodb()<br>root=s[0]<br>if not root.has_key("Clubs"):<br> root["Clubs"] = {} <br>ClubRoot=root["Clubs"]<br>
if not root.has_key("Managers"):<br> root["Managers"] = {} <br>ManagerRoot=root["Managers"]<br>if not root.has_key("Players"):<br> root["Players"]={}<br>PlayerRoot=root["Players"]<br>
if not root.has_key("Count"):<br> root["Count"] = {} <br>CountRoot=root["Count"]<br><br><br>club=findclubsbyname(ClubRoot, 'MI')<br><br><br><br>print club.Players<br>list=addplayers(PlayerRoot, CountRoot, "b", 99, 100)<br>
PlayerRoot=list[1]<br>CountRoot=list[0]<br>player=findplayerbyname(PlayerRoot, "b")<br>player.Club=club<br>playerset=[]<br>playerset.append(player)<br>playerset.append(player)<br>#club.Players.append(player)<br>
club.makeclubplayerassociation(playerset)<br>ClubRoot[club.ClubID]=club<br><br>root['Players']=PlayerRoot<br>root['Clubs']=ClubRoot<br><br>transaction.commit()<br>close_zodb(s)<br><br><br>//open_zodb() is a function which just opens connection to the databse.<br>
findclubsbyname returns a club object .<br>addplayers is a function which adds a player and returns PlayerRoot and CountRoot<br>findplayerbyname returns a player object<br><br>every club object has an attribte Players which is a list.<br>
<br><br><br>