Subversion Repositories SmartDukaan

Rev

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

Rev 4762 Rev 4873
Line 1... Line 1...
1
'''
1
'''
2
Created on 22-Mar-2010
2
Created on 22-Mar-2010
3
 
3
 
4
@author: ashish
4
@author: ashish
5
'''
5
'''
6
import datetime
6
from elixir import metadata, setup_all
7
import elixir
-
 
8
from elixir.entity import Entity
7
from elixir.entity import Entity
9
from elixir.fields import Field
8
from elixir.fields import Field
10
from sqlalchemy.types import Integer, String, DateTime, Float, Boolean, Text
-
 
11
from sqlalchemy import create_engine
-
 
12
from elixir.relationships import OneToMany, ManyToOne, ManyToMany
-
 
13
from elixir.options import using_options, using_table_options
9
from elixir.options import using_options, using_table_options
-
 
10
from elixir.relationships import OneToMany, ManyToOne, ManyToMany
14
from elixir import metadata, setup_all
11
from sqlalchemy import create_engine
-
 
12
from sqlalchemy.types import Integer, String, DateTime, Float, Boolean, Text
-
 
13
import datetime
-
 
14
import elixir
15
 
15
 
16
class Vendor(Entity):
16
class Vendor(Entity):
17
    id = Field(Integer, primary_key=True, autoincrement=True)
17
    id = Field(Integer, primary_key=True, autoincrement=True)
18
    name = Field(String(50))
18
    name = Field(String(50))
19
    warehouses = ManyToMany('Warehouse')
19
    warehouses = ManyToMany('Warehouse')
Line 219... Line 219...
219
    username = Field(String(30))
219
    username = Field(String(30))
220
    reason = Field(Text)
220
    reason = Field(Text)
221
    using_options(shortnames=True)
221
    using_options(shortnames=True)
222
    using_table_options(mysql_engine="InnoDB")
222
    using_table_options(mysql_engine="InnoDB")
223
 
223
 
224
class MissingItemKey(Entity):
224
class MissedInventoryUpdate(Entity):
225
    id = Field(Integer, primary_key=True, autoincrement=True)
225
    id = Field(Integer, primary_key=True, autoincrement=True)
226
    itemKey = Field(String(200))
226
    itemKey = Field(String(200))
-
 
227
    quantity = Field(Integer)
227
    warehouseId = Field(Integer)
228
    warehouseId = Field(Integer)
-
 
229
    isIgnored = Field(Boolean)
-
 
230
    timestamp = Field(DateTime)
228
    using_options(shortnames=True)
231
    using_options(shortnames=True)
229
    using_table_options(mysql_engine="InnoDB")
232
    using_table_options(mysql_engine="InnoDB")
230
 
233
 
231
def initialize(dbname='catalog', db_hostname="localhost"):
234
def initialize(dbname='catalog', db_hostname="localhost"):
232
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
235
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.