GeoEco.Metadata.CopyPropertyMetadata
- GeoEco.Metadata.CopyPropertyMetadata(fromProperty, toProperty, fromClass=None, fromModule=None, toClass=None, toModule=None)
Copies the
PropertyMetadatafor a specified property from one class’sClassMetadatato another’s.Use this function to duplicate a
PropertyMetadatawhen two classes have an identical or very similar property. If they are not exactly the same, you can modify the second property’sPropertyMetadataafter it has been copied.- Parameters:
fromProperty (
propertyorstr) – Thepropertyobject or name of the property to copyPropertyMetadatafrom. If the name is given, fromClass must also be given.toProperty (
propertyorstr) – Thepropertyobject or name of the property to copy thePropertyMetadatato. If the name is given, toClass must also be given.fromClass (
typeorstr, optional) – The class containing fromProperty, either as the class itself or the unqualified name of the class (without module or package names). Only needed if fromProperty is given as a name rather than apropertyobject.fromModule (
ModuleTypeorstr, optional) – The module that contains fromClass, either as the module object itself or the fully qualified name of the module (a.k.a. dotted module name). If not provided, the caller’s module is used.toClass (
typeorstr, optional) – The class containing toProperty, either as the class itself or the unqualified name of the class (without module or package names). Only needed if toProperty is given as a name rather than apropertyobject.toModule (
ModuleTypeorstr, optional) – The module that contains toClass, either as the module object itself or the fully qualified name of the module (a.k.a. dotted module name). If not provided, the caller’s module is used.
Note
Before calling this function, use
AddPropertyMetadata()to create aPropertyMetadataand add it to theClassMetadataof the class that contains fromProperty.