This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="quotes-container"> | |
@{ | |
var items = Model.ToList(); //Getting Database Model and converting it to a list for easy operations | |
int maxpage = items.Count / 26; //Finding the max page (int floors the decimal place which helps) | |
int startpoint = items.Count() - 1; | |
if (page > 1) | |
{ | |
startpoint -= 26 * (page - 1); | |
} | |
for (var i = startpoint; i >= items.Count() - 26 * page && i > 0; i--) //Basic For Loop printing the quotes to screen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#New Element | |
@route('/create') | |
def create(): | |
return template("create") | |
@route('/create', method="POST") | |
def success(): | |
term = request.forms.get('term') | |
define = request.forms.get('define') | |
cat = request.forms.get('category') |
NewerOlder