Changeset 3447

Show
Ignore:
Timestamp:
09/02/07 14:36:33 (11 months ago)
Author:
paj
Message:

Improve tg-admin sql for sqlalchemy; 1418

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/CHANGELOG.txt

    r3320 r3447  
    1 TurboGears Changelog 
     1TurboGears Changelog 
    22==================== 
    33 
    4 1.1 (Unreleased): 
    5 ----------------- 
    6  
     4======= 
     51.0.4: 
     6------ 
     7*Changes* 
     8 
     9*Features* 
     10    * "tg-admin sql" is now more powerful for SQLAlchemy. Ticket #1418 
     11 
     12*Fixes* 
     13    * Ticket #1185: rollback SA transaction if a controller method fails, and it 
     14      has an exception_handler. 
     15    * sa_rwt (SQLAlchemy run with transaction) refactored to fix some corner  
     16      cases. 
     17 
     18*Contributors* 
     19 
     20Paul Johnston 
     21 
     22 
     231.0.3.2 (July 20, 2007): 
     24------------------------ 
    725*Changes* 
    826 
  • branches/1.1/turbogears/command/base.py

    r3320 r3447  
    1616from turbogears.identity import SecureObject,from_any_host 
    1717from turbogears import config, database 
     18from sacommand import sacommand 
    1819 
    1920sys.path.insert(0, os.getcwd()) 
     
    5051            self.dburi = self.dburi[8:] 
    5152 
    52  
    53 [dispatch.generic()] 
    54 def sacommand(command, args): 
    55     pass 
    56  
    57 [sacommand.when("command == 'help'")] 
    58 def sahelp(command, args): 
    59     print """TurboGears SQLAlchemy Helper 
    60  
    61 help    this display 
    62 create  create the database tables 
    63 """ 
    64 [sacommand.when("command == 'create'")] 
    65 def sacreate(command, args): 
    66     print "Creating tables at %s" % (config.get("sqlalchemy.dburi")) 
    67     from turbogears.database import bind_meta_data, metadata 
    68     bind_meta_data() 
    69     get_model() 
    70     metadata.create_all() 
    7153 
    7254class SQL(CommandWithDB):