Re: invalid template tag

2009-08-28 Thread nixon66

Anyone have any suggestions on this. I've tried all recommendations
and still getting same Template errors

On Aug 27, 7:17 pm, nixon66  wrote:
> Still getting the same errors.
>
> On Aug 27, 7:10 pm, Javier Guerra  wrote:
>
> > On Thu, Aug 27, 2009 at 2:03 PM, nixon66 wrote:
> > > register.filter(uscurrency)
>
> > should be
>
> > register.filter ('uscurrency', uscurrency)
>
> > --
> > Javier
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: invalid template tag

2009-08-27 Thread Javier Guerra

On Thu, Aug 27, 2009 at 2:03 PM, nixon66 wrote:
> register.filter(uscurrency)

should be

register.filter ('uscurrency', uscurrency)

-- 
Javier

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: invalid template tag

2009-08-27 Thread nixon66

Still getting the same errors.

On Aug 27, 7:10 pm, Javier Guerra  wrote:
> On Thu, Aug 27, 2009 at 2:03 PM, nixon66 wrote:
> > register.filter(uscurrency)
>
> should be
>
> register.filter ('uscurrency', uscurrency)
>
> --
> Javier
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: invalid template tag

2009-08-27 Thread nixon66

The file is mytag.py and the directory is now called templatetags

On Aug 27, 4:42 pm, Daniel Roseman  wrote:
> On Aug 27, 8:03 pm, nixon66  wrote:
>
> > I've just created a template tag as described in the documents, but
> > keep getting errors.
>
> > In an installed app I created a directory called Templatetags. I
> > created a blank __init__.py file and a file called mytag.
>
> Is the file called just 'mytag' or (as it should be) 'mytag.py'? Is
> the directory called 'Templatetags' rather than
> 'templatetags' (assuming you're on Linux, where case is significant in
> filenames)?
> --
> DR.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: invalid template tag

2009-08-27 Thread nixon66

Made the changes and still getting the same error.


On Aug 27, 3:11 pm, Javier Guerra  wrote:
> i only see a couple of minimal typos, could be your problem:
>
> > In an installed app I created a directory called Templatetags. I
>
> should be 'templatetags', no capitalization.
>
> > created a blank __init__.py file and a file called mytag. Mytag has a
> > function
>
> > from django import template
>
> > register template.Library()
>
> should be 'register = template.Library()'
>
> --
> Javier
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: invalid template tag

2009-08-27 Thread Daniel Roseman

On Aug 27, 8:03 pm, nixon66  wrote:
> I've just created a template tag as described in the documents, but
> keep getting errors.
>
> In an installed app I created a directory called Templatetags. I
> created a blank __init__.py file and a file called mytag.

Is the file called just 'mytag' or (as it should be) 'mytag.py'? Is
the directory called 'Templatetags' rather than
'templatetags' (assuming you're on Linux, where case is significant in
filenames)?
--
DR.
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: invalid template tag

2009-08-27 Thread Javier Guerra

i only see a couple of minimal typos, could be your problem:

> In an installed app I created a directory called Templatetags. I

should be 'templatetags', no capitalization.

> created a blank __init__.py file and a file called mytag. Mytag has a
> function
>
> from django import template
>
> register template.Library()

should be 'register = template.Library()'

-- 
Javier

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



invalid template tag

2009-08-27 Thread nixon66

I've just created a template tag as described in the documents, but
keep getting errors.

In an installed app I created a directory called Templatetags. I
created a blank __init__.py file and a file called mytag. Mytag has a
function

from django import template

register template.Library()

def uscurrency(c):
   try:
   if c > 0:
   return '$%.2f'% c
   else:
   return '-$%.2f' % (-1*c)
   except TypeError:
   return c
register.filter(uscurrency)



In my template I have {% load mytag %}

Yet I get this error:
'mytag' is not a valid tag library: Could not load template library
from django.templatetags.mytag, No module named mytag

Suggestions as to what I'm doing wrong?
--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---