当前位置: 首页>>代码示例>>Python>>正文


Python GLApiCache.invalidate方法代码示例

本文整理汇总了Python中globaleaks.rest.apicache.GLApiCache.invalidate方法的典型用法代码示例。如果您正苦于以下问题:Python GLApiCache.invalidate方法的具体用法?Python GLApiCache.invalidate怎么用?Python GLApiCache.invalidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在globaleaks.rest.apicache.GLApiCache的用法示例。


在下文中一共展示了GLApiCache.invalidate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: put

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def put(self, field_id):
        """
        Update a single field's attributes.

        :param field_id:
        :return: the serialized field
        :rtype: FieldDesc
        :raises FieldIdNotFound: if there is no field with such id.
        :raises InvalidInputFormat: if validation fails.
        """
        request = self.validate_message(self.request.body,
                                        requests.FieldDesc)

        # enforce difference between /admin/field and /admin/fieldtemplate
        request['is_template'] = False

        response = yield update_field(field_id, request, self.request.language)

        # get the updated list of contexts, and update the cache
        public_contexts_list = yield get_public_context_list(self.request.language)
        GLApiCache.invalidate('contexts')
        GLApiCache.set('contexts', self.request.language, public_contexts_list)

        self.set_status(202) # Updated
        self.finish(response)
开发者ID:tonegas,项目名称:GlobaLeaks,代码行数:27,代码来源:field.py

示例2: put

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def put(self, lang):
        request = json.loads(self.request.body)

        yield update_custom_texts(lang, request)

        GLApiCache.invalidate()

        self.set_status(202)  # Updated
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:10,代码来源:l10n.py

示例3: delete

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def delete(self, context_id):
        """
        Delete the specified context.

        Request: AdminContextDesc
        Response: None
        Errors: InvalidInputFormat, ContextIdNotFound
        """
        yield delete_context(context_id)
        GLApiCache.invalidate()
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:12,代码来源:context.py

示例4: delete

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def delete(self, questionnaire_id):
        """
        Delete the specified questionnaire.

        Request: AdminQuestionnaireDesc
        Response: None
        Errors: InvalidInputFormat, QuestionnaireIdNotFound
        """
        yield delete_questionnaire(questionnaire_id)
        GLApiCache.invalidate()
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:12,代码来源:questionnaire.py

示例5: delete

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def delete(self, field_id):
        """
        Delete a single field template.

        :param field_id:
        :raises FieldIdNotFound: if there is no field with such id.
        """
        yield delete_field(field_id)

        GLApiCache.invalidate()
开发者ID:comradekingu,项目名称:GlobaLeaks,代码行数:12,代码来源:field.py

示例6: delete

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def delete(self, step_id):
        """
        Delete the specified step.

        :param step_id:
        :raises StepIdNotFound: if there is no step with such id.
        :raises InvalidInputFormat: if validation fails.
        """
        yield delete_step(step_id)

        GLApiCache.invalidate()
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:13,代码来源:step.py

示例7: post

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def post(self):
        request = self.validate_message(self.request.body,
                                        requests.WizardDesc)

        # Wizard will raise exceptions if there are any errors with the request
        yield wizard(request, self.request.language)
        # cache must be updated in order to set wizard_done = True
        yield serialize_node(self.request.language)
        GLApiCache.invalidate()

        self.set_status(201)  # Created
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:13,代码来源:wizard.py

示例8: delete

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def delete(self, user_id):
        """
        Delete the specified user.

        Parameters: user_id
        Request: None
        Response: None
        Errors: InvalidInputFormat, UserIdNotFound
        """
        yield delete_user(user_id)

        GLApiCache.invalidate()
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:14,代码来源:user.py

示例9: delete

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def delete(self, questionnaire_id):
        """
        Delete the specified questionnaire.

        Request: AdminQuestionnaireDesc
        Response: None
        Errors: InvalidInputFormat, QuestionnaireIdNotFound
        """
        yield delete_questionnaire(questionnaire_id)
        GLApiCache.invalidate()

        self.set_status(200) # Ok and return no content
        self.finish()
开发者ID:anticorruzione,项目名称:openwhistleblowing,代码行数:15,代码来源:questionnaire.py

示例10: post

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def post(self):
        """
        """
        request = self.validate_message(self.request.body,
                                        requests.WizardFirstSetupDesc)

        yield wizard(request, self.request.language)

        # cache must be updated in particular to set wizard_done = True
        public_node_desc = yield serialize_node(self.request.language)
        GLApiCache.invalidate()

        self.set_status(201)  # Created
开发者ID:comradekingu,项目名称:GlobaLeaks,代码行数:15,代码来源:wizard.py

示例11: delete

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def delete(self, context_id):
        """
        Delete the specified context.

        Request: AdminContextDesc
        Response: None
        Errors: InvalidInputFormat, ContextIdNotFound
        """
        yield delete_context(context_id)
        GLApiCache.invalidate()

        self.set_status(200) # Ok and return no content
        self.finish()
开发者ID:nsfw,项目名称:GlobaLeaks,代码行数:15,代码来源:__init__.py

示例12: post

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def post(self, obj_key, obj_id):
        uploaded_file = self.get_file_upload()
        if uploaded_file is None:
            self.set_status(201)
            return

        try:
            yield add_model_img(model_map[obj_key], obj_id, uploaded_file['body'].read())
        finally:
            uploaded_file['body'].close()

        GLApiCache.invalidate()

        self.set_status(201)
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:16,代码来源:modelimgs.py

示例13: put

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def put(self):
        """
        Parameters: None
        Request: ReceiverReceiverDesc
        Response: ReceiverReceiverDesc
        Errors: ReceiverIdNotFound, InvalidInputFormat, InvalidAuthentication
        """
        request = self.validate_message(self.request.body, requests.ReceiverReceiverDesc)

        receiver_status = yield update_receiver_settings(self.current_user.user_id, request, self.request.language)

        GLApiCache.invalidate()

        self.write(receiver_status)
开发者ID:globaleaks,项目名称:GlobaLeaks,代码行数:16,代码来源:receiver.py

示例14: post

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def post(self, key):
        uploaded_file = self.get_file_upload()
        if uploaded_file is None:
            self.set_status(201)
            return

        try:
            yield add_file(uploaded_file['body'].read(), key)
        finally:
            uploaded_file['body'].close()

        GLApiCache.invalidate()

        self.set_status(201)
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:16,代码来源:files.py

示例15: delete

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import invalidate [as 别名]
    def delete(self, field_id):
        """
        Delete a single field.

        :param field_id:
        :raises FieldIdNotFound: if there is no field with such id.
        :raises InvalidInputFormat: if validation fails.
        """
        yield delete_field(field_id)

        # get the updated list of contexts, and update the cache
        GLApiCache.invalidate('contexts')

        self.set_status(200)
开发者ID:nsfw,项目名称:GlobaLeaks,代码行数:16,代码来源:field.py


注:本文中的globaleaks.rest.apicache.GLApiCache.invalidate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。