def resolve_namespace(cls, default_ns): if getattr(cls, '__extends__', None) != None: cls.__extends__.resolve_namespace(cls.__extends__, default_ns) ModelBase.resolve_namespace(cls, default_ns) for k, v in cls._type_info.items(): if v.__type_name__ is ModelBase.Empty: v.__namespace__ = cls.get_namespace() v.__type_name__ = "%s_%sType" % (cls.get_type_name(), k) if v != cls: v.resolve_namespace(v, default_ns)
def resolve_namespace(cls, default_ns): if getattr(cls, '__extends__', None) != None: cls.__extends__.resolve_namespace(cls.__extends__, default_ns) ModelBase.resolve_namespace(cls, default_ns) for k, v in cls._type_info.items(): if v.__type_name__ is ModelBase.Empty: v.__namespace__ = cls.get_namespace() v.__type_name__ = "%s_%s%s" % (cls.get_type_name(), k, TYPE_SUFFIX) if v != cls: v.resolve_namespace(v, default_ns) if cls._force_own_namespace is not None: for c in cls._force_own_namespace: c.__namespace__ = cls.get_namespace() ComplexModel.resolve_namespace(c, cls.get_namespace())