Subversion Repositories SmartDukaan

Rev

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

Rev 1248 Rev 1504
Line 74... Line 74...
74
    #slab = ManyToOne("Slab")
74
    #slab = ManyToOne("Slab")
75
    delivery_time = Field(Integer)
75
    delivery_time = Field(Integer)
76
    reliability = Field(Integer)
76
    reliability = Field(Integer)
77
    using_options(shortnames=True)
77
    using_options(shortnames=True)
78
    using_table_options(mysql_engine="InnoDB")
78
    using_table_options(mysql_engine="InnoDB")
-
 
79
    
-
 
80
class DestinationProviderAllocation(Entity):
-
 
81
    destination_pin = Field(String(6), primary_key=True)
-
 
82
    warehouse_location = Field(Integer, primary_key=True, autoincrement=False)
-
 
83
    provider_less_amount = ManyToOne("Provider")
-
 
84
    provider_more_amount = ManyToOne("Provider")
-
 
85
    using_options(shortnames=True)
-
 
86
    using_table_options(mysql_engine="InnoDB")
79
   
87
   
80
def initialize(dbname="logistics"):
88
def initialize(dbname="logistics"):
81
    #metadata.bind = "sqlite:///logistics.sqlite" #need to read it from configserver.
89
    #metadata.bind = "sqlite:///logistics.sqlite" #need to read it from configserver.
82
    engine = create_engine('mysql://root:shop2020@localhost/' + dbname, pool_recycle=7200)
90
    engine = create_engine('mysql://root:shop2020@localhost/' + dbname, pool_recycle=7200)
83
    metadata.bind = engine
91
    metadata.bind = engine