Example #1
0
def index():
    with db:
        metrics = Job.aggregate_metrics()
    return render_template('index.html',
                           nav_tabs=None,
                           metrics=metrics,
                           stories=Story.listing())
Example #2
0
def learn():
    return render_template('learn.html',
                           nav_active='motivation',
                           subnav_tabs=HANDBOOK_SUBNAV_TABS,
                           subnav_active='learn',
                           stories_count=len(Story.listing()),
                           thumbnail=thumbnail(title='Jak se naučit programovat'))
Example #3
0
def index():
    with db:
        jobs_count = Job.count()
        companies_count = Job.companies_count()
    return render_template('index.html',
                           jobs_count=jobs_count,
                           companies_count=companies_count,
                           stories=Story.listing())
Example #4
0
def motivation():
    return render_template(
        'motivation.html',
        nav_active='motivation',
        subnav_tabs=HANDBOOK_SUBNAV_TABS,
        subnav_active='motivation',
        stories_count=len(Story.listing()),
        thumbnail=thumbnail(title='Proč se učit programování'))
Example #5
0
def motivation():
    with db:
        stories = Story.listing()
        stories_by_tags = Story.tags_mapping()
    return render_template('motivation.html',
                           nav_active='motivation',
                           subnav_tabs=HANDBOOK_SUBNAV_TABS,
                           subnav_active='motivation',
                           stories=stories,
                           stories_by_tags=stories_by_tags,
                           thumbnail=thumbnail(title='Proč se učit programování'))
Example #6
0
def learn():
    return render_template(
        'learn.html',
        stories_count=len(Story.listing()),
        thumbnail=thumbnail(title='Jak se naučit programovat'))
def test_listing_sorts_by_date_desc(db):
    story1 = create_story(date=datetime(2010, 7, 6, 20, 24, 3))
    story2 = create_story(date=datetime(2019, 7, 6, 20, 24, 3))
    story3 = create_story(date=datetime(2014, 7, 6, 20, 24, 3))

    assert list(Story.listing()) == [story2, story3, story1]
Example #8
0
def test_listing_sorts_by_date_desc(db_connection):
    story1 = create_story(date=date(2010, 7, 6))
    story2 = create_story(date=date(2019, 7, 6))
    story3 = create_story(date=date(2014, 7, 6))

    assert list(Story.listing()) == [story2, story3, story1]