def get(self): email = self.request.get('email') if Hacker.query(Hacker.email == email).count() > 0: self.response.write(json.dumps({"registered": True})) else: #TODO: move this into a more semantic place EmailListEntry.add_email(email) self.response.write(json.dumps({"registered": False}))
def get(self): email = self.request.get('email') if Hacker.query(Hacker.email == email).count() > 0: self.response.write(json.dumps({"registered":True})) else: #TODO: move this into a more semantic place EmailListEntry.add_email(email) self.response.write(json.dumps({"registered":False}))
def post(self): to_put = [] for h in itertools.chain(Hacker.query(), EmailListEntry.query()): if h.email != h.email.lower(): h.email = h.email.lower() to_put.append(h) ndb.put_multi(to_put) self.response.write("Well, it seemed to work...")
def get(self): data = {} data['Signed Up'] = EmailListEntry.query().count() data['Registered'] = Hacker.query().count() data['Accepted'] = Hacker.query(Hacker.admitted_email_sent_date != None).count() data['Confirmed'] = Hacker.query(Hacker.rsvpd == True).count() data['Waitlisted'] = Hacker.query(Hacker.waitlist_email_sent_date != None).count() data['Declined'] = deletedHacker.DeletedHacker.query(deletedHacker.DeletedHacker.admitted_email_sent_date != None).count() self.response.write(json.dumps(data))
def get(self): data = {} data['Signed Up'] = EmailListEntry.query().count() data['Registered'] = Hacker.query().count() data['Accepted'] = Hacker.query( Hacker.admitted_email_sent_date != None).count() data['Confirmed'] = Hacker.query(Hacker.rsvpd == True).count() data['Waitlisted'] = Hacker.query( Hacker.waitlist_email_sent_date != None).count() data['Declined'] = deletedHacker.DeletedHacker.query( deletedHacker.DeletedHacker.admitted_email_sent_date != None ).count() self.response.write(json.dumps(data))
def get_query(self): if self.audience == 'registered': return Hacker.query() elif self.audience == 'accepted': return Hacker.query(Hacker.admitted_email_sent_date != None) elif self.audience == 'accepted-non-local': return Hacker.query(Hacker.admitted_email_sent_date != None) elif self.audience == 'invited-friends': return Hacker.query(Hacker.teammates != None) elif self.audience == 'mailing-list-unregistered': return EmailListEntry.query() elif self.audience == 'waitlisted': print "sending waitlisted emails: " + str(Hacker.query(Hacker.admitted_email_sent_date == None).count()) return Hacker.query(Hacker.admitted_email_sent_date == None) elif self.audience == 'hardware-hackers': print "sending emails to admitted hardware-hackers: " + str(Hacker.query(Hacker.admitted_email_sent_date != None, Hacker.hardware_hack == 'yes').count()) return Hacker.query(Hacker.admitted_email_sent_date != None, Hacker.hardware_hack == 'yes') elif self.audience == 'accepted-highschool-freshmen': print "sending emails to accepted highschool and freshman hackers" return Hacker.query(ndb.AND(Hacker.admitted_email_sent_date != None, ndb.OR(Hacker.year == 'highschool', Hacker.year == 'freshman'))) elif self.audience == 'local-waitlisted': print "sending emails to local waitlisted hackers: " return Hacker.query(Hacker.admitted_email_sent_date == None) elif self.audience == 'rsvped-first-time': print "sending emails to rsvped-first-time hackers" return Hacker.query(ndb.AND(Hacker.rsvpd == True, Hacker.first_hackathon =='yes')) elif self.audience == 'checked-in': print 'sending emails to checked-in hackers: ' + str(Hacker.query(Hacker.checked_in == True).count()) return Hacker.query(Hacker.checked_in == True) elif self.audience == 'accepted-local': print "sending emails to accepted-local" return Hacker.query(Hacker.admitted_email_sent_date != None) elif self.audience == None: return None else: assert 0, "Unknown audience"