Exemplo n.º 1
0
 def setup_model():
     from sqlalchemy.orm import configure_mappers
     from camelot.core.sql import metadata
     metadata.bind = settings.ENGINE()
     import camelot.model.party
     import camelot.model.authentication
     import camelot.model.i18n
     import camelot.model.fixture
     import camelot.model.memento
     import camelot_example.model
     #
     # setup_all is only needed for those models that rely on elixir
     #
     from elixir import setup_all
     setup_all()
     #
     # create the tables for all models, configure mappers first, to make
     # sure all deferred properties have been handled, as those could
     # create tables or columns
     #
     configure_mappers()
     metadata.create_all()
     from camelot.model.authentication import update_last_login
     update_last_login()
     # 
     # Load sample data with the fixure mechanism
     #
     from camelot_example.fixtures import load_movie_fixtures
     load_movie_fixtures()
     #
     # setup the views
     #
     from camelot_example.view import setup_views
     setup_views()
Exemplo n.º 2
0
 def setup_model():
     from sqlalchemy.orm import configure_mappers
     from camelot.core.sql import metadata
     metadata.bind = settings.ENGINE()
     import camelot.model.party
     import camelot.model.authentication
     import camelot.model.i18n
     import camelot.model.fixture
     import camelot.model.memento
     import camelot_example.model
     #
     # setup_all is only needed for those models that rely on elixir
     #
     from elixir import setup_all
     setup_all()
     #
     # create the tables for all models, configure mappers first, to make
     # sure all deferred properties have been handled, as those could
     # create tables or columns
     #
     configure_mappers()
     metadata.create_all()
     from camelot.model.authentication import update_last_login
     update_last_login()
     #
     # Load sample data with the fixure mechanism
     #
     from camelot_example.fixtures import load_movie_fixtures
     load_movie_fixtures()
     #
     # setup the views
     #
     from camelot_example.view import setup_views
     setup_views()
Exemplo n.º 3
0
def setup_model():
    from camelot.core.sql import metadata
    metadata.bind = ENGINE()
    from camelot.model import authentication
    from camelot.model import party
    from camelot.model import i18n
    from camelot.model import memento
    from camelot.model import fixture
    from camelot.model import batch_job
    import camelot_example.model
    from camelot_example.view import setup_views
    from camelot_example.fixtures import load_movie_fixtures
    from elixir import setup_all
    from camelot.model.authentication import update_last_login
    setup_all(create_tables=True)
    setup_views()
    load_movie_fixtures()
    update_last_login()
Exemplo n.º 4
0
    def setup_model(self):
        from camelot.core.sql import metadata
        metadata.bind = self.ENGINE()
        from camelot.model import authentication
        from camelot.model import party
        from camelot.model import i18n
        from camelot.model import memento
        from camelot.model import fixture
        from camelot.model import batch_job
        import camelot_example.model

        from camelot_example.view import setup_views
        from camelot_example.fixtures import load_movie_fixtures
        from camelot.model.authentication import update_last_login
        from camelot.core.orm import setup_all
        setup_all(create_tables=True)
        setup_views()
        load_movie_fixtures()
        update_last_login()
Exemplo n.º 5
0
    def setup_model( self ):
        from camelot.core.sql import metadata
        # bind metadata to a specific connection, when using the in memory
        # database this is needed or the data is lost
        metadata.bind = self.ENGINE().connect()
        from camelot.model import authentication
        from camelot.model import party
        from camelot.model import i18n
        from camelot.model import memento
        from camelot.model import fixture
        from camelot.model import batch_job
        import camelot_example.model

        from camelot_example.view import setup_views
        from camelot_example.fixtures import load_movie_fixtures
        from camelot.model.authentication import update_last_login
        from camelot.core.orm import setup_all
        setup_all(create_tables=True)
        setup_views()
        load_movie_fixtures()
        update_last_login()