Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

""" 

    marvin.views.stats 

    ~~~~~~~~~~~~~~~~~~ 

 

    Show some key numbers about the current marvin database. 

 

""" 

from ..models import Movie, Stream, Entry, User 

 

from flask import Blueprint, render_template 

 

mod = Blueprint(__name__, 'marvin.stats') 

 

@mod.route('/') 

def stats_main(): 

    """ Show some key numbers. """ 

    stats = { 

        'Number of movies': Movie.query.count(), 

        'Number of streams': Stream.query.count(), 

        'Number of entries': Entry.query.count(), 

        'Number of users': User.query.count(), 

    } 

    return render_template('stats.html', stats=stats)