Changeset 3446

Show
Ignore:
Timestamp:
09/02/07 14:35:08 (1 year ago)
Author:
paj
Message:

Improve tg-admin sql for sqlalchemy; 1418

Files:

Legend:

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

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

    r3324 r3446  
    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):