mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-27 01:36:11 -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,
|
null=True,
|
||||||
editable=False
|
editable=False
|
||||||
)
|
)
|
||||||
jobs = GenericRelation(
|
|
||||||
to='core.Job',
|
|
||||||
content_type_field='object_type',
|
|
||||||
object_id_field='object_id'
|
|
||||||
)
|
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ('name',)
|
ordering = ('name',)
|
||||||
|
@ -36,12 +36,6 @@ class ReportModule(PythonModuleMixin, JobsMixin, ManagedFile):
|
|||||||
"""
|
"""
|
||||||
Proxy model for report module files.
|
Proxy model for report module files.
|
||||||
"""
|
"""
|
||||||
jobs = GenericRelation(
|
|
||||||
to='core.Job',
|
|
||||||
content_type_field='object_type',
|
|
||||||
object_id_field='object_id'
|
|
||||||
)
|
|
||||||
|
|
||||||
objects = ReportModuleManager()
|
objects = ReportModuleManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import inspect
|
import inspect
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
|
|
||||||
|
from django.contrib.contenttypes.fields import GenericRelation
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
|
@ -299,6 +299,12 @@ class JobsMixin(models.Model):
|
|||||||
"""
|
"""
|
||||||
Enables support for job results.
|
Enables support for job results.
|
||||||
"""
|
"""
|
||||||
|
jobs = GenericRelation(
|
||||||
|
to='core.Job',
|
||||||
|
content_type_field='object_type',
|
||||||
|
object_id_field='object_id'
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user