Add event list API view
This commit is contained in:
@@ -35,11 +35,20 @@ class Event(object):
|
||||
self.event_type = None
|
||||
self.__class__._registry[name] = self
|
||||
|
||||
def commit(self, actor=None, action_object=None, target=None):
|
||||
model = apps.get_model('events', 'EventType')
|
||||
|
||||
def get_type(self):
|
||||
if not self.event_type:
|
||||
self.event_type, created = model.objects.get_or_create(
|
||||
EventType = apps.get_model('events', 'EventType')
|
||||
|
||||
self.event_type, created = EventType.objects.get_or_create(
|
||||
name=self.name
|
||||
)
|
||||
|
||||
return self.event_type
|
||||
|
||||
def commit(self, actor=None, action_object=None, target=None):
|
||||
if not self.event_type:
|
||||
EventType = apps.get_model('events', 'EventType')
|
||||
self.event_type, created = EventType.objects.get_or_create(
|
||||
name=self.name
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user