Exemple #1
0
 def init_const_data(self):
     '''Creates 'constant' objects that should always be there in
     the database. If they are already there, this method does nothing.'''
     for username in (PSEUDO_USER__LOGGED_IN, PSEUDO_USER__VISITOR):
         if not User.by_name(username):
             user = User(name=username)
             meta.Session.add(user)
     meta.Session.flush()  # so that these objects can be used
     # straight away
     init_authz_const_data()
Exemple #2
0
 def init_const_data(self):
     """Creates 'constant' objects that should always be there in
     the database. If they are already there, this method does nothing."""
     for username in (PSEUDO_USER__LOGGED_IN, PSEUDO_USER__VISITOR):
         if not User.by_name(username):
             user = User(name=username)
             meta.Session.add(user)
     meta.Session.flush()  # so that these objects can be used
     # straight away
     init_authz_const_data()