コード例 #1
0
    def post_save(cls, user_id, objects, **kwargs):
        """
            Called after Features are saved by the FeatureResource. This calls post save publishing for
            Features, which includes updating tilestache for impacted layers and calling the
            Scenario Builder Analysis Tool
        :param user_id:
        :param objects:
        :param kwargs:
        :return:
        """

        ids = map(lambda obj: obj.id, objects)
        from footprint.main.publishing.feature_publishing import on_feature_post_save
        on_feature_post_save(cls, instance=objects, ids=ids, user_id=user_id)

        from footprint.main.models.analysis_module.analysis_module import AnalysisModuleKey, AnalysisModule
        core = AnalysisModule.objects.get(config_entity=cls.config_entity, key=AnalysisModuleKey.SCENARIO_BUILDER)
        # Update the core user to the current user
        if not core.updater or core.updater.id != user_id:
            core.updater = get_user_model().objects.get(id=user_id)
            core._no_post_save_task_run = True
            core.save()
            core._no_post_save_task_run = False

        core.start(ids=ids)
コード例 #2
0
    def post_save(cls, user_id, objects, **kwargs):
        """
            Called after Features are saved by the FeatureResource. This calls post save publishing for
            Features, which includes updating tilestache for impacted layers and calling the
            Scenario Builder Analysis Tool
        :param user_id:
        :param objects:
        :param kwargs:
        :return:
        """

        ids = map(lambda obj: obj.id, objects)
        from footprint.main.publishing.feature_publishing import on_feature_post_save
        on_feature_post_save(cls, instance=objects, ids=ids, user_id=user_id)

        from footprint.main.models.analysis_module.analysis_module import AnalysisModuleKey, AnalysisModule
        core = AnalysisModule.objects.get(
            config_entity=cls.config_entity,
            key=AnalysisModuleKey.SCENARIO_BUILDER)
        # Update the core user to the current user
        if not core.updater or core.updater.id != user_id:
            core.updater = get_user_model().objects.get(id=user_id)
            core._no_post_save_task_run = True
            core.save()
            core._no_post_save_task_run = False

        core.start(ids=ids)
コード例 #3
0
    def post_save(cls, user_id, objects, **kwargs):
        """
            Called after Features are saved by the FeatureResource. This calls post save publishing for
            Features, which includes updating tilestache for impacted layers and calling the
            Agriculture Builder Analysis Tool
        :param user_id:
        :param objects:
        :param kwargs:
        :return:
        """

        ids = map(lambda obj: obj.id, objects)
        from footprint.main.publishing.feature_publishing import on_feature_post_save
        on_feature_post_save(cls, instance=objects, ids=ids, user_id=user_id)
コード例 #4
0
    def post_save(cls, user_id, objects, **kwargs):
        """
            Called after Features are saved by the FeatureResource. This calls post save publishing for
            Features, which includes updating tilestache for impacted layers and calling the
            Agriculture Builder Analysis Tool
        :param user_id:
        :param objects:
        :param kwargs:
        :return:
        """

        ids = map(lambda obj: obj.id, objects)
        from footprint.main.publishing.feature_publishing import on_feature_post_save
        on_feature_post_save(cls, instance=objects, ids=ids, user_id=user_id)
コード例 #5
0
 def post_save(cls, user_id, objects, **kwargs):
     """
         Optional class method to kick of analytic modules (see FutureScenarioFeature)
     """
     from footprint.main.publishing.feature_publishing import on_feature_post_save
     on_feature_post_save(cls, instance=objects, user_id=user_id)
コード例 #6
0
 def post_save(cls, user_id, objects, **kwargs):
     """
         Optional class method to kick of analytic modules (see FutureScenarioFeature)
     """
     from footprint.main.publishing.feature_publishing import on_feature_post_save
     on_feature_post_save(cls, instance=objects, user_id=user_id)