def getforsaleminusplayer(self, player = None): if not player: currentplayer = doo.getcurrentplayer() else: currentplayer = player if currentplayer: playerstuff = currentplayer.getplayerstuffbystuffid(self.stuffid) if playerstuff: amountforsale = self.forsale - playerstuff.forsale return amountforsale else: return self.forsale else: #hopefully this will never be called return self.forsale
def setforsale(self, forsale): if self.ownerid != doo.getcurrentplayer().playerid: return None self.forsale = forsale self.put()
def setprice(self, price): price = float(float(price)) if self.ownerid != doo.getcurrentplayer().playerid: return None self.price = price self.put()