Exemple #1
0
def random():
    word = Entry.get_random()

    # Test if an entry was returned
    if word:
        word = word['slug']
        return redirect(url_for('qchar', word=word))
    else:
        return ""
Exemple #2
0
def main():
    samples = []

    for i in range(3):
        e = Entry.objects.get(slug=Entry.get_random()['slug'])
        samples.append({'name': e.name, 'definition': e.get_hero()})

    return render_template('main.html',
                           letters=[x for x in uppercase],
                           samples=samples)
Exemple #3
0
def main():
    samples = []

    for i in range(3):
        e = Entry.objects.get(slug=Entry.get_random()['slug'])
        samples.append({'name': e.name, 'definition': e.get_hero()})

    return render_template(
            'main.html',
            letters=[x for x in uppercase],
            samples=samples
        )
Exemple #4
0
def main():
    """
    Presents main Page
    With 3 random words on the front page if DB has more than 3 words.
    """
    samples = []

    for i in range(3):
        #e = Entry.objects.get(slug=Entry.get_random()['slug'])
        entry = Entry.get_random()
        if entry:
            samples.append({'name': entry.name, 'definition': entry.get_hero()})

    return render_template(
            'main.html',
            letters=[x for x in uppercase],
            samples=samples
        )
Exemple #5
0
def random():
    word = Entry.get_random()['slug']
    return redirect(url_for('qchar', word=word))
Exemple #6
0
def random():
    word = Entry.get_random()['slug']
    return redirect(url_for('qchar', word=word))