def addToMembers(self, first_name, last_name, phone, e_mail, paid): if paid: paid = "true" else: paid = "false" b = Member(first_name=first_name.encode("ascii", "backslashreplace"), last_name=last_name.encode("ascii", "backslashreplace"), phone=phone, e_mail=e_mail, paid=paid) return b.id
def searchMembers(self, queryTerms): keys = queryTerms.keys() condition = "1=1 " for key, value in queryTerms.iteritems(): condition = condition + "AND %s LIKE \'%%%s%%\'" % (key, value) members = Member.select(condition) results = {} i = 1 for m in members: results[i] = (m.first_name.decode("unicode_escape"), m.last_name.decode("unicode_escape"), m.phone, m.e_mail, m.paid) i = i + 1 return results
def searchMembers(self,queryTerms): keys=queryTerms.keys() condition = "1=1 " for key, value in queryTerms.iteritems(): condition = condition + "AND %s LIKE \'%%%s%%\'" % (key, value) members = Member.select(condition) results={} i=1 for m in members: results[i]=(m.first_name.decode("unicode_escape"), m.last_name.decode("unicode_escape"), m.phone, m.e_mail, m.paid) i=i+1 return results
def searchMembers(self,queryTerms): keys=queryTerms.keys() condition = "1=1 " for key, value in queryTerms.iteritems(): condition = condition + "AND %s = \'%s\'" % key, value members = Member.select(condition) results={} i=1 for m in members: results[i]=(m.first_name, m.last_name, m.phone, m.e_mail, m.paid) i=i+1 return results
def get(self, id): member = Member.get(id) print member return member
def get(self, id): member = Member.get(id) return member