]>
git.datanom.net - pwp.git/blob - app/DB/baseorm.py
3 class OrmSubject(metaclass
=abc
.ABCMeta
):
5 def addObserver(self
, ormObserver
):
9 def removeObserver(self
, ormObserver
):
13 def notify(self
, subject
):
16 class Observer(metaclass
=abc
.ABCMeta
):
18 def update(self
, subject
):
21 class BaseOrm(OrmSubject
):
26 def addObserver(self
, ormObserver
):
27 print("Added: {0}".format(ormObserver
))
28 self
.__observers
.append(ormObserver
)
30 def removeObserver(self
, ormObserver
):
31 self
.__observers
.remove(ormObserver
)
33 def notify(self
, object):
34 for observer
in self
.__observers
:
35 observer
.update(object)
47 except AttributeError as e
:
This page took 0.075381 seconds and 6 git commands to generate.