On Fri, 2008-07-04 at 08:44 -0700, [EMAIL PROTECTED] wrote:
> 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?

"And then I thought I'd post the same thing I did a couple of days ago
to start a new thread, rather than following on from the old one." :-)

Basic debugging 101: work out what has changed, back up until things
work and then go forwards one step at a time.

You claim that more_news.py is the same as recent_news.py with the
exception of some limits. That means you should be able to remove (or
"move aside") the more_news.py file, edit recent_news.py to use the
limits from more_news.py and it should work, right? Verify that. Now you
know that the code itself works.

Then you can diff the recent_news.py and more_news.py files to make sure
that the *only* differences are the tag names and the limits. So now you
know what has changed. Then you can check that in your template the
*only* thing you have changed to switch from using the tags in
recent_news.py to more_news.py is the "{% load ... %}" template tag.

At this point, you've changed things one step at a time:
        1. start from a known, working recent_news.py
        2. change it to behave like you want the new tag to behave.
        3. rename the file to its target name and change the tag name
        4. change the templates to use the new tag name
        
Everything should still be working by that point. If it's not, you've
found the problem. If it is and there are differences with your original
more_news.py file, then you know what to investigate.

There is no limitation on having multiple files in a templatetags/
directory or anything. The problem is somewhere in your code or in your
template. So just work through things one step at a time until something
breaks and then work out what caused that.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
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