Esempio n. 1
0
def includeme(config):
    config.include('pyramid_mongokit')

    register_document(config.registry, User)
    generate_index(config.registry, User)

    register_document(config.registry, Photo)
    generate_index(config.registry, Photo)
Esempio n. 2
0
def includeme_mongo_connection(config):
    config.include("pyramid_mongokit")

    register_document(config.registry, [User, UserGame])

    generate_index(config.registry, User, db_name="games")
    generate_index(config.registry, UserGame, db_name="games", collection="bingo")
    generate_index(config.registry, UserGame, db_name="games", collection="scrabble")

    generate_index(config.registry, User, db_name="another")
Esempio n. 3
0
def includeme_mongo_connection(config):
    config.include('pyramid_mongokit')

    register_document(config.registry, [User, UserGame])

    generate_index(config.registry, User, db_name='games')
    generate_index(config.registry, UserGame, db_name='games',
                   collection='bingo')
    generate_index(config.registry, UserGame, db_name='games',
                   collection='scrabble')

    generate_index(config.registry, User, db_name='another')
Esempio n. 4
0
def includeme_single_db_connection(config):
    """To use single db connection, provide ``MONGO_DB_NAME`` in environment
    variables. ``MONGO_DB_PREFIX`` is optionnal.
    """
    config.include('pyramid_mongokit')

    register_document(config.registry, [User, UserGame])

    generate_index(config.registry, User)
    generate_index(config.registry, UserGame, collection='bingo')
    generate_index(config.registry, UserGame, collection='scrabble')
Esempio n. 5
0
def includeme_single_db_connection(config):
    """To use single db connection, provide ``mongodb.db_name`` in your
    settings ini. ``mongodb.db_prefix`` is optionnal.
    """
    config.include("pyramid_mongokit")

    register_document(config.registry, [User, UserGame])

    generate_index(config.registry, User)
    generate_index(config.registry, UserGame, collection="bingo")
    generate_index(config.registry, UserGame, collection="scrabble")
Esempio n. 6
0
def includeme(config):
    config.include('pyramid_mongokit')

    register_document(config.registry, Photo)
    generate_index(config.registry, Photo)

    register_document(config.registry, Report)
    generate_index(config.registry, Report)

    register_document(config.registry, User)
    generate_index(config.registry, User)