My favorites | Sign in
Project Home Wiki Issues Source
Search
for
BasicUsage  
Basic usage outline
Featured
Updated Oct 9, 2007 by paul.jos...@gmail.com

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 ORM

All SQLAlchemy ORM models are stored under tranquil.models. The basic outline is tranquil.models.[app_name].[model_name].

Some examples:

  • django.contrib.auth.models.User = tranquil.models.auth.User
  • django.contrib.contenttypes.models.ContentType = tranquil.models.contenttypes.ContentType

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
Powered by Google Project Hosting