예제 #1
0
 def make():
     file_manager = FileManager(self.transient_root,
                                self.persistent_root,
                                self.transient_url, self.persistent_url)
     filesessionmaker(orm.sessionmaker(),
                      self.file_manager,
                      file_managers={
                          ObjWithFile.file: file_manager,
                      })
예제 #2
0
 def make():
     file_manager = FileManager(self.transient_root,
                                self.persistent_root,
                                self.transient_url,
                                self.persistent_url)
     filesessionmaker(orm.sessionmaker(), self.file_manager,
         file_managers={
             ObjWithFile.file: file_manager,
         })
예제 #3
0
파일: images.py 프로젝트: vlaght/iktomi
 def setUp(self):
     self.transient_root = tempfile.mkdtemp()
     self.persistent_root = tempfile.mkdtemp()
     self.transient_url = '/transient/'
     self.persistent_url = '/media/'
     self.file_manager = FileManager(self.transient_root,
                                     self.persistent_root,
                                     self.transient_url,
                                     self.persistent_url)
     Session = filesessionmaker(orm.sessionmaker(), self.file_manager)
     engine = create_engine('sqlite://')
     Base.metadata.create_all(engine)
     self.db = Session(bind=engine)
예제 #4
0
 def setUp(self):
     self.transient_root = tempfile.mkdtemp()
     self.persistent_root = tempfile.mkdtemp()
     self.transient_url = '/transient/'
     self.persistent_url = '/media/'
     self.file_manager = FileManager(self.transient_root,
                                     self.persistent_root,
                                     self.transient_url,
                                     self.persistent_url)
     Session = filesessionmaker(orm.sessionmaker(), self.file_manager)
     engine = create_engine('sqlite://')
     Base.metadata.create_all(engine)
     self.db = Session(bind=engine)
예제 #5
0
    def setUp(self):

        self.transient_root = tempfile.mkdtemp()
        self.persistent_root = tempfile.mkdtemp()
        self.transient_url = '/transient/'
        self.persistent_url = '/media/'

        self.file_manager = FileManager(self.transient_root,
                                        self.persistent_root,
                                        self.transient_url,
                                        self.persistent_url)

        self.metadata_transient_root = tempfile.mkdtemp()
        self.metadata_persistent_root = tempfile.mkdtemp()
        self.metadata_transient_url = '/metadata/transient/'
        self.metadata_persistent_url = '/metadata/media/'

        self.metadata_file_manager = FileManager(self.metadata_transient_root,
                                                 self.metadata_persistent_root,
                                                 self.metadata_transient_url,
                                                 self.metadata_persistent_url)

        self.model_transient_root = tempfile.mkdtemp()
        self.model_persistent_root = tempfile.mkdtemp()
        self.model_transient_url = '/model/transient/'
        self.model_persistent_url = '/model/media/'

        self.model_file_manager = FileManager(self.model_transient_root,
                                              self.model_persistent_root,
                                              self.model_transient_url,
                                              self.model_persistent_url)

        Session = filesessionmaker(orm.sessionmaker(),
                                   self.file_manager,
                                   file_managers={
                                       MetadataLevelObj.metadata:
                                       self.metadata_file_manager,
                                       ModelLevelObj: self.model_file_manager,
                                   })

        engine = create_engine('sqlite://')
        Base.metadata.create_all(engine)
        CustomBase.metadata.create_all(engine)
        self.db = Session(bind=engine)
예제 #6
0
    def setUp(self):

        self.transient_root = tempfile.mkdtemp()
        self.persistent_root = tempfile.mkdtemp()
        self.transient_url = '/transient/'
        self.persistent_url = '/media/'

        self.file_manager = FileManager(self.transient_root,
                                        self.persistent_root,
                                        self.transient_url,
                                        self.persistent_url)

        self.metadata_transient_root = tempfile.mkdtemp()
        self.metadata_persistent_root = tempfile.mkdtemp()
        self.metadata_transient_url = '/metadata/transient/'
        self.metadata_persistent_url = '/metadata/media/'

        self.metadata_file_manager = FileManager(self.metadata_transient_root,
                                                 self.metadata_persistent_root,
                                                 self.metadata_transient_url,
                                                 self.metadata_persistent_url)

        self.model_transient_root = tempfile.mkdtemp()
        self.model_persistent_root = tempfile.mkdtemp()
        self.model_transient_url = '/model/transient/'
        self.model_persistent_url = '/model/media/'

        self.model_file_manager = FileManager(self.model_transient_root,
                                              self.model_persistent_root,
                                              self.model_transient_url,
                                              self.model_persistent_url)


        Session = filesessionmaker(orm.sessionmaker(), self.file_manager,
            file_managers={
                MetadataLevelObj.metadata: self.metadata_file_manager,
                ModelLevelObj: self.model_file_manager,
            })

        engine = create_engine('sqlite://')
        Base.metadata.create_all(engine)
        CustomBase.metadata.create_all(engine)
        self.db = Session(bind=engine)