Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
binds the frozen context the selected features

should be called only once - calls after the first call have
no effect

        def select_product():
    """
    binds the frozen context the selected features
    
    should be called only once - calls after the first call have
    no effect
    """
    global _product_selected
    if _product_selected:
        #tss already bound ... ignore
        return

    _product_selected = True
    from django_productline import context

    featuremonkey.add_import_guard('django.conf')
    featuremonkey.add_import_guard('django.db')
    os.environ['DJANGO_SETTINGS_MODULE'] = 'django_productline.settings'
    contextfile = os.environ['PRODUCT_CONTEXT_FILENAME']
    equationfile = os.environ['PRODUCT_EQUATION_FILENAME']
    #bind context and compose features
    context.bind_context(contextfile)
    get_composer().select_equation(equationfile)
    featuremonkey.remove_import_guard('django.conf')
    featuremonkey.remove_import_guard('django.db')

    #force import of settings and urls
    #better fail during initialization than on the first request
    from django.conf import settings
    from django.core.urlresolvers import get_resolver
    #eager creation of URLResolver
    get_resolver(None)
        


src/d/j/django-productline-0.3/django_productline/tasks.py   django-productline(Download)
    """
    from django_productline import startup
    startup.select_product()
    return func(*args, **kws)
 

src/d/j/django-productline-HEAD/django_productline/tasks.py   django-productline(Download)
    """
    from django_productline import startup
    startup.select_product()
    return func(*args, **kws)