1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #5608: Add REST API endpoint for custom links

This commit is contained in:
Jeremy Stretch
2021-03-08 20:57:44 -05:00
parent 14bc3a3cf8
commit 38ded66c4e
13 changed files with 218 additions and 20 deletions

View File

@@ -172,13 +172,13 @@ class CustomLink(BigIDModel):
max_length=100,
unique=True
)
text = models.CharField(
link_text = models.CharField(
max_length=500,
help_text="Jinja2 template code for link text"
)
url = models.CharField(
link_url = models.CharField(
max_length=500,
verbose_name='URL',
verbose_name='Link URL',
help_text="Jinja2 template code for link URL"
)
weight = models.PositiveSmallIntegerField(
@@ -196,9 +196,12 @@ class CustomLink(BigIDModel):
help_text="The class of the first link in a group will be used for the dropdown button"
)
new_window = models.BooleanField(
default=False,
help_text="Force link to open in a new window"
)
objects = RestrictedQuerySet.as_manager()
class Meta:
ordering = ['group_name', 'weight', 'name']