Exemplo n.º 1
0
def images(request):
    if request.method == 'GET' and request.GET != {}:
        context = {'searchValues': request.GET}

        context = setConstants(context)

        context['text'] = request.GET['text']
        #context['pgNum'] = pgNum if 'pgNum' in context else '1'
        #context['url'] = url
        context['displayType'] = 'list'
        context['pixonly'] = 'true'
        context['title'] = TITLE

        # do search
        loginfo('start search', context, request)
        context = doSearch(context)

        return render(request, 'showImages.html', context)

    else:
        return render(request, 'showImages.html', {
            'title': TITLE,
            'pgNum': 10,
            'maxresults': 20
        })
Exemplo n.º 2
0
def index(request):

    context = setConstants({})

    # http://blog.mobileesp.com/
    # the middleware must be installed for the following to work...
    if request.is_phone:
        context['device'] = 'phone'
    elif request.is_tablet:
        context['device'] = 'tablet'
    else:
        context['device'] = 'other'

    if request.method == 'GET' and request.GET != {}:
        context['searchValues'] = request.GET

        if 'text' in request.GET:
            context['text'] = request.GET['text']
        if 'musno' in request.GET:
            context['musno'] = request.GET['musno']
            context['maxresults'] = 1
        if 'submit' in request.GET:
            context['maxresults'] = MAXRESULTS
            if "Metadata" in request.GET['submit']:
                context['resultType'] = 'metadata'
                context['displayType'] = 'full'
            elif "Images" in request.GET['submit']:
                context['resultType'] = 'images'
                context['pixonly'] = 'true'
                context['displayType'] = 'grid'
            elif "Lucky" in request.GET['submit']:
                context['resultType'] = 'metadata'
                context['maxresults'] = 1
        else:
            context['resultType'] = 'metadata'
        context['title'] = TITLE

        # do search
        loginfo('start search', context, request)
        context = doSearch(context)

        return render(request, 'imagineImages.html', context)

    else:
        
        return render(request, 'imagineImages.html', context)
Exemplo n.º 3
0
def images(request):
    if request.method == 'GET' and request.GET != {}:
        context = {'searchValues': request.GET}

        context = setConstants(context)

        context['text'] = request.GET['text']
        #context['pgNum'] = pgNum if 'pgNum' in context else '1'
        #context['url'] = url
        context['displayType'] = 'list'
        context['pixonly'] = 'true'
        context['title'] = TITLE

        # do search
        loginfo('start search', context, request)
        context = doSearch(context)

        return render(request, 'showImages.html', context)

    else:
        return render(request, 'showImages.html',
                      {'title': TITLE, 'pgNum': 10, 'maxresults': 20})