From e6b3bd9666484b0c167b435c860a7072cca6ae59 Mon Sep 17 00:00:00 2001 From: John Bywater Date: Sat, 9 Nov 2019 19:17:04 +0000 Subject: [PATCH] Renamed class attribute '__subclassevents__' to respect the naming convention for model objects ("don't trample on user namespace"). --- eventsourcing/domain/model/entity.py | 6 +++--- eventsourcing/tests/core_tests/test_aggregate_root.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eventsourcing/domain/model/entity.py b/eventsourcing/domain/model/entity.py index c8c289b2b..a7e18e8a8 100644 --- a/eventsourcing/domain/model/entity.py +++ b/eventsourcing/domain/model/entity.py @@ -26,11 +26,11 @@ class DomainEntityMeta(type): - subclassevents = False + __subclassevents__ = False def __init__(cls, name, bases, attrs): super().__init__(name, bases, attrs) - if cls.subclassevents: + if cls.__subclassevents__: subclassevents(cls) @@ -38,7 +38,7 @@ class DomainEntity(metaclass=DomainEntityMeta): """ Supertype for domain model entity. """ - subclassevents = False + __subclassevents__ = False class Event(EventWithOriginatorID, DomainEvent): """ diff --git a/eventsourcing/tests/core_tests/test_aggregate_root.py b/eventsourcing/tests/core_tests/test_aggregate_root.py index 82ac81bd2..9d5bf326c 100644 --- a/eventsourcing/tests/core_tests/test_aggregate_root.py +++ b/eventsourcing/tests/core_tests/test_aggregate_root.py @@ -326,7 +326,7 @@ def count_examples(self): class Aggregate2(ExampleAggregateRoot): - subclassevents = True + __subclassevents__ = True def __init__(self, foo="", **kwargs): super(Aggregate2, self).__init__(**kwargs)