i setup a custom template tag for my index page called recent_news.

i tried to setup a second template tag for the page called
more_news.py. the first is working as recent_news.py.

recent_news.py gets the more recent entry, i have more_news.py set to
get 2-6. i have {% load more_news %} since the file is more_news.py,
it's in the same directory as recent_news.py and is the same file as
recent_news.py other than the limits in what query results are getting
and i'm getting the TemplateSyntaxError that the 'more_news' is not a
valid tag library. what's up?

here's the code:

TEMPLATE
{% load more_news %}
{% get_morenews_list %}
{% for news in more_news %}
        <a href="{{ news.get_absolute_url }}">{{ news.title }}</a>
{% endfor %}

MORE_NEWS.PY
from myproject.site.models import Blog
from django.template import Library,Node

register = Library()

def build_morenews_list(parser, token):

    return NewsObject()

class NewsObject(Node):
    def render(self, context):
        context['more_news'] = Blog.blog_live.all().order_by('-
pub_date')[2:6]
        return ''

register.tag('get_morenews_list', build_morenews_list)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to