def from_doc(self, definition):
    '\n        Create a Product from its definitions\n\n        :param dict definition: product definition document\n        :rtype: datacube.model.DatasetType\n        '
    DatasetType.validate(definition)
    metadata_type = definition['metadata_type']
    if isinstance(metadata_type, compat.string_types):
        metadata_type = self.metadata_type_resource.get_by_name(metadata_type)
    else:
        metadata_type = self.metadata_type_resource.add(metadata_type, allow_table_lock=False)
    if (not metadata_type):
        raise InvalidDocException(('Unknown metadata type: %r' % definition['metadata_type']))
    return DatasetType(metadata_type, definition)
Create a Product from its definitions

:param dict definition: product definition document
:rtype: datacube.model.DatasetType
def from_doc(self, definition):
    '\n        Create a Product from its definitions\n\n        :param dict definition: product definition document\n        :rtype: datacube.model.DatasetType\n        '
    DatasetType.validate(definition)
    metadata_type = definition['metadata_type']
    if isinstance(metadata_type, compat.string_types):
        metadata_type = self.metadata_type_resource.get_by_name(metadata_type)
    else:
        metadata_type = self.metadata_type_resource.add(metadata_type, allow_table_lock=False)
    if (not metadata_type):
        raise InvalidDocException(('Unknown metadata type: %r' % definition['metadata_type']))
    return DatasetType(metadata_type, definition)