def GET(self, rawname): web.header('Content-Type', 'text/html') html = '' name = urllib.unquote(rawname).upper() try: record = Person.byName(name) except SQLObjectNotFound: html += 'could not find %s' % name print(html) return subscriberships = record.subscriberships directorships = record.directorships agencies = record.agencys html += '<h1>%s</h1>' % name html += '<h2>Director</h2><ul>' for company in directorships: html += '<li><a href="%s/company/id/%s">%s</a></li>' % (BASEURL, company.recordid, company.name) html += '</ul>' html += '<h2>Subscriber</h2><ul>' for company in subscriberships: html += '<li><a href="%s/company/id/%s">%s</a></li>' % (BASEURL, company.recordid, company.name) html += '</ul>' html += '<h2>Agent</h2><ul>' for company in agencies: html += '<li><a href="%s/company/id/%s">%s</a></li>' % (BASEURL, company.recordid, company.name) html += '</ul>' return html
def GET(self, rawname): web.header('Content-Type', 'text/html') html = '' name = urllib.unquote(rawname).upper() try: record = Person.byName(name) except SQLObjectNotFound: html += 'could not find %s' % name print(html) return subscriberships = record.subscriberships directorships = record.directorships agencies = record.agencys html += '<h1>%s</h1>' % name html += '<h2>Director</h2><ul>' for company in directorships: html += '<li><a href="%s/company/id/%s">%s</a></li>' % ( BASEURL, company.recordid, company.name) html += '</ul>' html += '<h2>Subscriber</h2><ul>' for company in subscriberships: html += '<li><a href="%s/company/id/%s">%s</a></li>' % ( BASEURL, company.recordid, company.name) html += '</ul>' html += '<h2>Agent</h2><ul>' for company in agencies: html += '<li><a href="%s/company/id/%s">%s</a></li>' % ( BASEURL, company.recordid, company.name) html += '</ul>' return html
def GET(self, rawSearchterm = None): web.header('Content-Type', 'text/html') #print dir(self) #print rawSearchterm #print globals() #print web.input() if rawSearchterm is None: rawSearchterm = web.input()['name'] html = HTMLHEAD unquotedTerm = urllib.unquote(rawSearchterm).upper() liketerm = Person.sqlrepr('%%%s%%' % unquotedTerm) sqlquery = "person.name LIKE %s" % liketerm html += '<h2>Search results</h2><h3>searching for %s</h3><ul>' % sqlquery people = Person.select(sqlquery) for thisone in people: html += "<li><a href='%s/person/%s'>%s</a></li>" %(BASEURL, escape_name(thisone.name), thisone.name) html += '</ul>' html += HTMLTAIL return html
def GET(self, rawSearchterm=None): web.header('Content-Type', 'text/html') #print dir(self) #print rawSearchterm #print globals() #print web.input() if rawSearchterm is None: rawSearchterm = web.input()['name'] html = HTMLHEAD unquotedTerm = urllib.unquote(rawSearchterm).upper() liketerm = Person.sqlrepr('%%%s%%' % unquotedTerm) sqlquery = "person.name LIKE %s" % liketerm html += '<h2>Search results</h2><h3>searching for %s</h3><ul>' % sqlquery people = Person.select(sqlquery) for thisone in people: html += "<li><a href='%s/person/%s'>%s</a></li>" % ( BASEURL, escape_name(thisone.name), thisone.name) html += '</ul>' html += HTMLTAIL return html