GeoEco.Metadata.CopyPropertyMetadata

GeoEco.Metadata.CopyPropertyMetadata(fromProperty, toProperty, fromClass=None, fromModule=None, toClass=None, toModule=None)

Copies the PropertyMetadata for a specified property from one class’s ClassMetadata to another’s.

Use this function to duplicate a PropertyMetadata when two classes have an identical or very similar property. If they are not exactly the same, you can modify the second property’s PropertyMetadata after it has been copied.

Parameters:
  • fromProperty (property or str) – The property object or name of the property to copy PropertyMetadata from. If the name is given, fromClass must also be given.

  • toProperty (property or str) – The property object or name of the property to copy the PropertyMetadata to. If the name is given, toClass must also be given.

  • fromClass (type or str, 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 a property object.

  • fromModule (ModuleType or str, 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 (type or str, 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 a property object.

  • toModule (ModuleType or str, 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 a PropertyMetadata and add it to the ClassMetadata of the class that contains fromProperty.