Hi again. Sorry to disturb you again, but I ran into another issue
related to this template tag I wrote.

I get the following error:

TemplateSyntaxError at /
Caught an exception while rendering: Truncated incorrect DOUBLE value:
'user'


I am not sure what it means exactly, but I beleive the error is
produced by the template tag somehow.

Here is my template tag as it looks now:

@register.tag
def total_num_objects(parser, token):
        # {% total_num_objects in viblevraske.User as num_users %}
        bits = token.contents.split()
        if len(bits) != 5:
                raise TemplateSyntaxError, "total_num_objects tag takes exactly 
5
arguments"
        if bits[1] != 'in':
                raise TemplateSyntaxError, "second argument to 
total_num_objects tag
must be 'in'"
        if bits[3] != 'as':
                raise TemplateSyntaxError, "fourth argument to 
total_num_objects tag
must be 'as'"
        return CountObjectsNode(bits[2], bits[4])


class BlogNode(Node):
        def __init__(self, user, varname):
                self.user, self.varname = user, varname

        def render(self, context):
                try:
                        context[self.varname] = 
Blog.objects.get(user=self.user) # I
beleive this line is causing the trouble
                except ObjectDoesNotExist:
                        return ""



I dont know if its possible to help me with this little information,
but it would be nice :o)

Thanks :o)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to