def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def export(self, request):
        serializer = ConditionExportSerializer(self.get_queryset(), many=True)
        xml = ConditionRenderer().render(serializer.data)
        return XMLResponse(xml, name='conditions')