Set searches choices
@@ -8,12 +8,20 @@ from db.models.utils import DiffModel, NameableModel
class Search(DiffModel, NameableModel):
"""A saved search query."""
+ search_content_types = (
+ (content_types.PROJECT, content_types.PROJECT),
+ (content_types.EXPERIMENT_GROUP, content_types.EXPERIMENT_GROUP),
+ (content_types.EXPERIMENT, content_types.EXPERIMENT),
+ (content_types.JOB, content_types.JOB),
+ (content_types.BUILD_JOB, content_types.BUILD_JOB),
+ )
+
project = models.ForeignKey(
'db.Project',
on_delete=models.CASCADE,
related_name='searches')
content_type = models.CharField(
- choices=content_types.CHOICES,
+ choices=search_content_types,
max_length=24,
blank=True,
null=True)
