def set_group(self, group): """ Set the core group, which is unique """ for g in self.playergroup_set.filter(owner=None): g.players.remove(self) group.players.add(self) drop_cache(self._group, self) return group
def save(self, **kwargs): """ Clear cache for extensions """ #for k, v in self.EXTENSIONS.iteritems(): # drop_cache(self.get_extension, self, v) #drop_cache(self.get_extension, self, self.__class__) drop_cache(self._race_name, self) drop_cache(self._group, self) update_display_name(self, save=False) return super(Player, self).save(**kwargs)
def save(self, **kwargs): """ Clear cache for extensions """ drop_cache(self.get_extension, self, self.__class__) drop_cache(self._race_name, self) drop_cache(self._group, self) update_display_name(self, save=False) return super(Player, self).save(**kwargs)
def add(cls, user=None, game=None, **kwargs): ret = History.objects.create(user=user, game=game, **kwargs) drop_cache(cls._user_points, user=user) drop_cache(cls._user_coins, user=user) return ret
def delete(self, using=None): cls = self.__class__ drop_cache(cls._user_points, self.user) drop_cache(cls._user_coins, self.user) super(History, self).delete(using=using)