Subversion Repositories SmartDukaan

Rev

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

Rev 22309 Rev 23142
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
-
 
7
 
6
from elixir import metadata, setup_all
8
from elixir import metadata, setup_all
-
 
9
import elixir
7
from elixir.entity import Entity
10
from elixir.entity import Entity
8
from elixir.fields import Field
11
from elixir.fields import Field
9
from elixir.options import using_options, using_table_options
12
from elixir.options import using_options, using_table_options
10
from elixir.relationships import OneToMany, ManyToOne
13
from elixir.relationships import OneToMany, ManyToOne
-
 
14
from sqlalchemy import Column
11
from sqlalchemy import create_engine
15
from sqlalchemy import create_engine
12
from sqlalchemy.types import Integer, String, DateTime, Float, Boolean, Text, Enum, BigInteger, Date
16
from sqlalchemy.types import Integer, String, DateTime, Float, Boolean, Text, Enum, BigInteger, Date
13
import datetime
-
 
14
import elixir
17
 
15
 
18
 
16
class EntityIDGenerator(Entity):
19
class EntityIDGenerator(Entity):
17
    id=Field(Integer, primary_key=True)
20
    id=Field(Integer, primary_key=True)
18
    using_options(shortnames=True)
21
    using_options(shortnames=True)
19
    using_table_options(mysql_engine="InnoDB")
22
    using_table_options(mysql_engine="InnoDB")
Line 65... Line 68...
65
    packQuantity = Field(Integer, default=1, server_default="1")
68
    packQuantity = Field(Integer, default=1, server_default="1")
66
    quantityStep = Field(Integer, default=1, server_default="1")
69
    quantityStep = Field(Integer, default=1, server_default="1")
67
    minimumBuyQuantity = Field(Integer, default=1, server_default="1")
70
    minimumBuyQuantity = Field(Integer, default=1, server_default="1")
68
    maximumBuyQuantity = Field(Integer, default=0, server_default="0")
71
    maximumBuyQuantity = Field(Integer, default=0, server_default="0")
69
    hsnCode = Field(String(12))
72
    hsnCode = Field(String(12))
-
 
73
    tax_rate = Field(Float, default = 0, server_default="0")
70
    using_options(shortnames=True)
74
    using_options(shortnames=True)
71
    using_table_options(mysql_engine="InnoDB")
75
    using_table_options(mysql_engine="InnoDB")
72
    
76
    
73
    def __repr__(self):
77
    def __repr__(self):
74
        return "<Item>%d</item>" % (self.id)
78
        return "<Item>%d</item>" % (self.id)
Line 85... Line 89...
85
    hsnCode = Field(String(12), primary_key=True)
89
    hsnCode = Field(String(12), primary_key=True)
86
    description = Field(String(64))
90
    description = Field(String(64))
87
    using_options(shortnames=True)
91
    using_options(shortnames=True)
88
    using_table_options(mysql_engine="InnoDB")
92
    using_table_options(mysql_engine="InnoDB")
89
    
93
    
-
 
94
class StateGstRate(Entity):
-
 
95
    item_id = Field(Integer, primary_key=True)
-
 
96
    state_id = Field(Integer, primary_key=True)
-
 
97
    tax_rate = Field(Float)
-
 
98
    using_options(shortnames=True)
-
 
99
    using_table_options(mysql_engine="InnoDB")
90
 
-
 
91
 
100
 
92
class ItemChangeLog(Entity):
101
class ItemChangeLog(Entity):
93
    id = Field(Integer, primary_key=True, autoincrement=True)
102
    id = Field(Integer, primary_key=True, autoincrement=True)
94
    old_status = Field(Integer)
103
    old_status = Field(Integer)
95
    new_status = Field(Integer)
104
    new_status = Field(Integer)