@@ -78,6 +78,7 @@ class CVElevationDatum(Base, CV):
7878class CVEquipmentType (Base , CV ):
7979 __tablename__ = 'cv_equipmenttype'
8080
81+
8182class CVMediumType (Base , CV ):
8283 __tablename__ = 'cv_medium'
8384
@@ -97,6 +98,7 @@ class CVPropertyDataType(Base, CV):
9798class CVQualityCode (Base , CV ):
9899 __tablename__ = 'cv_qualitycode'
99100
101+
100102class CVResultType (Base , CV ):
101103 __tablename__ = 'cv_resulttype'
102104
@@ -116,6 +118,7 @@ class CVSamplingFeatureType(Base, CV):
116118class CVSpatialOffsetType (Base , CV ):
117119 __tablename__ = 'cv_spatialoffsettype'
118120
121+
119122class CVSpeciation (Base , CV ):
120123 __tablename__ = 'cv_speciation'
121124
@@ -157,7 +160,6 @@ class CVReferenceMaterialMedium(Base, CV):
157160# ################################################################################
158161class People (Base ):
159162
160-
161163 PersonID = Column ('personid' , Integer , primary_key = True , nullable = False )
162164 PersonFirstName = Column ('personfirstname' , String (255 ), nullable = False )
163165 PersonMiddleName = Column ('personmiddlename' , String (255 ))
@@ -170,7 +172,6 @@ def __repr__(self):
170172
171173class Organizations (Base ):
172174
173-
174175 OrganizationID = Column ('organizationid' , Integer , primary_key = True , nullable = False )
175176 OrganizationTypeCV = Column ('organizationtypecv' , ForeignKey (CVOrganizationType .Name ), nullable = False ,
176177 index = True )
@@ -191,7 +192,6 @@ def __repr__(self):
191192
192193class Affiliations (Base ):
193194
194-
195195 AffiliationID = Column ('affiliationid' , Integer , primary_key = True , nullable = False )
196196 PersonID = Column ('personid' , ForeignKey (People .PersonID ), nullable = False )
197197 OrganizationID = Column ('organizationid' , ForeignKey (Organizations .OrganizationID ))
@@ -209,7 +209,6 @@ class Affiliations(Base):
209209
210210class Methods (Base ):
211211
212-
213212 MethodID = Column ('methodid' , Integer , primary_key = True , nullable = False )
214213 MethodTypeCV = Column ('methodtypecv' , ForeignKey (CVMethodType .Name ), nullable = False , index = True )
215214 MethodCode = Column ('methodcode' , String (50 ), nullable = False )
@@ -247,7 +246,6 @@ def __repr__(self):
247246
248247class ActionBy (Base ):
249248
250-
251249 BridgeID = Column ('bridgeid' , Integer , primary_key = True , nullable = False )
252250 ActionID = Column ('actionid' , Integer , ForeignKey (Actions .ActionID ), nullable = False )
253251 AffiliationID = Column ('affiliationid' , ForeignKey (Affiliations .AffiliationID ), nullable = False )
@@ -260,7 +258,6 @@ class ActionBy(Base):
260258
261259class SamplingFeatures (Base ):
262260
263-
264261 SamplingFeatureID = Column ('samplingfeatureid' , Integer , primary_key = True , nullable = False )
265262 SamplingFeatureUUID = Column ('samplingfeatureuuid' , String (36 ), nullable = False )
266263 SamplingFeatureTypeCV = Column ('samplingfeaturetypecv' , ForeignKey (CVSamplingFeatureType .Name ),
@@ -284,16 +281,13 @@ class SamplingFeatures(Base):
284281
285282 }
286283
287-
288284 def __repr__ (self ):
289-
290285 return "<SamplingFeatures('%s', '%s', '%s', '%s', '%s')>" % (
291286 self .SamplingFeatureCode , self .SamplingFeatureName , self .SamplingFeatureDescription ,
292287 # self.Elevation_m, geomkt)
293288 self .Elevation_m , self .FeatureGeometryWKT )
294289
295290
296-
297291class FeatureActions (Base ):
298292 __tablename__ = u'featureactions'
299293 __table_args__ = {u'schema' : 'odm2' }
@@ -509,7 +503,6 @@ class EquipmentModels(Base):
509503 OrganizationObj = relationship (Organizations )
510504
511505
512-
513506class InstrumentOutputVariables (Base ):
514507 __tablename__ = u'instrumentoutputvariables'
515508 __table_args__ = {u'schema' : 'odm2' }
@@ -529,7 +522,6 @@ class InstrumentOutputVariables(Base):
529522 VariableObj = relationship (Variables )
530523
531524
532-
533525class DataLoggerFileColumns (Base ):
534526 __tablename__ = u'dataloggerfilecolumns'
535527 __table_args__ = {u'schema' : 'odm2' }
@@ -557,6 +549,7 @@ class DataLoggerFileColumns(Base):
557549 ScanIntervalUnitsObj = relationship (Units , primaryjoin = 'DataLoggerFileColumns.ScanIntervalUnitsID == Units.UnitsID' )
558550 RecordingIntervalUnitsObj = relationship (Units , primaryjoin = 'DataLoggerFileColumns.RecordingIntervalUnitsID == Units.UnitsID' )
559551
552+
560553class Equipment (Base ):
561554 __tablename__ = u'equipment'
562555 __table_args__ = {u'schema' : 'odm2' }
@@ -581,6 +574,7 @@ class Equipment(Base):
581574
582575 # parent = relationship(u'Equipment', remote_side=[EquipmentID])
583576
577+
584578class CalibrationReferenceEquipment (Base ):
585579 __tablename__ = u'calibrationreferenceequipment'
586580 __table_args__ = {u'schema' : 'odm2' }
@@ -592,6 +586,7 @@ class CalibrationReferenceEquipment(Base):
592586 ActionObj = relationship (Actions )
593587 EquipmentObj = relationship (Equipment )
594588
589+
595590class EquipmentActions (Base ):
596591 __tablename__ = u'equipmentactions'
597592 __table_args__ = {u'schema' : 'odm2' }
@@ -659,6 +654,8 @@ class CalibrationActions(Base):
659654# ################################################################################
660655# Lab Analyses
661656# ################################################################################
657+
658+
662659class Directives (Base ):
663660 __tablename__ = u'directives'
664661 __table_args__ = {u'schema' : 'odm2' }
@@ -679,6 +676,7 @@ class ActionDirectives(Base):
679676 ActionObj = relationship (Actions )
680677 DirectiveObj = relationship (Directives )
681678
679+
682680class SpecimenBatchPositions (Base ):
683681 #todo fix misspelling
684682 __tablename__ = u'specimenbatchpostions'
@@ -723,10 +721,12 @@ class Specimens(SamplingFeatures):
723721 __mapper_args__ = {
724722 'polymorphic_identity' :'Specimen' ,
725723 }
724+
726725 def __repr__ (self ):
727726 return "<Specimens('%s', '%s', '%s', '%s',)>" \
728727 % (self .SamplingFeatureID , self .SamplingFeatureCode , self .SpecimenTypeCV ,self .SamplingFeatureCode )
729728
729+
730730class SpatialOffsets (Base ):
731731 __tablename__ = u'spatialoffsets'
732732 __table_args__ = {u'schema' : 'odm2' }
@@ -958,8 +958,6 @@ class SamplingFeatureAnnotations(Base):
958958 SamplingFeatureObj = relationship (SamplingFeatures )
959959
960960
961-
962-
963961# ################################################################################
964962# Data Quality
965963# ################################################################################
@@ -1010,6 +1008,7 @@ class ReferenceMaterials(Base):
10101008 OrganizationObj = relationship (Organizations )
10111009 SamplingFeatureObj = relationship (SamplingFeatures )
10121010
1011+
10131012class CalibrationStandards (Base ):
10141013 __tablename__ = u'calibrationstandards'
10151014 __table_args__ = {u'schema' : 'odm2' }
@@ -1403,7 +1402,7 @@ class MethodCitations(Base):
14031402 MethodObj = relationship (Methods )
14041403
14051404
1406- # from odm2.Annotations.model import Annotation
1405+ # from odm2.Annotations.converter import Annotation
14071406class RelatedAnnotations (Base ):
14081407 __tablename__ = u'relatedannotations'
14091408 __table_args__ = {u'schema' : 'odm2' }
@@ -1468,8 +1467,6 @@ class RelatedResults(Base):
14681467# ################################################################################
14691468# Results
14701469# ################################################################################
1471-
1472-
14731470class PointCoverageResults (Results ):
14741471 __tablename__ = u'pointcoverageresults'
14751472 __table_args__ = {u'schema' : 'odm2' }
@@ -1495,7 +1492,6 @@ class PointCoverageResults(Results):
14951492 __mapper_args__ = {'polymorphic_identity' :'Point coverage' }
14961493
14971494
1498-
14991495class ProfileResults (Results ):
15001496 __tablename__ = u'profileresults'
15011497 __table_args__ = {u'schema' : 'odm2' }
@@ -2037,6 +2033,7 @@ class TransectResultValueAnnotations(Base):
20372033 AnnotationObj = relationship (Annotations )
20382034 ValueObj = relationship (TransectResultValues )
20392035
2036+
20402037def _changeSchema (schema ):
20412038 import inspect
20422039 import sys
@@ -2065,13 +2062,12 @@ def _getSchema(engine):
20652062
20662063 return insp .default_schema_name
20672064
2065+
20682066def setSchema (engine ):
2069- # import datetime
2070- # start = datetime.datetime.now()
2067+
20712068 s = _getSchema (engine )
2072- if s is None :
2073- s = ''
2069+ # if s is None:
2070+ # s = ''
20742071 _changeSchema (s )
2075- # end = datetime.datetime.now()
2076- # print end-start, ": elapsed time to change schema"
2072+
20772073
0 commit comments