Subversion Repositories SmartDukaan

Rev

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

Rev 963 Rev 1122
Line 5... Line 5...
5
'''
5
'''
6
from elixir import *
6
from elixir import *
7
from elixir.entity import Entity
7
from elixir.entity import Entity
8
from elixir.fields import Field
8
from elixir.fields import Field
9
from sqlalchemy.types import Integer, Binary
9
from sqlalchemy.types import Integer, Binary
-
 
10
from sqlalchemy import create_engine
10
from elixir.relationships import OneToMany, ManyToOne
11
from elixir.relationships import OneToMany, ManyToOne
11
import datetime
12
import datetime
12
import elixir
13
import elixir
13
 
14
 
14
class Warehouse(Entity):
15
class Warehouse(Entity):
Line 153... Line 154...
153
    using_options(shortnames=True)
154
    using_options(shortnames=True)
154
    using_table_options(mysql_engine="InnoDB")
155
    using_table_options(mysql_engine="InnoDB")
155
    
156
    
156
def initialize():
157
def initialize():
157
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
158
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
158
    metadata.bind = 'mysql://root:shop2020@localhost/catalog'
159
    #metadata.bind = 'mysql://root:shop2020@localhost/catalog'
-
 
160
    engine = create_engine('mysql://root:shop2020@localhost/catalog', pool_recycle=7200)
-
 
161
    metadata.bind = engine
159
    metadata.bind.echo = True
162
    metadata.bind.echo = True
160
    setup_all(True)
163
    setup_all(True)
161
 
164
 
162
if __name__=="__main__":
165
if __name__=="__main__":
163
    initialize()
166
    initialize()
164
167