Skip to content

wiacekm/bottle-zerodb

Repository files navigation

Bottle ZeroDB

Build status

This bottle-zerodb plugin integrates ZeroDB with your Bottle application. It injects a ZeroDB session in your route and handle the session cycle.

Usage Example:

from bottle import Bottle ,redirect
from bottle.ext.zerodb import ZeroDbPlugin
from zerodb.models import Model, Field


class Element(Model):
    name = Field()


app = Bottle()
plugin = ZeroDbPlugin()
app.install(plugin)

@app.route('/', method='GET')
def index(zerodb):
    return 'Number of Elements in: %s' % len(zerodb[Element])

@app.route('/add/', method='POST')
def add(zerodb):
    zerodb.add(Element(name="example"))
    redirect("/")

About

ZeroDB plugin for Bottle web framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages