Add generic error log model.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
14
mayan/apps/common/managers.py
Normal file
14
mayan/apps/common/managers.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps import apps
|
||||
from django.contrib.contenttypes.fields import GenericRelation
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
|
||||
|
||||
class ErrorLogEntryManager(models.Manager):
|
||||
def register(self, model):
|
||||
ErrorLogEntry = apps.get_model(
|
||||
app_label='common', model_name='ErrorLogEntry'
|
||||
)
|
||||
model.add_to_class('error_logs', GenericRelation(ErrorLogEntry))
|
||||
Reference in New Issue
Block a user