Subversion Repositories SmartDukaan

Rev

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

Rev 1113 Rev 1122
Line 6... Line 6...
6
 
6
 
7
from elixir import *
7
from elixir import *
8
from elixir.entity import Entity
8
from elixir.entity import Entity
9
from elixir.fields import Field
9
from elixir.fields import Field
10
from sqlalchemy.types import Integer
10
from sqlalchemy.types import Integer
-
 
11
from sqlalchemy import create_engine
11
from elixir.relationships import OneToMany, ManyToOne
12
from elixir.relationships import OneToMany, ManyToOne
12
import datetime
13
import datetime
13
import elixir
14
import elixir
14
 
15
 
15
 
16
 
Line 18... Line 19...
18
# Different entities in the model
19
# Different entities in the model
19
#===============================================================================
20
#===============================================================================
20
 
21
 
21
def initialize():
22
def initialize():
22
    #metadata.bind = "sqlite:///Transactionsnew.sqlite"
23
    #metadata.bind = "sqlite:///Transactionsnew.sqlite"
23
    metadata.bind = 'mysql://root:shop2020@localhost/transaction'
24
    #metadata.bind = 'mysql://root:shop2020@localhost/transaction'
-
 
25
    engine = create_engine('mysql://root:shop2020@localhost/transaction', pool_recycle=7200)
-
 
26
    metadata.bind = engine
24
    metadata.bind.echo = True
27
    metadata.bind.echo = True
25
    setup_all(True)
28
    setup_all(True)
26
 
29
 
27
 
30
 
28
if __name__=="__main__":
31
if __name__=="__main__":