﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
15660	"""if"" tag doesn't recognize ""class_obj in instance.list_of_classes"""	donspaulding	nobody	"I was writing a template today, and couldn't figure out where my logic was broken.  After a good bit of researching the new ""smart if"" tag, reading through the smartif.py module, and testing, I believe the if tag is broken when evaluating whether a context variable is contained within a list on another context variable.

I had a list of classes as a class attribute of an object, and wanted to see if a different class object was in that list.  The following classes are a stripped down version of my context variables.  


{{{
class PhoneSupport(Service):
    pass

class EmailSupport(Service):
    pass

class LiveSupport(Service):
    pass

class Basic(Bundle):
    services = [PhoneSupport, EmailSupport]

class Premium(Bundle):
    services = [PhoneSupport, EmailSupport, LiveSupport]

class Site(object):
    services = [PhoneSupport, EmailSupport, LiveSupport]
    bundles = [Basic, Premium]

context = Context({'site':Site()})
}}}

I was trying to display this class structure in a template like so:

{{{
{% for bundle in site.bundles %}
    <ul>
        {% for service in site.services %}
            {% if service in bundle.services %}
                <li><img src=""images/checkmark.png"" alt=""Included!""></li>
            {% else %}
                <li>&mdash;</li>
            {% endif %}
        {% endfor %}
    </ul>
{% endfor %}
}}}

If that example isn't very clear, I've also attached the simplest possible test case I could come up with that I think illustrates the problem.  At least, it fails on SVN and I think it is representative of my code.  I'm unable to spot the bug in the smartif.py parser, if it's there.
"		closed	Template system	dev		invalid		donspaulding	Unreviewed	0	0	0	0	0	0
