mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 17:26:10 -06:00
Move generic relation to JobsMixin
This commit is contained in:
parent
d1ec7ac19a
commit
4449003b59
@ -71,11 +71,6 @@ class DataSource(JobsMixin, PrimaryModel):
|
||||
null=True,
|
||||
editable=False
|
||||
)
|
||||
jobs = GenericRelation(
|
||||
to='core.Job',
|
||||
content_type_field='object_type',
|
||||
object_id_field='object_id'
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ('name',)
|
||||
|
@ -36,12 +36,6 @@ class ReportModule(PythonModuleMixin, JobsMixin, ManagedFile):
|
||||
"""
|
||||
Proxy model for report module files.
|
||||
"""
|
||||
jobs = GenericRelation(
|
||||
to='core.Job',
|
||||
content_type_field='object_type',
|
||||
object_id_field='object_id'
|
||||
)
|
||||
|
||||
objects = ReportModuleManager()
|
||||
|
||||
class Meta:
|
||||
|
@ -1,6 +1,7 @@
|
||||
import inspect
|
||||
from functools import cached_property
|
||||
|
||||
from django.contrib.contenttypes.fields import GenericRelation
|
||||
from django.db import models
|
||||
from django.urls import reverse
|
||||
|
||||
|
@ -299,6 +299,12 @@ class JobsMixin(models.Model):
|
||||
"""
|
||||
Enables support for job results.
|
||||
"""
|
||||
jobs = GenericRelation(
|
||||
to='core.Job',
|
||||
content_type_field='object_type',
|
||||
object_id_field='object_id'
|
||||
)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user