Exemplo n.º 1
0
print "The list of variables includes:"
for x in allVars:
    print x.VariableCode + ": " + x.VariableNameCV

# Get all of the people from the database
allPeople = core_read.getPeople()
numPeople = len(allPeople)
print "\n------------ Simple People Query ------------------"
print "There are " + str(
    numPeople) + " People in the ODM2 database retrieved using getPeople()."
print "The list of People includes: "
for x in allPeople:
    print x.PersonFirstName + " " + x.PersonLastName

# Get all of the SamplingFeatures from the database that are Sites
siteFeatures = core_read.getSamplingFeaturesByType('Site')
numSites = len(siteFeatures)
print "\n--------------- Information about Site SamplingFeatures ------------"
print "There are " + str(
    numSites
) + " Site SamplingFeatures in the ODM2 database retrieved using getSamplingFeaturesByType()."
print "The list of Site SamplingFeatures includes: "
for x in siteFeatures:
    print x.SamplingFeatureCode + ": " + x.SamplingFeatureName

# Now get the SamplingFeature object for a SamplingFeature code
sf = core_read.getSamplingFeatureByCode('USU-LBR-Mendon')
print "\n-------- Information about an individual SamplingFeature ---------"
print(
    "The following are some of the attributes of a SamplingFeature retrieved using getSamplingFeatureByCode(): \n"
    + "SamplingFeatureCode: " + sf.SamplingFeatureCode + "\n" +
Exemplo n.º 2
0
for x in allVars:
    print x.VariableCode + ": " + x.VariableNameCV


# Get all of the people from the database
allPeople = core_read.getPeople()
numPeople = len(allPeople)
print "\n------------ Simple People Query ------------------"
print "There are " + str(numPeople) + " People in the ODM2 database retrieved using getPeople()."
print "The list of People includes: "
for x in allPeople:
    print x.PersonFirstName + " " + x.PersonLastName


# Get all of the SamplingFeatures from the database that are Sites
siteFeatures = core_read.getSamplingFeaturesByType('Site')
numSites = len(siteFeatures)
print "\n--------------- Information about Site SamplingFeatures ------------"
print "There are " + str(numSites) + " Site SamplingFeatures in the ODM2 database retrieved using getSamplingFeaturesByType()."
print "The list of Site SamplingFeatures includes: "
for x in siteFeatures:
    print x.SamplingFeatureCode + ": " + x.SamplingFeatureName


# Now get the SamplingFeature object for a SamplingFeature code
sf = core_read.getSamplingFeatureByCode('USU-LBR-Mendon')
print "\n-------- Information about an individual SamplingFeature ---------"
print ("The following are some of the attributes of a SamplingFeature retrieved using getSamplingFeatureByCode(): \n" +
       "SamplingFeatureCode: " + sf.SamplingFeatureCode + "\n" +
       "SamplingFeatureName: " + sf.SamplingFeatureName + "\n" +
       "SamplingFeatureDescription: " + sf.SamplingFeatureDescription + "\n" +