Hi django-pros,
I'm nearly finishing my django web-app and I've got some questions:

1. I'm using pagination: from django.core.paginator import Paginator,
and then handling it all by myself, I do not want to use any other
modules or snipetts or so on. I'm using it to paginate the result of a
query, the problem was when I went to the second page the query was
lost and it displayed a blank page. I fixed it by storing the queryset
resulting by the first query in the session variable of the user, so
for the next pages (which aren't called by POST again) it uses the
existing queryset from session. I read something that it would be more
efficient to store only the query and doing pickle?? I don't know how
to do that, I've been looking in the docs and other posts but no clear
explanation. So what I really want to know: which is the best way of
handling this problem?? Isn't the way I solved it(using session)
causing some overhead?

2. It's related to the query in the first point. The user introduces
some keywords and selects some radiobuttons and some select boxes,
then he clicks on search. The results are displayed but all the
keywords and so on aren't. How should I handle this? I mean if the
user just wants to adjust some parameters from the search he needs to
introduce the whole thing again. Is storing it in session a solution?

With the 2 first points there is another problem, when the user leaves
this view (by clicking some of the serch results or another link on
the sidebar) I should delete the useless stuff for other pages stored
in session. Now I have to add a clear, flush, or delete session
sentence at the beginning of every view which is accesible from this
one?? Is there no way of saying if this guy leaves this view delete
this session data. In anycase if I delete the whole session wouldn't
be the user forced to log out?(as I can see from the docs it doesn't
looks like, but just to ensure).

3.A different performance thing: I'm having all my code now in django-
html and some css. By deleting an item I want to display a
confirmation like: Are you sure yo want to proceed? with the typical
yes/no buttons, I have done these by making the whole thing hidden in
the template: <input type="{{ button_type }}" ...> passing from the
view 'button_type' = "hidden", and when the user clicks delete for the
first time making it visible, from the view 'button_type' = "submit".
It works well and I do not want to integrate any javascript if it's
not strictly neccesary. Is this the best way to handle it? I mean
there is an extra request which wouldn't have been done by using js.
Thats a thing thats been bothering me since I'm using django (nearly
half a year now), for every click the user does you send a request,
isn't that going to cause some overhead on the server?(in production
pages I'm a noob, sorry).

Thanks in advance and sorry for the long post I just wanted to point
out everything as clear as possible ;)

Regards,
TDG

--~--~---------~--~----~------------~-------~--~----~
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 at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to