mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Closes #8274: Enable associating a custom link with multiple object types
This commit is contained in:
@@ -197,10 +197,10 @@ class CustomLink(CloningMixin, ExportTemplatesMixin, WebhooksMixin, ChangeLogged
|
||||
A custom link to an external representation of a NetBox object. The link text and URL fields accept Jinja2 template
|
||||
code to be rendered with an object as context.
|
||||
"""
|
||||
content_type = models.ForeignKey(
|
||||
content_types = models.ManyToManyField(
|
||||
to=ContentType,
|
||||
on_delete=models.CASCADE,
|
||||
limit_choices_to=FeatureQuery('custom_links')
|
||||
related_name='custom_links',
|
||||
help_text='The object type(s) to which this link applies.'
|
||||
)
|
||||
name = models.CharField(
|
||||
max_length=100,
|
||||
@@ -236,7 +236,7 @@ class CustomLink(CloningMixin, ExportTemplatesMixin, WebhooksMixin, ChangeLogged
|
||||
)
|
||||
|
||||
clone_fields = (
|
||||
'content_type', 'enabled', 'weight', 'group_name', 'button_class', 'new_window',
|
||||
'enabled', 'weight', 'group_name', 'button_class', 'new_window',
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user