Logo Search packages:      
Sourcecode: zine version File versions  Download package

def zine::application::Zine::add_api (   self,
  name,
  preferred,
  callback,
  blog_id = 1 
)

Add a new API to the blog.  The newly added API is available at
``/_services/<name>`` and automatically exported in the RSD file.
The `blog_id` is an unused oddity of the RSD file, preferred an
indicator if this API is preferred or not.
The callback is called for all requests to the service URL.

Definition at line 835 of file application.py.

00835                                                            :
        """Add a new API to the blog.  The newly added API is available at
        ``/_services/<name>`` and automatically exported in the RSD file.
        The `blog_id` is an unused oddity of the RSD file, preferred an
        indicator if this API is preferred or not.
        The callback is called for all requests to the service URL.
        """
        endpoint = 'services/' + name
        self.apis[name] = (blog_id, preferred, endpoint)
        self.add_url_rule('/_services/' + name, endpoint=endpoint)
        self.add_view(endpoint, callback)

    @setuponly
    def add_importer(self, importer):


Generated by  Doxygen 1.6.0   Back to index