summaryrefslogtreecommitdiff
path: root/squad_client
diff options
context:
space:
mode:
authorJustin Cook <jscook2345@gmail.com>2020-06-17 16:15:38 -0500
committerJustin Cook <jscook2345@gmail.com>2020-06-17 16:15:38 -0500
commit853b2b184dc22f4e1b26b0949908f00a18f7aee6 (patch)
tree2c6beebb910ebb6437ad06b80f538f4f90b28583 /squad_client
parent80f6805f5101cbc36ed32cbc64df3f6c11860b7c (diff)
Add methods to fetch environments from a project
Diffstat (limited to 'squad_client')
-rw-r--r--squad_client/core/models.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/squad_client/core/models.py b/squad_client/core/models.py
index c64939b..3ffd037 100644
--- a/squad_client/core/models.py
+++ b/squad_client/core/models.py
@@ -239,6 +239,15 @@ class Project(SquadObject):
objects = self.builds(count=1, **filters)
return first(objects)
+ def environments(self, count=DEFAULT_COUNT, **filters):
+ filters.update({'project': self.id})
+ return self.__fetch__(Environment, filters, count)
+
+ def environment(self, slug):
+ filters = {'slug': slug}
+ objects = self.environments(count=1, **filters)
+ return first(objects)
+
def suites(self, count=DEFAULT_COUNT, **filters):
filters.update({'project': self.id})
return self.__fetch__(Suite, filters, count)