Subversion Repositories SmartDukaan

Rev

Rev 5591 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4503 mandeep.dh 1
'''
2
Created on 29-Jul-2011
3
 
4
@author: Chandranshu
5
'''
6
from elixir.entity import Entity
7
from elixir.fields import Field
8
from sqlalchemy.types import Integer, String
9
from elixir.options import using_options, using_table_options
10
 
11
from shop2020.thriftpy.purchase.ttypes import Supplier as TSupplier
12
 
13
class Supplier(Entity):
14
    '''
15
    classdocs
16
    '''
17
    id = Field(Integer, primary_key=True, autoincrement=True)
18
    name = Field(String(30))
19
    phone = Field(String(12))
20
    fax = Field(String(12))
21
    tin = Field(String(10))
22
    pan = Field(String(10))
23
    headName = Field(String(30))
24
    headDesignation = Field(String(20))
25
    headEmail = Field(String(50))
26
    contactName = Field(String(30))
27
    contactPhone = Field(String(12))
28
    contactFax = Field(String(12))
29
    contactEmail = Field(String(50))
30
    registeredAddress = Field(String(100))
31
    communicationAddress = Field(String(100))
32
    using_options(shortnames=True)
33
    using_table_options(mysql_engine="InnoDB")
34
 
35
    def __init__(self, params):
36
        '''
37
        Constructor
38
        '''
39
        pass
40
 
41
    def to_thrift_object(self):
42
        t_supplier = TSupplier()
43
        t_supplier.id = self.id
44
        t_supplier.name = self.name
45
        t_supplier.phone = self.phone
46
        t_supplier.fax = self.fax
47
        t_supplier.tin = self.tin
48
        t_supplier.pan = self.pan
49
        t_supplier.headName = self.headName
50
        t_supplier.headDesignation = self.headDesignation
51
        t_supplier.headEmail = self.headEmail
52
        t_supplier.contactName = self.contactName
53
        t_supplier.contactPhone = self.contactPhone
54
        t_supplier.contactFax = self.contactFax
55
        t_supplier.contactEmail = self.contactEmail
56
        t_supplier.registeredAddress = self.registeredAddress
57
        t_supplier.communicationAddress = self.communicationAddress
58
 
59
        return t_supplier