Any one???
On Nov 25, 4:09 pm, laspal <[EMAIL PROTECTED]> wrote:
> Hi,
>
> ***********view****************
> company_list = Company.objects.order_by('name')
> selected_companies_id_list = request.POST.getlist
> ('selected_companies_id_list')
> companies_list =[]
> for company_id in selected_companies_id_list:
> company = Company.objects.get(id = company_id)
> companies_list.append(company)
>
> string =''
> for item in companies_list:
> string = string + item + ','
>
> if request.method == 'POST':
> if not string:
> mailerror = ""
> return render_to_response( 'reports.html', locals() )
> else:
> return HttpResponseRedirect(reverse('companies_report',
> args=[string]))
>
> return render_to_response( 'reports.html', locals())
>
> ********************view******************
> @login_required
> def generate_companies_report(request, companies_list):
>
> companies_list = companies_list
> indus = request.POST.get('industry')
> prio = request.POST.get('priority')
> met_by = request.POST.get('metby')
> cont = request.POST.get('contacts')
> rev = request.POST.get('revenue')
> if request.method == 'POST':
>
> So what I am doing right now is selecting list of companies from
> companies_list and sending it to
> generate companies report from where user choose different field and
> finally post.
>
> So myproblemis right now I am doing it in a wrong way. I am sending
> selected list of companies in my url................
> url(r'^reports/companies/selected/(?P<companies_list>[a-z]+)/
> generatereport/$', generate_companies_report, name
> ="companies_report"),
>
> So how can I fix it.
>
> Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---