Project

General

Profile

AQuickTutorial » History » Revision 2

Revision 1 (Aurynn Shaw, 11/19/2008 04:46 PM) → Revision 2/10 (Aurynn Shaw, 11/20/2008 10:29 AM)

= Simpycity in a Hurry = 
 And what to expect when you use it. 

 == Setup == 

 First, set up Simpycity: 

 {{{ 
 from simpycity.core import Function Function, Query, Raw 
 from simpycity import config 

 config.host = 'localhost' 
 config.port = 5432 
 config.user = 'user' 
 config.password = 'password' 
 config.database = 'dbname' 

 }}} 

 Then, create some basic functions. 
 {{{ 
 f_all = Function("get_row",['id']) 
 f = Function("get_rows") 
 }}} 

 f_all maps to the stored procedure "get_rows", which takes no arguments. 

 f, on the other hand, maps to the stored procedure "get_row", which takes a single argument, which we've named id. 

 {{{ 
 result = f(1) 
 all_results = f_all() config. 
 }}}