コード例 #1
0
def create_mock_db_input(value='', placeholder='', title=''):
    input_element = SchemaElement()
    input_element.tag = "input"

    input_element.value = value
    input_element.options = {'title': title, 'placeholder': placeholder}

    input_element.pk = 'mock'

    return input_element
コード例 #2
0
def create_mock_db_input(value='', placeholder='', title=''):
    input_element = SchemaElement()
    input_element.tag = "input"

    input_element.value = value
    input_element.options = {
        'title': title,
        'placeholder': placeholder
    }

    input_element.pk = 'mock'

    return input_element
コード例 #3
0
projectIDs = set(["blank"])
DB_NAME = "mgi"
client = MongoClient(MONGODB_URI)
db = client[DB_NAME]
xmldata = db['xmldata']

for cursor in xmldata.find({
        "content.amProjectDB.@xmlns:xsi":
        "http://www.w3.org/2001/XMLSchema-instance"
}):
    projectIDs.add(cursor["content"]["amProjectDB"]["amProject"]["projectID"])

product_element = SchemaElement()
product_element.tag = u'restriction'
product_element.value = u"blank"
product_element.options = {u'base': u'xs:string'}
product_element.children = []
product_element.save()

for ProjectID in projectIDs:
    xsd_element = SchemaElement()
    xsd_element.tag = u'enumeration'
    xsd_element.value = str(ProjectID).decode('UTF-8')
    xsd_element.options = {}
    xsd_element.children = []
    xsd_element.save()
    product_element.children.append(xsd_element)
    product_element.save()
a = product_element
product_element = SchemaElement()
product_element.tag = u'simple_type'