Fix working with BaseConditionChoice.default_value_field functions.

Review Request #8352 — Created Aug. 26, 2016 and submitted

Information

Djblets
release-0.10.x
4745ea7...

Reviewers

BaseConditionChoice.default_value_field is allowed to be a function,
but BaseConditionOperator.value_field wasn't handling this case,
breaking some operators/choices. It now checks if it's a function
and calls it.

BaseConditionOperator.has_custom_value_field has been reworked
accordingly, checking if the definitions on the class stray from the
defaults for operators, rather than checking the results of the
properties/functions being called. Without this fix, an operator could
be using the choice's default, but it wouldn't look like it, as it'd
get two different instances during the comparison.

A unit test has been added for these changes.

Unit tests pass.

reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/conditions/operators.py
        djblets/conditions/tests/test_operators.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/conditions/operators.py
        djblets/conditions/tests/test_operators.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.10.x (5772098)