Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 1 and Version 2 of SqlObjectDirectSql


Ignore:
Timestamp:
03/06/08 21:06:29 (11 years ago)
Author:
Chris Arndt
Comment:

migrated

Legend:

Unmodified
Added
Removed
Modified
  • SqlObjectDirectSql

    v1 v2  
    1 Sometimes, you just need the power of real SQL.  If you plan on using SQL, use the sqlmeta to force SQLObject to use your table names and ID names.  This will save you misery in case SQLObject does not use the name that you expect. 
    2  
    31{{{ 
    4 class DataTable(SQLObject): 
    5         class sqlmeta: 
    6                 table="data_table" 
    7                 idName="primary_id" 
    8         miscField= StringCol() 
    9         dtCreated= DateTimeCol( default=datetime.now ) 
    10  
    11         def dict_record_count(self): 
    12                 sql = "select count(*) from data_table " 
    13                  
    14                 result = self._connection.queryAll(sql) 
    15                 return result 
     2#!rst 
     3.. note:: This page has been migrated to http://docs.turbogears.org/1.0/SqlObjectDirectSql 
    164}}} 
    175 
    18 Note how you pick up the connection from TurboGears.   
     6 
     7