Wednesday, August 10, 2011

Generating urls for a search-engine-like application

Hi all, i'm developing a search-engine-like application using django
1.3 and apache-solr as "database"

I'm now stuck with urls handling. Basically, i need to compose urls
with the parameters used to query solr. Fair enough, but i faced a
problem.

Basically, you can filter your results by choosing a country, a city,
or both (example)

My urls may look like this

url(/<country>/, search_view),
url(/<city>/, search_view),
url(/<country>/<city>/, search_view)

as you can see, case 1 and case 2 are a trouble: country and city are
both strings, how's the url supposed to know if a link pointed to one
url or another? Should i use named views in templating? What's the
best way i can use them in my case?

my boss told me to use get requests instead of post, so i could
explicit the parameters, but SEO experts said "NO WAY!". i don't like
get method either, but the reason is different :P
i cannot use get_absolute_url from an object because i have no model
objects (because, since now, there were no need... just an user object
used to store some infos, nothing else)

Any hint on how i can do this? Thanks all in advance!

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate