Beispiel #1
0
    def resolve_notebook(self, info, id=None, title=None):  #pylint: disable=no-self-use,unused-argument,redefined-builtin
        """Returns Single Notebook

        :id: kwarg for the id of the notebook. defaults to None
        :title: kwarg for the title of the notebook. defaults to None
        :returns: None or the notebook object with the specified id or title

        """
        return helpers.resolve_model(info, id, title, Notebook)
Beispiel #2
0
    def mutate(root, info, title, section_id, favorite=False, leaf=None):  #pylint: disable=unused-argument, too-many-arguments
        """
        Create and return Leaflet
        """
        section = helpers.resolve_model(info, section_id, None, Section)
        if section is None:
            return None
        ok = True

        return CreateLeaflet(leaflet=save_leaflet(info, section, title,
                                                  favorite, leaf),
                             ok=ok)
Beispiel #3
0
    def mutate(root,
               info,
               leaflet_id,
               title,
               leaf_type,
               content="",
               leaf=None):  #pylint:disable=unused-argument, too-many-arguments
        """
        Create and return Leaf
        """
        leaflet = helpers.resolve_model(info, leaflet_id, None, Leaflet)
        if leaflet is None:
            return None
        ok = True

        return CreateLeaf(leaf=save_leaf(info, leaflet, title, content,
                                         leaf_type),
                          ok=ok)
Beispiel #4
0
 def resolve_leaf(self, info, id=None, title=None):  #pylint: disable=no-self-use,unused-argument,redefined-builtin
     """
     Returns Single Leaf
     """
     return helpers.resolve_model(info, id, title, Leaf)