Subversion Repositories SmartDukaan

Rev

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

Rev 777 Rev 873
Line 1... Line 1...
1
import time
1
import time
2
from shop2020.test.DataService import initialize, session
2
from shop2020.test.DataService import initialize, session
3
from shop2020.test.DataService import UserTable
3
from shop2020.test.DataService import UserTable
-
 
4
from shop2020.thriftpy.test.ttypes import Address
-
 
5
from sqlalchemy.sql.expression import select
4
 
6
 
5
 
7
 
6
class TestServiceHandler:
8
class TestServiceHandler:
7
 
9
 
8
        
10
        
Line 15... Line 17...
15
         - message
17
         - message
16
        """
18
        """
17
        time.sleep(6)
19
        time.sleep(6)
18
        print message
20
        print message
19
        
21
        
-
 
22
    def getAddressId(self):
-
 
23
        print "hello"
-
 
24
        return None
20
        
25
    
-
 
26
    def getAddress(self):
-
 
27
        address = Address()
-
 
28
        address.address = "Hello address"
-
 
29
        address.addressId = None
-
 
30
        return address
-
 
31
    
21
    def getUser(self, id):
32
    def getUser(self, id):
22
        """
33
        """
23
        Parameters:
34
        Parameters:
24
         - id
35
         - id
25
        """
36
        """
-
 
37
        print select([UserTable.id], distinct=True).order_by(UserTable.name) 
-
 
38
 
-
 
39
 
26
        user = UserTable.get_by(id=id)
40
        user = UserTable.get_by(id=id)
27
        if user is None:
41
        if user is None:
28
            name = "No User"
42
            name = "No User"
29
        else:
43
        else:
30
            name = user.name
44
            name = user.name