2

I'm using Django's sites framework and would like to use Gargoyle to enable/disable functionality on a site-by-site basis. This would involve creating my own condition set for Site.

I've read the Condition Set API reference and had a look at the built in sets which come with Gargoyle, but I'm still at a loss as to how I should go about creating my own sets.

sth
  • 222,467
  • 53
  • 283
  • 367
aaronbassett
  • 328
  • 2
  • 7

2 Answers2

1

I've not used Gargoyle yet (though it's on my list of things I'd like to play with), and I agree - the documentation for ConditionSet doesn't look too helpful. Maybe looking at the source for builtins.py, which has the built-in ConditionSets, might help.

Dominic Rodger
  • 97,747
  • 36
  • 197
  • 212
1

It's not very difficult to create a new condition set, you can have a look at what I have done here for example

(I needed a switch based on Django settings' X == value Y):

https://github.com/WoLpH/gargoyle/commit/85b9cc13ca44e1396521ceba0ea3eb25bf5b0506

Tommaso Barbugli
  • 11,781
  • 2
  • 42
  • 41