API¶
Kibble¶
The Kibble blueprint.
-
class
flask_kibble.Kibble(name, import_name, auth, label=None, default_gcs_bucket=None, default_model_converter=None, **kwargs)¶ -
autodiscover(paths, models=None, module_names=None)¶ Automatically register all Kibble views under
path.Parameters: - paths – The module paths to search under.
- module_names – A list of module names to match on. e.g. kibble will only attempt to autodiscover kibble.py files.
- models – A list of model kinds (either a
ndb.Modelsubclass or a string) (Optional)
-
register_view(view_class)¶ Register a class with the Kibble blueprint.
Parameters: view_class – A KibbleView class Raises ValueError: When the same (Class,Action) pair is already registered.
-
url_for(model, action, instance=None, ancestor=None, **kwargs)¶ Get the URL for a specific Model/Action/Instance.
If the view isn’t registered, returns an empty string.
Parameters: - model – A
ndb.Modelsubclass or string. For ancestral objects, this can be a path. - action – The name of the action to link to. e.g. ‘create’.
- instance – A
ndb.Modelinstance orndb.Keyto link to.
- model – A
-