Exemple #1
0
    def post(self):
        number = self.request.get('phone')
        if number and len(number) == 10 and number.isdigit():
            ccnumber = "+1" + number
            # find other instances of this
            q = Member.all()
            q.filter("number =", ccnumber)
            member = q.get()

            if member is None:
                m = Member(number=ccnumber)
                m.put()
                sendWelcome(ccnumber)
                self.response.out.write("""
					<html><body>
					Thanks for signing up for Cat Facts!
					</body></html>
				""")
            else:
                self.response.out.write("""
					<html><body>
					You've already signed up for Cat Facts!
					</body></html>
				""")
        else:
            self.response.out.write("""
				<html><body>
				You need to give me a phone number.
				</body></html>
			""")
Exemple #2
0
    def get(self):
        q = Member.all()
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.write(fact)

        for m in q.run(limit=50):
            sendFact(m.number)
Exemple #3
0
	def get(self):
		q = Member.all()
		self.response.headers['Content-Type'] = 'text/plain'
		self.response.write(fact)

		for m in q.run(limit=50):
			sendFact(m.number)
Exemple #4
0
    def post(self):
        number = self.request.get("phone")
        if number and len(number) == 10 and number.isdigit():
            ccnumber = "+1" + number
            # find other instances of this
            q = Member.all()
            q.filter("number =", ccnumber)
            member = q.get()

            if member is None:
                m = Member(number=ccnumber)
                m.put()
                sendWelcome(ccnumber)
                self.response.out.write(
                    """
					<html><body>
					Thanks for signing up for Cat Facts!
					</body></html>
				"""
                )
            else:
                self.response.out.write(
                    """
					<html><body>
					You've already signed up for Cat Facts!
					</body></html>
				"""
                )
        else:
            self.response.out.write(
                """
				<html><body>
				You need to give me a phone number.
				</body></html>
			"""
            )
Exemple #5
0
    def get(self):
        self.response.out.write('<html><body>')

        q = Member.all()
        if len(list(q.run(limit=51))) > 50:
            self.response.out.write("""
			Sorry, Cat Facts has too many users.
			</body></html>""")
        else:
            self.response.out.write("""
				<form action="/signup" method="post">
					<div>
						Phone Number:<input type="text" name="phone"></textarea> (e.g. 5551234567)
						<input type="submit" value="Sign up for Cat Facts">
					</div>
				</form>
			</body></html>""")
Exemple #6
0
    def get(self):
        self.response.out.write("<html><body>")

        q = Member.all()
        if len(list(q.run(limit=51))) > 50:
            self.response.out.write(
                """
			Sorry, Cat Facts has too many users.
			</body></html>"""
            )
        else:
            self.response.out.write(
                """
				<form action="/signup" method="post">
					<div>
						Phone Number:<input type="text" name="phone"></textarea> (e.g. 5551234567)
						<input type="submit" value="Sign up for Cat Facts">
					</div>
				</form>
			</body></html>"""
            )