コード例 #1
0
ファイル: views.py プロジェクト: anushbmx/FlightDeck
def admin(request):
    msg = ''
    if request.method == 'POST':
        action = request.POST.get('action')
        log_msg = '[admin] %s by %s (id: %d)'
        if action == 'setup_mapping':
            msg = 'setup_mapping triggered'
            log.info(log_msg % (msg, request.user, request.user.pk))
            setup_mapping()
        elif action == 'index_all':
            msg = 'index_all triggered'
            log.info(log_msg % (msg , request.user, request.user.pk))
            index_all()
        else:
            log.warning('[TAMPERING][admin] Action "%s" tried by %s (id: %s)'
                        % (action, request.user, request.user.pk))

    return render_to_response('admin.html', {
            'message': msg
        }, context_instance=RequestContext(request))
コード例 #2
0
ファイル: search_tests.py プロジェクト: fox2mike/FlightDeck
 def setup_class(cls):
     super(MappedESTestCase, cls).setup_class()
     setup_mapping()
コード例 #3
0
ファイル: search_tests.py プロジェクト: sirinartk/FlightDeck
 def setup_class(cls):
     super(MappedESTestCase, cls).setup_class()
     setup_mapping()