Subversion Repositories SmartDukaan

Rev

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

Rev 2809 Rev 2841
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 *
7
import elixir
7
from elixir.entity import Entity
8
from elixir.entity import Entity
8
from elixir.fields import Field
9
from elixir.fields import Field
9
from sqlalchemy.types import Integer, Binary
10
from sqlalchemy.types import Integer, String, DateTime, Float, Boolean
10
from sqlalchemy import create_engine
11
from sqlalchemy import create_engine
11
from elixir.relationships import OneToMany, ManyToOne
12
from elixir.relationships import OneToMany, ManyToOne
12
import datetime
13
from elixir.options import using_options, using_table_options
13
import elixir
14
from elixir import metadata, setup_all
14
 
15
 
15
class Vendor(Entity):
16
class Vendor(Entity):
16
    id = Field(Integer, primary_key=True, autoincrement=True)
17
    id = Field(Integer, primary_key=True, autoincrement=True)
17
    name = Field(String(50))
18
    name = Field(String(50))
18
    warehouses = OneToMany('Warehouse')
19
    warehouses = OneToMany('Warehouse')
Line 31... Line 32...
31
    vendorString = Field(String(50))
32
    vendorString = Field(String(50))
32
    inventory = OneToMany('CurrentInventorySnapshot')
33
    inventory = OneToMany('CurrentInventorySnapshot')
33
    inventoryHistory = OneToMany('ItemInventoryHistory')
34
    inventoryHistory = OneToMany('ItemInventoryHistory')
34
    logisticsLocation = Field(Integer)
35
    logisticsLocation = Field(Integer)
35
    vendor = ManyToOne('Vendor')
36
    vendor = ManyToOne('Vendor')
-
 
37
    billingType = Field(Integer)
36
    using_options(shortnames=True)
38
    using_options(shortnames=True)
37
    using_table_options(mysql_engine="InnoDB")
39
    using_table_options(mysql_engine="InnoDB")
38
    
40
    
39
    def __repr__(self):
41
    def __repr__(self):
40
        return "<warehouse>%s</warehouse>" %(self.location)
42
        return "<warehouse>%s</warehouse>" %(self.location)