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

#3892: Convert EXPORTTEMPLATE_MODELS to a Q object

This commit is contained in:
Jeremy Stretch
2020-01-15 16:11:44 -05:00
parent f81e7d30e2
commit d9437a08f0
5 changed files with 50 additions and 37 deletions

View File

@@ -482,15 +482,11 @@ class Graph(models.Model):
# Export templates
#
def get_export_template_models():
return model_names_to_filter_dict(EXPORTTEMPLATE_MODELS)
class ExportTemplate(models.Model):
content_type = models.ForeignKey(
to=ContentType,
on_delete=models.CASCADE,
limit_choices_to=get_export_template_models
limit_choices_to=EXPORTTEMPLATE_MODELS
)
name = models.CharField(
max_length=100