Subversion Repositories SmartDukaan

Rev

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

Rev 3359 Rev 3557
Line 3... Line 3...
3
 
3
 
4
@author: ashish
4
@author: ashish
5
'''
5
'''
6
from shop2020.thriftpy.model.v1.catalog.ttypes import  Item,\
6
from shop2020.thriftpy.model.v1.catalog.ttypes import  Item,\
7
    ItemInventory, Warehouse, VendorItemPricing, Vendor, Category,\
7
    ItemInventory, Warehouse, VendorItemPricing, Vendor, Category,\
8
    VendorItemMapping
8
    VendorItemMapping, SourceItemPricing, Source
9
import time
9
import time
10
from shop2020.utils.Utils import to_java_date
10
from shop2020.utils.Utils import to_java_date
11
 
11
 
12
def to_t_item(item):
12
def to_t_item(item):
13
    t_item = Item()
13
    t_item = Item()
Line 119... Line 119...
119
    t_category = Category()
119
    t_category = Category()
120
    t_category.id = category.id
120
    t_category.id = category.id
121
    t_category.label = category.label
121
    t_category.label = category.label
122
    t_category.description = category.description
122
    t_category.description = category.description
123
    t_category.parent_category_id = category.parent_category_id
123
    t_category.parent_category_id = category.parent_category_id
124
    return t_category
-
 
125
124
    return t_category
-
 
125
 
-
 
126
def to_t_source_item_pricing(source_item_pricing):
-
 
127
    t_source_item_pricing = SourceItemPricing()
-
 
128
    t_source_item_pricing.sourceId = source_item_pricing.source.id
-
 
129
    t_source_item_pricing.itemId = source_item_pricing.item.id
-
 
130
    t_source_item_pricing.mrp = source_item_pricing.mrp
-
 
131
    t_source_item_pricing.sellingPrice = source_item_pricing.sellingPrice
-
 
132
    return t_source_item_pricing
-
 
133
 
-
 
134
def to_t_source(source):
-
 
135
    t_source = Source()
-
 
136
    t_source.id = source.id
-
 
137
    t_source.name = source.name
-
 
138
    t_source.identifier = source.identifier
-
 
139
    return t_source
-
 
140