winipedia-utils 0.1.13__py3-none-any.whl → 0.1.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- winipedia_utils/django/database.py +0 -15
- winipedia_utils/oop/mixins/meta.py +9 -7
- {winipedia_utils-0.1.13.dist-info → winipedia_utils-0.1.15.dist-info}/METADATA +1 -1
- {winipedia_utils-0.1.13.dist-info → winipedia_utils-0.1.15.dist-info}/RECORD +6 -6
- {winipedia_utils-0.1.13.dist-info → winipedia_utils-0.1.15.dist-info}/LICENSE +0 -0
- {winipedia_utils-0.1.13.dist-info → winipedia_utils-0.1.15.dist-info}/WHEEL +0 -0
@@ -16,7 +16,6 @@ from django.db.models.fields.related import ForeignKey, ForeignObjectRel
|
|
16
16
|
from django.forms.models import model_to_dict
|
17
17
|
|
18
18
|
from winipedia_utils.logging.logger import get_logger
|
19
|
-
from winipedia_utils.text.string import split_on_uppercase
|
20
19
|
|
21
20
|
if TYPE_CHECKING:
|
22
21
|
from django.db.models.options import Options
|
@@ -267,9 +266,6 @@ class BaseModel(Model):
|
|
267
266
|
|
268
267
|
# abstract does not inherit in children
|
269
268
|
abstract = True
|
270
|
-
# the rest does inherit
|
271
|
-
verbose_name = "Base Model"
|
272
|
-
verbose_name_plural = "Base Models"
|
273
269
|
|
274
270
|
def __str__(self) -> str:
|
275
271
|
"""Base string representation of a model.
|
@@ -291,14 +287,3 @@ class BaseModel(Model):
|
|
291
287
|
def meta(self) -> "Options[Self]":
|
292
288
|
"""Get the meta options for the model."""
|
293
289
|
return self._meta
|
294
|
-
|
295
|
-
@classmethod
|
296
|
-
def make_verbose_name(cls) -> str:
|
297
|
-
"""Make a verbose name for the model."""
|
298
|
-
# split by upper case letters
|
299
|
-
return " ".join(split_on_uppercase(cls.__name__)).title()
|
300
|
-
|
301
|
-
@classmethod
|
302
|
-
def make_verbose_name_plural(cls) -> str:
|
303
|
-
"""Make a verbose name plural for the model."""
|
304
|
-
return cls.make_verbose_name() + "s"
|
@@ -21,7 +21,7 @@ from winipedia_utils.text.string import value_to_truncated_string
|
|
21
21
|
logger = get_logger(__name__)
|
22
22
|
|
23
23
|
|
24
|
-
class LoggingMeta(
|
24
|
+
class LoggingMeta(ABCMeta):
|
25
25
|
"""Metaclass that automatically adds logging to class methods.
|
26
26
|
|
27
27
|
Wraps non-magic methods with a logging decorator that tracks method calls,
|
@@ -169,7 +169,7 @@ class LoggingMeta(type):
|
|
169
169
|
return wrapper
|
170
170
|
|
171
171
|
|
172
|
-
class ImplementationMeta(
|
172
|
+
class ImplementationMeta(ABCMeta):
|
173
173
|
"""Metaclass that enforces implementation.
|
174
174
|
|
175
175
|
Ensures that concrete subclasses properly implement all required attributes
|
@@ -182,7 +182,9 @@ class ImplementationMeta(type):
|
|
182
182
|
cls: "ImplementationMeta",
|
183
183
|
name: str,
|
184
184
|
bases: tuple[type, ...],
|
185
|
-
|
185
|
+
namespace: dict[str, Any],
|
186
|
+
/,
|
187
|
+
**_kwargs: Any,
|
186
188
|
) -> None:
|
187
189
|
"""Initialize a class with implementation checking.
|
188
190
|
|
@@ -194,7 +196,7 @@ class ImplementationMeta(type):
|
|
194
196
|
cls: The class being initialized
|
195
197
|
name: The name of the class
|
196
198
|
bases: The base classes
|
197
|
-
|
199
|
+
namespace: The attribute dictionary
|
198
200
|
|
199
201
|
Raises:
|
200
202
|
NotImplementedError: If the class doesn't define __abstract__
|
@@ -203,7 +205,7 @@ class ImplementationMeta(type):
|
|
203
205
|
TypeError: If a method is neither final nor abstract
|
204
206
|
|
205
207
|
"""
|
206
|
-
super().__init__(name, bases,
|
208
|
+
super().__init__(name, bases, namespace)
|
207
209
|
|
208
210
|
# Check method decorators regardless of abstract status
|
209
211
|
|
@@ -223,7 +225,7 @@ class ImplementationMeta(type):
|
|
223
225
|
True if the class is abstract, False otherwise
|
224
226
|
|
225
227
|
"""
|
226
|
-
return any(cls.
|
228
|
+
return any(cls.__abstractmethods__)
|
227
229
|
|
228
230
|
def check_method_decorators(cls) -> None:
|
229
231
|
"""Check that all methods are properly decorated with @final or @abstractmethod.
|
@@ -317,7 +319,7 @@ class ImplementationMeta(type):
|
|
317
319
|
return list(attrs)
|
318
320
|
|
319
321
|
|
320
|
-
class ABCImplementationLoggingMeta(ImplementationMeta, LoggingMeta
|
322
|
+
class ABCImplementationLoggingMeta(ImplementationMeta, LoggingMeta):
|
321
323
|
"""Combined metaclass that merges implementation, logging, and ABC functionality.
|
322
324
|
|
323
325
|
This metaclass combines the features of:
|
@@ -9,7 +9,7 @@ winipedia_utils/data/dataframe.py,sha256=7rRy4LDv-4bJeISUPsxrQqTiFI7ENSzk4gKaVgT
|
|
9
9
|
winipedia_utils/django/__init__.py,sha256=ZnI3rINKvT4m9K3eeGg9RVBjBPH73zaBhb0Qy4hLt5g,683
|
10
10
|
winipedia_utils/django/bulk.py,sha256=7MLfq83xanxbVFo4ANdtcYv5S-oQwdrNkH5ljPzjKLM,20375
|
11
11
|
winipedia_utils/django/command.py,sha256=ENEg_crSbnm3nQIks-j2DjjAfeZ7ppJkZOyw__IpSYw,13824
|
12
|
-
winipedia_utils/django/database.py,sha256=
|
12
|
+
winipedia_utils/django/database.py,sha256=_tUahz0RMub-Zcl4dpWFrrfwTemMgVs_3c58mP8x5YM,10926
|
13
13
|
winipedia_utils/git/__init__.py,sha256=pPo5DDqaQkFim8L6x22DXjqthLnKAxLyXlXl7JXGUdw,48
|
14
14
|
winipedia_utils/git/gitignore/__init__.py,sha256=t65uvpOaNvh7ICgwuJFRr7vS2nWfxzWUGIpnJs0_jzE,58
|
15
15
|
winipedia_utils/git/gitignore/gitignore.py,sha256=wCU2lRztTFKQ7JrKnCqPLCsuVRjfx8wGfTy42BLgFJI,4512
|
@@ -30,7 +30,7 @@ winipedia_utils/modules/module.py,sha256=mxaAsRl02CAq_bTW2HsmzRWoyC9jKNM8Q4xdgdQ
|
|
30
30
|
winipedia_utils/modules/package.py,sha256=kCm4pXQdllafo-2dmWZTvaAqRruzh3iF4hseHlCmTlU,12605
|
31
31
|
winipedia_utils/oop/__init__.py,sha256=wGjsVwLbTVEQWOfDJvN9nlvC-3NmAi8Doc2xIrm6e78,47
|
32
32
|
winipedia_utils/oop/mixins/__init__.py,sha256=PDK-cJcdRUfDUCz36qQ5pmMW07G133WtN49OpmILGNI,54
|
33
|
-
winipedia_utils/oop/mixins/meta.py,sha256=
|
33
|
+
winipedia_utils/oop/mixins/meta.py,sha256=gV2YKo_rbJHY9xNCPHhjMmFWuTtiw3C-IGZlh52IZq8,11320
|
34
34
|
winipedia_utils/oop/mixins/mixin.py,sha256=GuYdeueiOIHoRi9ds2ztxUcLnrcsBhHAsbrO43N9AGg,1170
|
35
35
|
winipedia_utils/os/__init__.py,sha256=WSLt7tb6HqWRlCGGIEwRfVksF0sLJNeEW3iZeJhGWk0,47
|
36
36
|
winipedia_utils/os/os.py,sha256=ITuiLLfjGBV2jH8tHQfwVzsICT-jY1zUxtwu3ASJBG4,1690
|
@@ -61,7 +61,7 @@ winipedia_utils/testing/tests/base/utils/utils.py,sha256=dUPDrgAxlfREQb33zz23Mfz
|
|
61
61
|
winipedia_utils/testing/tests/conftest.py,sha256=8RounBlI8Jq1aLaLNpv84MW4ne8Qq0aavQextDOp5ng,920
|
62
62
|
winipedia_utils/text/__init__.py,sha256=j2bwtK6kyeHI6SnoBjpRju0C1W2n2paXBDlNjNtaUxA,48
|
63
63
|
winipedia_utils/text/string.py,sha256=1jbBftlgxffGgSlPnQh3aRPIr8XekEwpSenjFCW6JyM,3478
|
64
|
-
winipedia_utils-0.1.
|
65
|
-
winipedia_utils-0.1.
|
66
|
-
winipedia_utils-0.1.
|
67
|
-
winipedia_utils-0.1.
|
64
|
+
winipedia_utils-0.1.15.dist-info/LICENSE,sha256=3PrKJ2CWNrnyyHaC_r0wPDSukVWgmjOxHr__eQVH7cw,1087
|
65
|
+
winipedia_utils-0.1.15.dist-info/METADATA,sha256=OSGHZLiFPSAkWD_CB2aCtt5usZcnYM1m9SYXbfkcvqU,12385
|
66
|
+
winipedia_utils-0.1.15.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
67
|
+
winipedia_utils-0.1.15.dist-info/RECORD,,
|
File without changes
|
File without changes
|