Esempio n. 1
0
def get_latest_articles_by_tag( *args, **kwargs):
    """
    Usage:
    
    {% get_latest_articles_by_tag tagString="Technology,Biology,Match" amount=5 as articles %}
    
    {% for article in articles %}
        {{ article.title }}
    {% endfor %}
    
    Notes: If tagString is not defined or an empty string, 'getLatestArticles' will be called.
    """
    amount = kwargs.get('amount',5)
    tagString = kwargs.get('tagString', None)
    if tagString is None or tagString == '':
        return getLatestArticles(amount)
    return getLatestArticlesByTag(amount, tagString=tagString)
Esempio n. 2
0
def get_latest_articles(request):
    return getLatestArticles(5)
Esempio n. 3
0
def getNewest(count=1):
    return getLatestArticles(count)
Esempio n. 4
0
def get_latest_slug(request):
    latest = getLatestArticles(1)
    return latest.slug