Example #1
0
def statistics():
    # käyttäjien kokonaismäärä
    number_of_users = User.total_number_of_users()
   
    # viestejä lähettäneiden kokonaismäärä
    number_of_posters = User.total_number_of_posting_users()

    # viestien määrä
    number_of_messages = Message.total_number_of_messages()

    # ketjujen määrä
    number_of_threads = Thread.total_number_of_threads()

    return render_template("statistics.html", 
                            number_of_users = number_of_users,
                            number_of_posters = number_of_posters,
                            number_of_messages = number_of_messages,
                            number_of_threads = number_of_threads)
Example #2
0
def index():
    return render_template("frontpage.html", \
                            latest_messages = Message.get_latest_messages(number_to_be_displayed=10),
                            number_of_messages = Message.total_number_of_messages(),
                            number_of_users = User.total_number_of_posting_users())