Home
last modified time | relevance | path

Searched refs:id_or_name (Results 1 – 2 of 2) sorted by relevance

/external/autotest/frontend/afe/
Dmodel_logic.py829 def smart_get(cls, id_or_name, valid_only=True): argument
839 if isinstance(id_or_name, (int, long)):
840 return manager.get(pk=id_or_name)
841 if isinstance(id_or_name, basestring) and hasattr(cls, 'name_field'):
842 return manager.get(**{cls.name_field : id_or_name})
844 'Invalid positional argument: %s (%s)' % (id_or_name,
845 type(id_or_name)))
852 for id_or_name in id_or_name_list:
854 result_objects.append(cls.smart_get(id_or_name))
856 invalid_inputs.append(id_or_name)
Dmodels.py1303 def smart_get(cls, id_or_name, *args, **kwargs): argument
1311 return cls.objects.get(pk=id_or_name)