from django.conf import settings


def is_comparable():

    """Sets the value of TemplateNode.comparable to True or False."""

    value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_DEFAULT
    return value

from django.conf import settings


def is_node_comparable(instance):

    """Sets the value of TemplateNode.comparable to True or False.

    Relies on the non-abstract TemplateNode implementation where nodes
    can belong to many templates.

    """

    value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE

    if all([t.is_blueprint for t in instance.templates.all()]):
        value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_IN_BLUEPRINT
    else:
        value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_NOT_IN_BLUEPRINT

    return value

Set comparable state of node.
Set comparable state of node.

  from django.conf import settings
  
  
- def is_comparable():
+ def is_node_comparable(instance):
  
-     """Sets the value of TemplateNode.comparable to True or False."""
+     """Sets the value of TemplateNode.comparable to True or False.
  
+     Relies on the non-abstract TemplateNode implementation where nodes
+     can belong to many templates.
+ 
+     """
+ 
-     value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_DEFAULT
+     value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE
+ 
+     if all([t.is_blueprint for t in instance.templates.all()]):
+         value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_IN_BLUEPRINT
+     else:
+         value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_NOT_IN_BLUEPRINT
+ 
      return value
  
Set comparable state of node.
## Code Before:
from django.conf import settings


def is_comparable():

    """Sets the value of TemplateNode.comparable to True or False."""

    value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_DEFAULT
    return value

## Instruction:
Set comparable state of node.
## Code After:
from django.conf import settings


def is_node_comparable(instance):

    """Sets the value of TemplateNode.comparable to True or False.

    Relies on the non-abstract TemplateNode implementation where nodes
    can belong to many templates.

    """

    value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE

    if all([t.is_blueprint for t in instance.templates.all()]):
        value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_IN_BLUEPRINT
    else:
        value = settings.OPENBUDGETS_COMPARABLE_TEMPLATENODE_NOT_IN_BLUEPRINT

    return value
