示例#1
0
文件: recent.py 项目: cstrahan/aduni
AND 
teams.school_id = schools.school_id 
AND 
content.content_type = 'caselist'
AND
content.date_posted > now() - 7
ORDER BY
content.date_posted DESC"""


try:
    db = Ns.DbHandle(Ns.DbPoolDefault(conn.Server()))
except:
    conn.ReturnRedirect("error_page")

most_recently_updated = rowify(db, all_updates_query_string)

### TODO:
###     -keep the school in a TD that spans all the appropriate team *rows*
###     -also, make sure updates from last seven days are displayed in red

html = displayify(most_recently_updated, db)

## '''<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
##         <html> <head>
##         <title>Secondary Sources Caselist - Updates from last 7 days</title>
##         </head>

##         <body bgcolor=white>

##         <table width=100\% align="center">
示例#2
0
  content.message,
  content.date_posted
FROM  content, teams, schools 
WHERE content.team_id = teams.team_id 
AND teams.school_id = schools.school_id 
AND content.content_type = 'comment'
AND teams.team_id = '%s'
ORDER BY content.date_posted DESC""" % team_var
###the schoolpage query will be the same minus the team_name constraint

try:
     db = Ns.DbHandle(Ns.DbPoolDefault(conn.Server()))
except:
     conn.ReturnRedirect('error_page')

content =  rowify(db, comment_query_string)
team_name_query = 'SELECT schools.school_name, teams.team_name FROM schools, teams WHERE team_id = %s' % team_var
team_select = db.Select(team_name_query)
if (db.GetRow(team_select) == Ns.OK):
     team_name = team_select['school_name'] + " " + team_select['team_name']
team_comment_info =  """
<tr>
            <th colspan=4 valign=bottom><h3>Team Page for """ + team_name + """ </h3></th></tr>
    <tr>
            <th width=30\%>
            Team
            </th>
            <Th width=60\%>
            Comment
            </Th>
            <Th width=5\%>
示例#3
0
文件: front.py 项目: cstrahan/aduni
"""

##      CASE
##           WHEN content.date_posted > content.date_posted
##           THEN 'new'
##           ELSE 'old'
##      END
## FROM

try:
     db = Ns.DbHandle(Ns.DbPoolDefault(conn.Server()))
except:
     conn.ReturnRedirect('/project/error_page.html')


whole_list = rowify(db, whole_caselist_query_string)
most_recently_updated = rowify(db, update_query_string)


content = """
<tr>
            <th colspan=4 valign=bottom align=left><h3>Most Recent Submissions <a href=/project/recent.py><font size=1>(last 7 days)</font></a></h3></th></tr>
    <tr>
            <th width=30\%>
            Team
            </th>
            <Th width=60\%>
            Case
            </Th>
            <Th width=5\%>
            Updated on
示例#4
0
WHERE content.team_id = teams.team_id 
AND teams.school_id = schools.school_id 
AND content.content_type = 'comment'
AND teams.team_id = '%s'
AND persons.person_id = content.person_id
AND content.status != 'not approved'
ORDER BY content.date_posted DESC""" % team_var

###the schoolpage query will be the same minus the team_name constraint
###(if I ever implement it)
try:
     db = Ns.DbHandle(Ns.DbPoolDefault(conn.Server()))
except:
     conn.ReturnRedirect('/project/front.py')
###take the query strings and hand them off to rowify to fill in the tables
this_team_cases =  rowify(db, team_aff_query_string)
this_team_neg = rowify(db, team_neg_query_string)
this_team_comments = rowify(db, comment_query_string)

###get the name of the team in question
team_name_query = 'SELECT schools.school_name, teams.team_name FROM schools, teams WHERE team_id = %s AND schools.school_id = teams.school_id' % team_var
team_select = db.Select(team_name_query)
if (db.GetRow(team_select) == Ns.OK):
     team_name = team_select['school_name'] + " " + team_select['team_name']

###here's the content that gets handed off to displayify
team_caselist_info =  '''
<tr>
            <th colspan=4 valign=bottom><h3>Team Page for ''' + team_name + ''' </h3></th></tr>
    <tr>
            <th width=30\%>