Subversion Repositories SmartDukaan

Rev

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

Rev 15822 Rev 16167
Line 3... Line 3...
3
 
3
 
4
@author: amit
4
@author: amit
5
'''
5
'''
6
from dtr import main
6
from dtr import main
7
from dtr.storage import Mongo, Mysql
7
from dtr.storage import Mongo, Mysql
-
 
8
from dtr.utils import utils
8
import falcon
9
import falcon
9
import json
10
import json
10
import urlparse
-
 
11
import re
11
import re
-
 
12
import urlparse
12
class StoreOrder():
13
class StoreOrder():
13
    def on_post(self, req, resp):
14
    def on_post(self, req, resp):
14
        
15
        
15
        try:
16
        try:
16
            string1 = req.stream.read()
17
            string1 = req.stream.read()
Line 31... Line 32...
31
        string1 = req.get_param("searchMap")
32
        string1 = req.get_param("searchMap")
32
        orderType = req.get_param("type")
33
        orderType = req.get_param("type")
33
        searchMap={}
34
        searchMap={}
34
        if orderType is not None and orderType != "":
35
        if orderType is not None and orderType != "":
35
            if orderType in ['needamazonorderdetail','needamazonordertrack']:
36
            if orderType in ['needamazonorderdetail','needamazonordertrack']:
36
                searchMap={"$or":[{"subOrders.closed":False,"subOrders.trackingUrl":{"$exists":True}}, {"status":"html_required"}], "storeId":1}
37
                searchMap={"$or":[{"subOrders.closed":False,"subOrders.trackingUrl":{"$exists":False},"subOrders.trackAfter":{"$lt":utils.getCurrTimeStamp()}}, {"status":"html_required"}], "storeId":1}
37
        elif string1 is not None and string1 != "":
38
        elif string1 is not None and string1 != "":
38
            try:
39
            try:
39
                searchMap = json.loads(string1, encoding='utf-8')
40
                searchMap = json.loads(string1, encoding='utf-8')
40
            except:
41
            except:
41
                raise falcon.HTTPError(falcon.HTTP_400,
42
                raise falcon.HTTPError(falcon.HTTP_400,