def get(self):
     custom_field_id = request.args['id']
     cf = CustomField.query.get_or_404(custom_field_id)
     if cf.field_type == CustomField.CATEGORY:
         query = Category.get_categories_for_meeting(Category.PARTICIPANT)
         return jsonify(data=[(i.id, unicode(i)) for i in query])
     if cf.field_type == CustomField.COUNTRY:
         return jsonify(data=get_all_countries())
     if cf.field_type == CustomField.CHECKBOX:
         return jsonify(data=ConditionForm.CHECKBOX_VALUES)
     if cf.field_type == CustomField.SELECT:
         query = cf.choices.all()
         return jsonify(data=[(unicode(i), unicode(i)) for i in query])
     return abort(400)
 def _get_query_for_countries(self):
     return get_all_countries()