This commit is contained in:
2026-01-10 10:58:17 +01:00
parent 2e80c19e0e
commit 815b8696d2

View File

@@ -103,15 +103,26 @@ class Model(URLMixin, PoolBase, metaclass=ModelMeta):
@classmethod
def _get_name(cls):
'''
Returns the first non-empty line of the model docstring.
'''
assert cls.__doc__, '%s has no docstring' % cls
if cls.__doc__ is None:
print("\n💥 MODELE SANS DOCSTRING :", cls.__name__, " (module:", cls.__module__, ")")
raise Exception("MODELE SANS DOCSTRING")
lines = cls.__doc__.splitlines()
for line in lines:
line = line.strip()
if line:
return line
if lines:
return lines[0]
return cls.__name__
# @classmethod
# def _get_name(cls):
# '''
# Returns the first non-empty line of the model docstring.
# '''
# assert cls.__doc__, '%s has no docstring' % cls
# lines = cls.__doc__.splitlines()
# for line in lines:
# line = line.strip()
# if line:
# return line
@classmethod
def __register__(cls, module_name):