PythonistL sez:
> into a dictionary like syntax so that I can use it in URL dispatcher in
an optional dictionary?
Hi La,
I'm going to provide an answer, because I don't really understand what
you are asking for. If this doesn't help please elaborate on the
problem.
You can try this:
(r'^lookuprecs/(?P<search_field>[^/])/$',
'myproj.apps.myapp.views.lookuprecs'),
and then in your view:
def lookuprecs(request, search_field):
result_list =
objects.get_list(complex=(Q(Subject__contains=search_field) |
Q(OfferType__contains=search_field)))
alternatively you could use a parameter instead, where the URL is like
this:
localhost/lookuprecs/?search_field=%20abcd%20
along with:
def lookuprec(request):
if request.GET:
# not sure what string to get if no parameter
# also either request.GET or request.REQUEST, depending on use
search_field = request.GET.get('search_field', None)
result_list =
objects.get_list(complex=(Q(Subject__contains=search_field)|Q(OfferType__contains=search_field)))
Is that anything like you are after? It was hard to tell.
BTW, I think it is very confusing to have capitalized field and
variable names. These look like classes and can be misleading - at
least to others.
-rob