This repository has been archived by the owner. It is now read-only.
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (45 sloc) 1.61 KB

Welcome to supercell's documentation!

Supercell is a simple set of classes for creating domain driven RESTful APIs in Python. We use schematics for domain modeling, scales for statistics and Tornado as web server.

A very simple example for a supercell request handler looks like this:

from schematics.models import Model
from schematics.types import StringType, IntType

class Saying(Model):

    id = IntType()
    content = StringType()

class HelloWorld(s.RequestHandler):

    def counter(self):
        if not hasattr(self.__class__, '_counter'):
            self.__class__._counter = 0
        return self.__class__._counter or 0

    def counter(self, value):
        self.__class__._counter = value

    def get(self):
        self.counter += 1
        name = self.get_argument('name', self.config.default_name)
        content = self.render_string(self.config.template, name)
        raise s.Return(Saying(id=self.counter, content=content))

The Getting Started guide should help you becoming familiar with the ideas behind and the Topics contain a growingly part of in depth documentation on certain aspects. The API contains the full API documentation.


.. toctree::
    :maxdepth: 2


Indices and tables