For test2 get rid of the stringfilter attribute because that will convert
the order to its string value.

Other than that I think it looks good, assuming you have 'orders' in your
template context.
On Feb 8, 2011 10:27 PM, "Tres Finocchiaro" <[email protected]>
wrote:
> Unfortunately I don't know the repercussions of doing that, and this is a
> fairly high-activity site (I'm doing some html contract work).
>
> So I think I'm close, but no insight to a debugger...
> I followed the Django Custom Tempate Tag link sent earlier, works great.
>
> *@register.filter(name='test1')*
>
> *@stringfilter*
>
> *def test1(value):
>> return value.lower()*
>
>
> I implemented this with: *{% load order_extras %}{{ "HELLO world"|test1
}}*.
> Works great.
>
> Next I create:
>
>> *@register.filter(name='test2')
>> @stringfilter
>> def test2(order):
>> return order.contact.firstname()*
>
>
> I implemented this with: *{% for order in orders %}{{ order|test2 }}{{%
> endfor %}}*. No dice. Any ideas? I use order other places in my template
> and it works fine. Without debug I'm totally lost! : )
>
> -Tres
>
> On Tue, Feb 8, 2011 at 11:13 PM, Stuart Laughlin <[email protected]
>wrote:
>
>> Just restart your server. I'd be more explicit but specifics vary
>> drastically based on platform, web server, etc. If you are very, very
>> fortunate it means something like sudo /etc/init.d/apache2 reload. ;)
>>
>> --Stuart
>> On Feb 8, 2011 10:09 PM, "Tres Finocchiaro" <[email protected]>
>> wrote:
>> > Debug was false. Changed it to true. Noob question, but how do I make
the
>> > setting take effect?
>> >
>> > -Tres
>> >
>> > On Tue, Feb 8, 2011 at 10:27 PM, Stuart Laughlin <[email protected]
>> >wrote:
>> >
>> >> Check your settings.py and make sure debug is set to true. If it is,
>> I'll
>> >> try to think of why else you might not be seeing good error messages.
>> >>
>> >> --Stuart
>> >> On Feb 8, 2011 8:03 PM, "Tres Finocchiaro" <[email protected]
>
>> >> wrote:
>> >> > "Internal Server Error" is all I ever get via browser when there's
an
>> >> error.
>> >> >
>> >> > The person before me... may have turned off verbosity?
>> >> >
>> >> > -Tres
>> >> >
>> >> > On Tue, Feb 8, 2011 at 2:01 PM, Stuart Laughlin <
>> [email protected]
>> >> >wrote:
>> >> >
>> >> >> On Tue, Feb 8, 2011 at 12:47 PM, Tres Finocchiaro
>> >> >> <[email protected]> wrote:
>> >> >> >
>> >> >> > Is there a way to know if I have python syntax errors? I
understand
>> >> it's
>> >> >> > "kind of" compiled, but when I made modifications to other python
>> >> items,
>> >> >> it
>> >> >> > wouldn't update immediately, and in some cases break the entire
>> site
>> >> >> without
>> >> >> > much insight into the errors. For this, I backed up files before
>> >> >> modifying
>> >> >> > them, but I'm a bit more accustomed to a "^---- Here's your
error"
>> >> >> > debugging.
>> >> >> >
>> >> >>
>> >> >> When you change a py file you'll need to restart your app server
>> >> >> (unless you're using the django dev server). Template changes
should
>> >> >> just work with no restart.
>> >> >>
>> >> >> If you have a python syntax error, you should get a pretty decent
>> >> >> error message in your browser -- stack trace, exception details
etc.
>> >> >> If you come across anything too opaque / confusing, feel free to
ask
>> >> >> about it.
>> >> >>
>> >> >>
>> >> >> Good luck!
>> >> >>
>> >> >> --Stuart
>> >> >>
>> >> >> --
>> >> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> >> "Satchmo users" group.
>> >> >> To post to this group, send email to [email protected]
.
>> >> >> To unsubscribe from this group, send email to
>> >> >> [email protected].
>> >> >> For more options, visit this group at
>> >> >> http://groups.google.com/group/satchmo-users?hl=en.
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> > - [email protected]
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> Groups
>> >> "Satchmo users" group.
>> >> > To post to this group, send email to [email protected].
>> >> > To unsubscribe from this group, send email to
>> >> [email protected].
>> >> > For more options, visit this group at
>> >> http://groups.google.com/group/satchmo-users?hl=en.
>> >> >
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> Groups
>> >> "Satchmo users" group.
>> >> To post to this group, send email to [email protected].
>> >> To unsubscribe from this group, send email to
>> >> [email protected].
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/satchmo-users?hl=en.
>> >>
>> >
>> >
>> >
>> > --
>> > - [email protected]
>> >
>> > --
>> > You received this message because you are subscribed to the Google
Groups
>> "Satchmo users" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to
>> [email protected].
>> > For more options, visit this group at
>> http://groups.google.com/group/satchmo-users?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Satchmo users" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/satchmo-users?hl=en.
>>
>
>
>
> --
> - [email protected]
>
> --
> You received this message because you are subscribed to the Google Groups
"Satchmo users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
[email protected].
> For more options, visit this group at
http://groups.google.com/group/satchmo-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.

Reply via email to