changeset 154:a620eb6e1fb0

Add controller method to find projects by key The new methods returns projects which project key starts with the passed key.
author Björn Ricks <bjoern.ricks@intevation.de>
date Thu, 06 Dec 2012 13:10:10 +0100
parents 17dede6cb724
children 497ed1991e85
files getan/controller.py
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/getan/controller.py	Thu Dec 06 12:32:06 2012 +0100
+++ b/getan/controller.py	Thu Dec 06 13:10:10 2012 +0100
@@ -122,6 +122,13 @@
                 return proj
         return None
 
+    def find_projects_by_key(self, key):
+        projects = []
+        for proj in self.projects:
+            if proj.key.startswith(key):
+                projects.append(proj)
+        return projects
+
     def start_project(self, project):
         if not project:
             return
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)