1. akoha
  2. django-lean
  3. Issues
Issue #3 new

Allow for concise usage of experiment tags

Erik Wright
created an issue

See <<issue 1>>, which this is extracted from.

//With the template tags//

//{% experiment name control %}{% endexperiment %}{% experiment name test %}{% endexperiment %}//

//, there will always be a control and a test I presume. Could this be made into something shorter and simpler like://

//{% experiment control name %}Control{% experiment test %}Test{% endexperiment %}//

We thought about this, but felt that it would be trickier to implement and therefore chose not to do it. The main concern was for nesting - it's quite reasonable to have multiple and even nested experiments, so the implementation would have to be smart about this. Since the "if/else/endif" tags support this it's probably not too too hard, but we punted in the interests of YAGNI.

We will also have to take into consideration the issues exposed by reversing the order of the parameters. While it clearly makes sense (if we support this concise form) to reverse them, this would have a backwards-compatibility impact. I suppose the tags could be intelligent about detecting historic uses (i.e, if "test" or "control" is the first arg, assume it is a historic usage).