(self, plugin_data=None, fetch_related_data=False)
Init plugin with data.
Init plugin with data.
Init plugin with data .
def process(self, plugin_data=None, fetch_related_data=False):
        """Init plugin with data."""
        try:
            # Calling pre-processor.
            self.pre_processor()

            if plugin_data:
                try:
                    # Trying to load the plugin data to JSON.
                    plugin_data = json.loads(plugin_data)

                    # If a valid JSON object, feed it to our plugin and
                    # process the data. The ``process_data`` method should
                    # be defined in your subclassed plugin class.
                    if plugin_data:
                        self.load_plugin_data(plugin_data)

                        self.process_plugin_data(
                            fetch_related_data=fetch_related_data
                        )
                except Exception as err:
                    if DEBUG:
                        logger.debug(str(err))

            # Calling the post processor.
            self.post_processor()

            return self
        except Exception as err:
            if DEBUG:
                logger.debug(str(err))
def process ( self , plugin_data = None , fetch_related_data = False ) : try : # Calling pre-processor. self . pre_processor ( ) if plugin_data : try : # Trying to load the plugin data to JSON. plugin_data = json . loads ( plugin_data ) # If a valid JSON object, feed it to our plugin and # process the data. The ``process_data`` method should # be defined in your subclassed plugin class. if plugin_data : self . load_plugin_data ( plugin_data ) self . process_plugin_data ( fetch_related_data = fetch_related_data ) except Exception as err : if DEBUG : logger . debug ( str ( err ) ) # Calling the post processor. self . post_processor ( ) return self except Exception as err : if DEBUG : logger . debug ( str ( err ) )