Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit29d3593

Browse files
committed
Refactor base use case class to really become an abstract base class
1 parentea483a4 commit29d3593

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

‎sponsors/use_cases.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1+
fromabcimportABC,abstractmethod
2+
13
fromsponsorsimportnotifications
24
fromsponsors.modelsimportSponsorship,Contract,SponsorContact,SponsorEmailNotificationTemplate
35
fromsponsors.pdfimportrender_contract_to_pdf_file,render_contract_to_docx_file
46

57

6-
classBaseUseCaseWithNotifications:
8+
classBaseUseCaseWithNotifications(ABC):
79
notifications= []
810

11+
@classmethod
12+
defbuild(cls):
13+
returncls(cls.notifications)
14+
15+
@abstractmethod
16+
defexecute(self,*args,**kwargs):
17+
pass
18+
919
def__init__(self,notifications):
1020
self.notifications=notifications
1121

1222
defnotify(self,**kwargs):
1323
fornotificationinself.notifications:
1424
notification.notify(**kwargs)
1525

16-
@classmethod
17-
defbuild(cls):
18-
returncls(cls.notifications)
19-
2026

2127
classCreateSponsorshipApplicationUseCase(BaseUseCaseWithNotifications):
2228
notifications= [

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp