Lines Matching refs:models
45 from django.db.models import Count
57 from autotest_lib.frontend.afe import models
59 from autotest_lib.frontend.tko import models as tko_models
104 label_model = models.Label.smart_get(id)
124 label_model = models.Label.smart_get(id)
135 hosts.append(models.Host.smart_get(h.id))
159 label = models.Label.add_object(name=name, **kwargs)
181 label = models.Label.smart_get(id)
183 label = models.StaticLabel.smart_get(label.name)
185 host_objs = models.Host.smart_get_bulk(hosts)
187 models.Host.check_no_platform(host_objs)
190 models.Host.check_board_labels_allowed(host_objs, [label.name])
211 label = models.Label.smart_get(id)
212 except models.Label.DoesNotExist:
217 label = models.Label.smart_get(add_label(id))
234 host_objs = models.Host.smart_get_bulk(hosts)
262 host_objs = models.Host.smart_get_bulk(hosts)
272 host_objs = models.Host.smart_get_bulk(hosts)
273 label = models.Label.smart_get(id)
292 host_objs = models.Host.smart_get_bulk(hosts)
304 labels = models.Label.query_objects(filter_data)
311 static_labels = models.StaticLabel.query_objects(filter_data)
319 replaced = models.ReplacedLabel.objects.filter(label__id__in=label_ids)
342 return models.Host.add_object(hostname=hostname, status=status,
362 host = models.Host.smart_get(id)
397 models.Host.smart_get(id).update_object(kwargs)
426 hosts = models.Host.query_objects(host_filter_data)
466 for host in models.Host.query_objects(host_filter_data):
476 label_objs = models.Label.smart_get_bulk(labels)
478 models.Host.smart_get(id).labels.add(*label_objs)
480 static_labels, non_static_labels = models.Host.classify_label_objects(
482 host = models.Host.smart_get(id)
500 label_objs = models.Label.smart_get_bulk(labels)
508 host_obj = models.Host.smart_get(id)
510 models.Host.check_no_platform([host_obj])
512 models.Host.check_board_labels_allowed([host_obj], labels)
525 label_objs = models.Label.smart_get_bulk(labels)
527 models.Host.smart_get(id).labels.remove(*label_objs)
529 static_labels, non_static_labels = models.Host.classify_label_objects(
531 host = models.Host.smart_get(id)
549 host_obj = models.Host.smart_get(id)
562 models.Host.objects.populate_relationships(hosts, models.HostAttribute,
574 static_attrs = models.StaticHostAttribute.query_objects(
610 hosts = models.Host.query_objects(host_filter_data)
611 models.AclGroup.check_for_acl_violation_hosts(hosts)
623 models.Host.smart_get(id).delete()
643 models.Host.objects.populate_relationships(hosts, models.Label,
645 models.Host.objects.populate_relationships(hosts, models.AclGroup,
647 models.Host.objects.populate_relationships(hosts, models.HostAttribute,
649 models.Host.objects.populate_relationships(hosts,
650 models.StaticHostAttribute,
664 static_label = models.StaticLabel.smart_get(label.name)
686 entries = models.HostQueueEntry.objects.filter(
691 tasks = models.SpecialTask.objects.filter(
722 models.Test.list_objects(filter_data))
736 job_ids = list(models.Job.objects.filter(
761 return models.Profiler.add_object(name=name, description=description).id
765 models.Profiler.smart_get(id).update_object(data)
769 models.Profiler.smart_get(id).delete()
774 models.Profiler.list_objects(filter_data))
781 models.User.list_objects(filter_data))
787 group = models.AclGroup.add_object(name=name, description=description)
788 group.users.add(models.User.current_user())
793 group = models.AclGroup.smart_get(id)
800 group = models.AclGroup.smart_get(id)
802 users = models.User.smart_get_bulk(users)
807 group = models.AclGroup.smart_get(id)
809 users = models.User.smart_get_bulk(users)
815 group = models.AclGroup.smart_get(id)
817 hosts = models.Host.smart_get_bulk(hosts)
823 group = models.AclGroup.smart_get(id)
825 hosts = models.Host.smart_get_bulk(hosts)
831 models.AclGroup.smart_get(id).delete()
835 acl_groups = models.AclGroup.list_objects(filter_data)
837 acl_group_obj = models.AclGroup.objects.get(id=acl_group['id'])
1076 query = models.HostQueueEntry.query_objects(filter_data)
1082 models.AclGroup.check_abort_permissions(query)
1086 models.HostQueueEntry.abort_host_queue_entries(host_queue_entries)
1096 query = models.SpecialTask.query_objects(filter_data)
1108 models.AclGroup.check_for_acl_violation_hosts(hosts)
1115 models.SpecialTask.schedule_special_task(host, task)
1133 hosts = models.Host.query_objects(filter_data)
1177 models.SpecialTask.Task.VERIFY, 'reverify_hosts', **filter_data)
1187 models.SpecialTask.Task.REPAIR, 'repair_hosts', **filter_data)
1214 jobs = list(models.Job.query_objects(filter_data))
1215 models.Job.objects.populate_relationships(jobs, models.Label,
1217 models.Job.objects.populate_relationships(jobs, models.JobKeyval, 'keyvals')
1241 return models.Job.query_count(filter_data)
1256 all_status_counts = models.Job.objects.get_status_counts(ids)
1270 job = models.Job.objects.get(id=id)
1362 query = models.HostQueueEntryStartTimes.objects.filter(
1376 query = models.HostQueueEntryStartTimes.objects.filter(
1387 models.HostQueueEntry.query_objects(filter_data),
1401 models.HostQueueEntry.query_objects(filter_data),
1414 return models.HostQueueEntry.query_count(filter_data)
1422 query = models.HostQueueEntry.query_objects(filter_data)
1450 models.SpecialTask.query_objects(filter_data),
1468 host = models.Host.smart_get(host_id, False)
1491 return models.SpecialTask.query_count(kwargs)
1507 host_model = models.Host.smart_get(host, False)
1557 host = models.Host.smart_get(host_id)
1596 host = models.Host.smart_get(host_id)
1649 return (models.HostQueueEntry.query_count(filter_data_queue_entries)
1695 default_drone_set_name = models.DroneSet.default_drone_set_name()
1698 models.DroneSet.objects.exclude(
1718 models.User.current_user().get_object_dict())
1719 result['host_statuses'] = sorted(models.Host.Status.names)
1720 result['job_statuses'] = sorted(models.HostQueueEntry.Status.names)
1721 result['job_timeout_mins_default'] = models.Job.DEFAULT_TIMEOUT_MINS
1723 models.Job.DEFAULT_MAX_RUNTIME_MINS)
1725 models.Job.DEFAULT_PARSE_FAILED_REPAIR)
1729 result['drone_sets_enabled'] = models.DroneSet.drone_sets_enabled()
1778 rows = models.HostAttribute.query_objects({'attribute': attribute,
1791 static_hosts = models.StaticHostAttribute.query_objects(
1804 static_rows = models.StaticHostAttribute.query_objects(
2081 host_model = models.Host.objects.get(pk=known_host_ids[i])
2102 shards = models.Shard.query_objects(filter_data)
2137 label = models.Label.smart_get(label)
2140 shard = models.Shard.objects.get(labels=label)
2143 except models.Shard.DoesNotExist:
2165 shard = models.Shard.add_object(hostname=hostname)
2184 shard = models.Shard.objects.get(hostname=hostname)
2203 shard = models.Shard.objects.get(hostname=hostname)
2204 label = models.Label.smart_get(label)
2211 static_label = models.StaticLabel.smart_get(label.name)
2212 models.Host.objects.filter(
2215 models.Host.objects.filter(labels__in=[label]).update(shard=None)
2226 models.Host.objects.filter(shard=shard).update(shard=None)
2248 models.Job.objects.filter(shard=shard).update(shard=None)