| 
									
										
										
										
											2020-07-04 23:50:18 +02:00
										 |  |  | from flask import render_template | 
					
						
							| 
									
										
										
										
											2020-07-11 16:59:37 +02:00
										 |  |  | from WebHostLib import app, cache | 
					
						
							| 
									
										
										
										
											2020-07-21 06:35:47 +02:00
										 |  |  | from .models import * | 
					
						
							|  |  |  | from datetime import timedelta | 
					
						
							| 
									
										
										
										
											2020-07-04 23:50:18 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | @app.route('/', methods=['GET', 'POST']) | 
					
						
							| 
									
										
										
										
											2020-08-13 09:23:52 +02:00
										 |  |  | @cache.cached(timeout=300)  # cache has to appear under app route for caching to work | 
					
						
							| 
									
										
										
										
											2020-07-04 23:50:18 +02:00
										 |  |  | def landing(): | 
					
						
							| 
									
										
										
										
											2020-08-13 09:23:52 +02:00
										 |  |  |     rooms = count(room for room in Room if room.creation_time >= datetime.utcnow() - timedelta(days=7)) | 
					
						
							|  |  |  |     seeds = count(seed for seed in Seed if seed.creation_time >= datetime.utcnow() - timedelta(days=7)) | 
					
						
							|  |  |  |     return render_template("landing.html", rooms=rooms, seeds=seeds) |