|
BasicUsage
Basic usage outline
Featured After installing the tranquil django app and middleware, using SA ORM objects is as simple as this. from django.shortcuts import render_to_response
from tranquil.models.app_name import Poll, Choice
def index(request):
polls = request.sa.query(Poll)
return render_to_response( 'polls/index.html', { 'polls': polls } )Importing SQLAlchemy ORMAll SQLAlchemy ORM models are stored under tranquil.models. The basic outline is tranquil.models.[app_name].[model_name]. Some examples:
When you're ready, move on to AdvancedUsage to see some of the other neat things Tranquil has up its sleeves. |
► Sign in to add a comment