def restore_object(self, attrs, instance=None): assert instance if self.context['kwargs'].get('master_user', False): user_behaviour = UserBehaviour(instance) user_behaviour.glue_to = self.context['kwargs']['master_user'] else: user_behaviour = UserBehaviour(username=instance.username, request=self.context['request']) instance = user_behaviour.unglue() return instance
def restore_object(self, attrs, instance=None): assert instance use_behaviour = UserBehaviour(instance) use_behaviour.default_amt = attrs['default_amt'] return instance