コード例 #1
0
    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
コード例 #2
0
    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
コード例 #3
0
    def restore_object(self, attrs, instance=None):
        assert instance
        use_behaviour = UserBehaviour(instance)
        use_behaviour.default_amt = attrs['default_amt']

        return instance
コード例 #4
0
    def restore_object(self, attrs, instance=None):
        assert instance
        use_behaviour = UserBehaviour(instance)
        use_behaviour.default_amt = attrs['default_amt']

        return instance