Exemple #1
0
def includeme(config, plugin_map):

    # add procurement method types
    procurement_method_types = plugin_map.get('aliases', [])
    if plugin_map.get('use_default', False):
        procurement_method_types.append(DEFAULT_PROCUREMENT_METHOD_TYPE)
    for procurementMethodType in procurement_method_types:
        config.add_auction_procurementMethodType(Geb, procurementMethodType)

    # add views
    config.scan("openprocurement.auctions.geb.views")

    # register adapters
    config.registry.registerAdapter(AuctionManager, (IRequest, IAuction),
                                    IAuctionManager)
    config.registry.registerAdapter(BidManager, (IRequest, IBid), IBidManager)
    config.registry.registerAdapter(QuestionManager, (IRequest, IQuestion),
                                    IQuestionManager)

    LOGGER.info("Included openprocurement.auctions.geb plugin",
                extra={'MESSAGE_ID': 'included_plugin'})

    # add accreditation level
    if not plugin_map.get('accreditation'):
        config.registry.accreditation['auction'][
            Geb._internal_type] = DEFAULT_LEVEL_OF_ACCREDITATION
    else:
        config.registry.accreditation['auction'][
            Geb._internal_type] = plugin_map['accreditation']

    # migrate data
    if plugin_map['migration'] and not os.environ.get('MIGRATION_SKIP'):
        get_evenly_plugins(config, plugin_map['plugins'],
                           'openprocurement.auctions.geb.plugins')
def includeme_lease(config, plugin_map):
    procurement_method_types = plugin_map.get('aliases', [])
    if plugin_map.get('use_default', False):
        procurement_method_types.append(DEFAULT_PROCUREMENT_METHOD_TYPE_LEASE)
    for procurementMethodType in procurement_method_types:
        config.add_auction_procurementMethodType(Auction,
                                                 procurementMethodType)

    # add views
    for view_location in VIEW_LOCATIONS:
        config.scan(view_location)

    # Register adapters
    config.registry.registerAdapter(AuctionLeaseConfigurator,
                                    (ILeaseAuction, IRequest),
                                    IContentConfigurator)
    config.registry.registerAdapter(AwardingNextCheckV2_1, (ILeaseAuction, ),
                                    IAwardingNextCheck)
    config.registry.registerAdapter(AuctionLeaseManagerAdapter,
                                    (ILeaseAuction, ), IAuctionManager)
    # migrate data
    if plugin_map['migration'] and not os.environ.get('MIGRATION_SKIP'):
        get_evenly_plugins(config, plugin_map['plugins'],
                           'openprocurement.auctions.lease.plugins')

    LOGGER.info("Included openprocurement.auctions.lease.property plugin",
                extra={'MESSAGE_ID': 'included_plugin'})
Exemple #3
0
def includeme(config, plugin_map):
    procurement_method_types = plugin_map.get('aliases', [])
    if plugin_map.get('use_default', False):
        procurement_method_types.append(DEFAULT_PROCUREMENT_METHOD_TYPE)
    for procurementMethodType in procurement_method_types:
        config.add_auction_procurementMethodType(Auction,
                                                 procurementMethodType)

    # add views
    for view_location in VIEW_LOCATIONS:
        config.scan(view_location)

    # register adapters
    config.registry.registerAdapter(AuctionFlashConfigurator,
                                    (IFlashAuction, IRequest),
                                    IContentConfigurator)
    config.registry.registerAdapter(AwardingNextCheckV1, (IFlashAuction, ),
                                    IAwardingNextCheck)
    config.registry.registerAdapter(AuctionFlashManagerAdapter,
                                    (IFlashAuction, ), IAuctionManager)
    # migrate data
    if plugin_map['migration'] and not os.environ.get('MIGRATION_SKIP'):
        get_evenly_plugins(config, plugin_map['plugins'],
                           'openprocurement.auctions.flash.plugins')

    # add accreditation level
    if not plugin_map.get('accreditation'):
        config.registry.accreditation['auction'][
            Auction._internal_type] = DEFAULT_LEVEL_OF_ACCREDITATION
    else:
        config.registry.accreditation['auction'][
            Auction._internal_type] = plugin_map['accreditation']
def includeme_financial(config, plugin_map):
    procurement_method_types = plugin_map.get('aliases', [])
    if plugin_map.get('use_default', False):
        procurement_method_types.append(
            DEFAULT_PROCUREMENT_METHOD_TYPE_FINANCIAL
        )
    for procurementMethodType in procurement_method_types:
        config.add_auction_procurementMethodType(RubbleFinancial,
                                                 procurementMethodType)

    config.scan("openprocurement.auctions.rubble.views.financial")

    # Register Adapters
    config.registry.registerAdapter(
        AuctionRubbleFinancialConfigurator,
        (IRubbleFinancialAuction, IRequest),
        IContentConfigurator
    )
    config.registry.registerAdapter(
        AwardingNextCheckV2_1,
        (IRubbleFinancialAuction,),
        IAwardingNextCheck
    )
    config.registry.registerAdapter(
        AuctionRubbleFinancialManagerAdapter,
        (IRubbleFinancialAuction,),
        IAuctionManager
    )

    LOGGER.info("Included openprocurement.auctions.rubble.financial plugin",
                extra={'MESSAGE_ID': 'included_plugin'})

    # migrate data
    if plugin_map['migration'] and not os.environ.get('MIGRATION_SKIP'):
        get_evenly_plugins(config, plugin_map['plugins'], 'openprocurement.auctions.rubble.plugins')
Exemple #5
0
def includeme_other(config, plugin_map):
    procurement_method_types = plugin_map.get('aliases', [])
    if plugin_map.get('use_default', False):
        procurement_method_types.append(DEFAULT_PROCUREMENT_METHOD_TYPE_OTHER)
    for procurementMethodType in procurement_method_types:
        config.add_auction_procurementMethodType(RubbleOther,
                                                 procurementMethodType)

    config.scan("openprocurement.auctions.rubble.views.other")

    # Register adapters
    config.registry.registerAdapter(AuctionRubbleOtherConfigurator,
                                    (IRubbleOtherAuction, IRequest),
                                    IContentConfigurator)
    config.registry.registerAdapter(AwardingNextCheckV2_1,
                                    (IRubbleOtherAuction, ),
                                    IAwardingNextCheck)
    config.registry.registerAdapter(AuctionRubbleOtherManagerAdapter,
                                    (IRubbleOtherAuction, ), IAuctionManager)

    LOGGER.info("Included openprocurement.auctions.rubble.other plugin",
                extra={'MESSAGE_ID': 'included_plugin'})

    # add accreditation level
    if not plugin_map.get('accreditation'):
        config.registry.accreditation['auction'][
            RubbleOther._internal_type] = DEFAULT_LEVEL_OF_ACCREDITATION
    else:
        config.registry.accreditation['auction'][
            RubbleOther._internal_type] = plugin_map['accreditation']

    # migrate data
    if plugin_map['migration'] and not os.environ.get('MIGRATION_SKIP'):
        get_evenly_plugins(config, plugin_map['plugins'],
                           'openprocurement.auctions.rubble.plugins')