def index(request): areas_de_atuacao_list = Area.objects.all() servicos_list = [] year = get_year() solucao = has_solucao() return render_to_response("areas-de-atuacao/index.html", {'areas': areas_de_atuacao_list, 'servicos': servicos_list, 'year': year, 'solucao': solucao })
def posts_page(request, page_id): upper_limit = int(page_id) * MAX_POST_PER_PAGE lower_limit = upper_limit - MAX_POST_PER_PAGE all_posts = Post.objects.all() posts_list = all_posts[lower_limit:upper_limit] recents = recent_posts() year = get_year() posts_by_month = posts_months() solucao = has_solucao() if page_id == 1: previous_page = None else: previous_page = int(page_id) - 1 next_page = int(page_id) + 1 if len(all_posts) > upper_limit else None #posts_list = sorted(posts_list,lambda x,y:cmp(y.id,x.id)) # bug da ordem posts_list = posts_list[::-1] return render_to_response( "blog/index.html", { 'posts': posts_list, 'year': year, 'recent_posts': recents, 'post_months': posts_by_month, 'next_page': next_page, 'previous_page': previous_page, 'page_id': page_id, 'solucao': solucao })
def home(request): slides = Slide.objects.filter(slider=HOME_ID) solucao = has_solucao() return render_to_response('home/index.html', { 'year': get_year(), 'slides': slides, 'solucao': solucao })
def index(request): person_list = Person.objects.all() year = get_year() solucao = has_solucao() return render_to_response("quem-somos-nos/index.html", { 'persons': person_list, 'year': year, 'solucao': solucao })
def index(request): produtos_list = Solucao.objects.all() year = get_year() solucao = has_solucao() if not solucao: raise Http404 return render_to_response("solucoes/index.html", {'produtos': produtos_list, 'year': year, 'solucao': solucao})
def detail(request, solucao_id): p = get_object_or_404(Solucao, pk=solucao_id) produtos_list = Solucao.objects.all() year = get_year() solucao = has_solucao() print p if not solucao: raise Http404 return render_to_response('solucoes/detail.html', {'produto': p, 'year': year, 'produtos': produtos_list, 'solucao': solucao })
def detail(request, pessoa_id): realname = get_real_name(pessoa_id) year = get_year() person = get_object_or_404(Person, name=realname) solucao = has_solucao() return render_to_response('quem-somos-nos/detail.html', { 'person': person, 'year': year, "media": MEDIA_ROOT, 'solucao': solucao })
def posts_year(request, year): post_list_filtered = Post.objects.filter(published__year=year) posts_by_month = posts_months() year = get_year() recents = recent_posts() solucao = has_solucao() return render_to_response( 'blog/index.html', { 'posts': post_list_filtered, 'post_months': posts_by_month, 'year': year, 'recent_posts': recents, 'solucao': solucao })
def detail(request, area_id): p = get_object_or_404(Area, pk=area_id) year = get_year() solucao = has_solucao() return render_to_response('areas-de-atuacao/detail.html', {'area_id': p, 'year': year, 'solucao': solucao })