Exemple #1
0
    def get( self ):
        users = User.all()
        for u in users:
            u.put()

        return
        
        # Don't run this again!
        names = [ 'Yuriy Blokhin', 'Mike Roberts', 'Andrei Skarine', 'Chris Best', 'Chris Fairles', 'Daniel Hendry', 'Jonathan Meyer', 'Nick Belyaev',
        'Adam Allidina', 'Peter Heinke', 'Julian Haldenby', 'Michael MacKenzie', 'Angela Watkins', 'Peter Wagner', 'Vick Yao', 'Erika Podlovics', 'Christine Thayer', 'Heather Galt',
        'Adrian Kenny', 'Jairaj Sethi', 'Benjamin Chilibeck', 'Rob McLeod', 'Ted Livingston', 'Barbara Macdonald']
        
        urls = ['static/imgs/YuriyBlokhin.jpeg', 'static/imgs/MichaelRoberts.jpg', 'static/imgs/AndreiSkarine.jpg', 'static/imgs/ChrisBest.jpg',
        'static/imgs/ChrisFairles.jpg', 'static/imgs/DanielHendry.jpg', 'static/imgs/JonathanMeyer.jpg', 'static/imgs/NikolayBelyaev.jpg', 'static/imgs/AdamAllidina.jpg',
        'static/imgs/PeterHeinke.jpg', 'static/imgs/JulianHaldenby.jpg', 'static/imgs/MichaelMacKenzie.jpg', 'static/imgs/AngelaWatkins.jpg', 'static/imgs/PeterWagner.jpg', 'static/imgs/VickYao.jpg', 'static/imgs/ErikaPodlovics.jpg', 'static/imgs/ChristineThayer.jpg', 'static/imgs/HeatherGalt.jpg', 'static/imgs/AdrianKenny.jpeg', 'static/imgs/JairajSethi.jpeg', 'static/imgs/BenjaminChilibeck.jpg', 'static/imgs/RobMcLeod.jpg', 'static/imgs/TedLivingston.jpg', 'static/imgs/BarbaraMacdonald.jpg']
        
        for i in range( 0, 25 ):
            user = User.create( names[i], urls[i] )
Exemple #2
0
    def post( self ):
        user = self.get_user()

        if not user:
            first_name  = self.request.get( 'firstName' )
            last_name   = self.request.get( 'lastName' )
            email       = self.request.get( 'email' )
            
            user        = User.create( first_name, last_name, email )

            # Cache the User
            self.db_user = user

            # Have to do this here to avoid a circular reference
            set_user_cookie( self, user.uuid )
        
        self.response.headers['Content-Type'] = "application/json"
        self.response.out.write( json.dumps( { 'uuid' : user.uuid,
                                               'img'  : user.img } ) )