def get_or_create_iobject(identifier_uid,<EOL>identifier_namespace_uri,<EOL>iobject_type_name,<EOL>iobject_type_namespace_uri,<EOL>iobject_type_revision_name,<EOL>iobject_family_name,<EOL>iobject_family_revision_name="<STR_LIT>",<EOL>identifier_namespace_name="<STR_LIT>",<EOL>timestamp=None,<EOL>create_timestamp=None,<EOL>overwrite=False,<EOL>dingos_class_map=dingos_class_map):
<EOL>if not timestamp:<EOL><INDENT>raise StandardError("<STR_LIT>")<EOL><DEDENT>id_namespace, created = dingos_class_map['<STR_LIT>'].objects.get_or_create(uri=identifier_namespace_uri)<EOL>if created and identifier_namespace_name:<EOL><INDENT>id_namespace.name = identifier_namespace_name<EOL>id_namespace.save()<EOL><DEDENT>identifier, created = dingos_class_map['<STR_LIT>'].objects.get_or_create(uid=identifier_uid,<EOL>namespace=id_namespace,<EOL>defaults={'<STR_LIT>': None})<EOL>iobject_type_namespace, created = dingos_class_map['<STR_LIT>'].objects.get_or_create(uri=iobject_type_namespace_uri)<EOL>iobject_family, created = dingos_class_map['<STR_LIT>'].objects.get_or_create(name=iobject_family_name)<EOL>iobject_family_revision, created = dingos_class_map['<STR_LIT>'].objects.get_or_create(<EOL>name=iobject_family_revision_name)<EOL>iobject_type, created = dingos_class_map['<STR_LIT>'].objects.get_or_create(name=iobject_type_name,<EOL>iobject_family=iobject_family,<EOL>namespace=iobject_type_namespace)<EOL>iobject_type_revision, created = dingos_class_map['<STR_LIT>'].objects.get_or_create(name=iobject_type_revision_name)<EOL>if not create_timestamp:<EOL><INDENT>create_timestamp = timezone.now()<EOL><DEDENT>iobject, created = dingos_class_map["<STR_LIT>"].objects.get_or_create(identifier=identifier,<EOL>timestamp=timestamp,<EOL>defaults={'<STR_LIT>': iobject_family,<EOL>'<STR_LIT>': iobject_family_revision,<EOL>'<STR_LIT>': iobject_type,<EOL>'<STR_LIT>': iobject_type_revision,<EOL>'<STR_LIT>': create_timestamp})<EOL>if created:<EOL><INDENT>iobject.set_name()<EOL>iobject.save()<EOL>identifier.latest = iobject<EOL>identifier.save()<EOL><DEDENT>elif overwrite:<EOL><INDENT>iobject.timestamp = timestamp<EOL>iobject.create_timestamp = create_timestamp<EOL>iobject.iobject_family = iobject_family<EOL>iobject.iobject_family_revision = iobject_family_revision<EOL>iobject.iobject_type = iobject_type<EOL>iobject.iobject_type_revision = iobject_type_revision<EOL>iobject.set_name()<EOL>iobject.save()<EOL><DEDENT>logger.debug(<EOL>"<STR_LIT>" % (iobject.identifier, timestamp, created, overwrite))<EOL>return iobject, created<EOL>
Get or create an information object.