Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » URL -> query problem --- doesn't seem to be cache-related [RSS Feed]

#1 Jan. 14, 2011 14:06:19

Chris L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

URL -> query problem --- doesn't seem to be cache-related


Hi Django gurus,

I'm coding-up a failure tracking database, and came up with what I
thought was a straightforward way to encode different searches into
part-failures via a single URL pattern.

In urls.py:

url(r'^part_failure_list(/project/(?P<project_id>\d+))?(/platform/(?
P<platform_id>\d+))?(/hw_category/(?P<hw_category_id>\d+))?(/
hw_subcategory/(?P<hw_subcategory_id>\d+))?....', #more stuff like
this
'tracker.track.views.part_failure_list',
{ 'nav_context': nav_context },
'part_failure_list'),
)

Then in views.py, the function 'part_failure_list' looks for the
existence of each of the keyword arguments and filters the query
appropriately. The resulting html page offers links that 'unselect's
each selected keyword (removes them from the url) and links that
further restrict the query (adds more keywords to the url).

When I click on a link that further restricts the query (adding more
keywords into the url) I get the expected result. THE PROBLEM IS that
when I click on a link that unselects a keyword, my browser shows an
html page where the keyword is still selected. I have to restart
apache and reload the page to get the expected html page.

I've verified that the links to unselect keywords are correct. I set
the CACHE_BACKEND to dummy, and used @cache_control(no_cache=True) to
try to turn off caching (in case the cache is malfunctioning). I used
Chrome and Firefox to see if there is a browser cache problem on one
or the other. I did a 'python manage.py runserver' on the web server
and used the lynx browser on the web server and still reproduced the
problem. So I'm wondering if somehow this relates to how urls are
dispatched by Django(???).

Any suggestions?

I'm using:
Django-1.2.1 (installed from the Django web site) running on an
ubuntu server.
I'm running apache2 with mod_wsgi.
I'm using MySQL 5.1.41

Thanks,
-Chris

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

Offline

#2 Jan. 14, 2011 14:16:54

bruno d.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

URL -> query problem --- doesn't seem to be cache-related


On 14 jan, 13:54, Chris Lee <lee.chri...@gmail.com> wrote:
> Hi Django gurus,
>
> I'm coding-up a failure tracking database, and came up with what I
> thought was a straightforward way to encode different searches into
> part-failures via a single URL pattern.
>
> In urls.py:
>
>  url(r'^part_failure_list(/project/(?P<project_id>\d+))?(/platform/(?
> P<platform_id>\d+))?(/hw_category/(?P<hw_category_id>\d+))?(/
> hw_subcategory/(?P<hw_subcategory_id>\d+))?....', #more stuff like
> this
>   'tracker.track.views.part_failure_list',
>         { 'nav_context': nav_context },
>         'part_failure_list'),
>     )
>
> Then in views.py, the function 'part_failure_list' looks for the
> existence of each of the keyword arguments and filters the query
> appropriately.

The canonical way to encode search arguments in an URL is to use the
querystring.

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

Offline

#3 Jan. 14, 2011 21:58:20

Chris L.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

URL -> query problem --- doesn't seem to be cache-related


Thanjs -- I'll give that a shot.

On Jan 14, 9:16 am, bruno desthuilliers
<bruno.desthuilli...@gmail.com> wrote:
> The canonical way to encode search arguments in an URL is to use the
> querystring.

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

Offline

  • Root
  • » Django
  • » URL -> query problem --- doesn't seem to be cache-related [RSS Feed]

Board footer

Moderator control

Enjoy the 21st of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support