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

#3892: Convert CUSTOMLINK_MODELS to a Q object

This commit is contained in:
Jeremy Stretch
2020-01-15 16:04:41 -05:00
parent 9c4ab79bea
commit 09bee75cb3
5 changed files with 43 additions and 29 deletions

View File

@ -367,10 +367,6 @@ class CustomFieldChoice(models.Model):
# Custom links
#
def get_custom_link_models():
return model_names_to_filter_dict(CUSTOMLINK_MODELS)
class CustomLink(models.Model):
"""
A custom link to an external representation of a NetBox object. The link text and URL fields accept Jinja2 template
@ -379,7 +375,7 @@ class CustomLink(models.Model):
content_type = models.ForeignKey(
to=ContentType,
on_delete=models.CASCADE,
limit_choices_to=get_custom_link_models
limit_choices_to=CUSTOMLINK_MODELS
)
name = models.CharField(
max_length=100,