示例#1
0
    def _publish_markdown(self, md, user, project=None, **kwargs):
        kwargs['name'] = 'data'
        survey = self.md_to_pyxform_survey(md, kwargs=kwargs)
        survey['sms_keyword'] = survey['id_string']
        if not project or not hasattr(self, 'project'):
            project = get_user_default_project(user)
        xform = DataDictionary(created_by=user, user=user,
                               xml=survey.to_xml(), json=survey.to_json(),
                               project=project)
        xform.save()

        return xform
示例#2
0
    def _publish_md(self, md, user, project=None):
        survey = self.md_to_pyxform_survey(md)
        if not project:
            project = get_user_default_project(user)
        xform = DataDictionary(created_by=user,
                               user=user,
                               xml=survey.to_xml(),
                               json=survey.to_json(),
                               project=project)
        xform.save()

        return xform
示例#3
0
    def _publish_markdown(self, md, user, project=None, **kwargs):
        kwargs['name'] = 'data'
        survey = self.md_to_pyxform_survey(md, kwargs=kwargs)
        survey['sms_keyword'] = survey['id_string']
        if not project or not hasattr(self, 'project'):
            project = get_user_default_project(user)
        xform = DataDictionary(created_by=user, user=user,
                               xml=survey.to_xml(), json=survey.to_json(),
                               project=project)
        xform.save()

        return xform