示例#1
0
def search_tag(request):

    if request.method == "GET" and request.GET.has_key("search"):

        form = SearchForm(request.GET)
    
        if form.is_valid():
            pass
    else:
        form = SearchForm()
    return {
        'form': form
    }
示例#2
0
    }, context_instance=RequestContext(request))

@vary_on_headers(*CACHE_VARY_ON_HEADERS)
@cache_page_with_dynamic_key(generate_cache_key_from_request) # 1 minute
def browse(request):
    active_filter = "new"
    
    try:
        profile = request.user.profile_set.latest('pk')
    except ObjectDoesNotExist, e:
        profile = None
    except AttributeError, e: # anonymous user
        profile = None
    
    if request.method == "POST" and not request.POST.has_key("poll_id"):
        form = SearchForm(request.POST)

        if form.is_valid():
            pass
    else:
        form = SearchForm()
        
    genres = Genre.objects.all()
    print "####### genres: %s" % genres
    languages = Language.objects.all()

    content_type = ContentType.objects.get_for_model(Story)
    
    if request.GET.has_key("popular"):
        stories = Story.objects.extra(
            select = {