#23810: Passing 'start' from django url gives error “start() takes exactly 2
arguments (1 given) ”
-----------------------------+------------------------
Reporter: yogeshdmca | Owner: yogesh
Type: Bug | Status: new
Component: Core (URLs) | Version: 1.6
Severity: Normal | Keywords: django-url
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------
unfortunately i am getting a unexpected error in Django. I have a this
urls :
{{{
urlpatterns += patterns('ads.search',
url(r'^getsubcategories/$', 'getsubcategories',
name="getsubcategories"),
url(r'^anuncios/([\w\-]+)/$', 'anuncios_search',
name="anuncios_search"),
)
}}}
When I am going to call url "anuncios_search" this will work for all
search patterns accept "/anuncios/start/", please see below for working
urls:
examples:
1) /anuncios/avc/ : this works.
2) /anuncios/finds/: this works .
3) /anuncios/start-day/: this works .
4) /anuncios/starts/: this works .
5) /anuncios/start/: this url throwing me error :
{{{
Internal Server Error: /anuncios/start/
Traceback (most recent call last):
File "/home/yogesh/ENV/munda/local/lib/python2.7/site-
packages/django/core/handlers/base.py", line 114, in get_response
response = wrapped_callback(request, *callback_args,
**callback_kwargs)
TypeError: start() takes exactly 2 arguments (1 given)
[13/Nov/2014 05:36:57] "GET /anuncios/start/ HTTP/1.1" 500 11496
}}}
my views.py is :
{{{
def anuncios_search(request,search_text=None):
"""
This method for home page search, for acept contactos category
"""
if search_text:
search_text_list = [i for i in search_text.split("-") if len(i)>2]
else:
search_text_list=[]
ads =
Ad.objects.exclude(subcategory__category__adult=True,user__is_active=True).order_by('-active','-republishDate')
if search_text_list:
ads = ads.filter(
reduce(lambda x, y: x | y, [Q(title__icontains=word) for word
in search_text_list])|
reduce(lambda x, y: x | y, [Q(description__icontains=word) for
word in search_text_list])
).order_by('-active','-republishDate')
current_filters=
{'current_category':None,'ads':ads_paginator(request,ads)}
current_filters['search_text'] = search_text and "
".join(search_text.split("-")) or None
current_filters['search_text_list'] = search_text_list and
search_text_list or None
return render(request,'search/search.html',current_filters)
}}}
Please help me to resolve this bug.
Thanks in advance
--
Ticket URL: <https://code.djangoproject.com/ticket/23810>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.2a8a75f23de214ef45aafb236111733b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.