title: a way to pass m2m field and action into a function's parameter? django
body: <p>Let's say I have a model which has a m2m field named <code>best</code>.</p>
  
  <p>I know by adding things into the <code>best</code> field we can do something like <code>model.best.add(blah)</code> or remove <code>model.best.remove(blah)</code></p>
  
  <p>if I have another m2m field named <code>worst</code> and I want to make a function which will then use the parameter to define if I should be using the <code>best</code> or <code>worst</code> field and if the action is <code>add()</code> or <code>remove</code></p>
  
  <p>Is if possible?</p>
  
  <p>I already tried something silly such as:</p>
  
  <pre><code>def change(field, action, obj):
      model.field.action(obj)
  </code></pre>
  
  <p>of course the above will not work, is there a way to make this work so I do not need to do lots IF if I have LOTS m2m fields in one model?</p>
  
  <p>Thanks in advance for any advices</p>