~romaimperator/keryx/devel

« back to all changes in this revision

Viewing changes to libkeryx/__init__.py

  • Committer: Chris Oliver
  • Date: 2009-09-18 01:40:26 UTC
  • Revision ID: excid3@gmail.com-20090918014026-ox4k932l03rsl2re
Project and repository relationship creating working

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
 
91
91
    def create(self):
92
92
        """Create a new Keryx database"""
 
93
        # Query to see if project exists already
 
94
        found = self.session.query(Project).filter(Project.name==self.project).all()
 
95
        
 
96
        if found:
 
97
            logging.error("Project already exists")
 
98
            return False
 
99
 
93
100
        logging.info("Creating project...")
94
 
        self.on_create()
 
101
        try:
 
102
            self.on_create()
 
103
        except Exception, e:
 
104
            logging.error(e)
95
105
 
96
106
 
97
107
    def on_create(self):