main #4

Merged
admin merged 7 commits from main into dev 2026-01-16 08:15:32 +00:00
Showing only changes of commit 815b8696d2 - Show all commits

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):