Subversion Repositories SmartDukaan

Rev

Rev 759 | Rev 1248 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 759 Rev 1131
Line 1... Line 1...
1
'''
1
'''
2
Created on 14-Jul-2010
2
Created on 14-Jul-2010
3
 
3
 
4
@author: ashish
4
@author: ashish
5
'''
5
'''
-
 
6
from sqlalchemy import create_engine
6
from elixir import *
7
from elixir import *
7
import elixir
8
import elixir
8
 
9
 
9
class Message(Entity):
10
class Message(Entity):
10
    id = Field(Integer, primary_key=True, autoincrement=True)
11
    id = Field(Integer, primary_key=True, autoincrement=True)
Line 31... Line 32...
31
    using_options(shortnames=True)
32
    using_options(shortnames=True)
32
    using_table_options(mysql_engine="InnoDB")
33
    using_table_options(mysql_engine="InnoDB")
33
 
34
 
34
def initialize():
35
def initialize():
35
    #metadata.bind = "sqlite:///message.sqlite" #need to read it from configserver.
36
    #metadata.bind = "sqlite:///message.sqlite" #need to read it from configserver.
36
    metadata.bind = 'mysql://root:shop2020@localhost/helper'
37
    engine = create_engine('mysql://root:shop2020@localhost/helper', pool_recycle=7200)
-
 
38
    metadata.bind = engine
37
    metadata.bind.echo = True
39
    metadata.bind.echo = True
38
    setup_all(True)
40
    setup_all(True)
39
 
41
 
40
if __name__=="__main__":
42
if __name__=="__main__":
41
    initialize()
43
    initialize()