Take a look here too...
http://code.djangoproject.com/wiki/PaginatorTag
--~--~-~--~~~---~--~~
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
wrote:
> > Hello,
> >
> > On nearly every page of the website I'm creating, I have a list of
> recent
> > articles in the sidebar that works as a complete archive. You can sort
> them
> > by newest/oldest, and page through the entire archive. The template cod
lliam Battersea"
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> On nearly every page of the website I'm creating, I have a list of recent
> articles in the sidebar that works as a complete archive. You can sort them
> by newest/oldest, and page through the entire archive. The template
entire archive.
> The template code for the pagination looks like this
>
> {% for page_number in page_list %}
>
> {% ifnotequal page_number current_page %}
>
> href="?p={{ page_number }}={{sort_order}}">{{page_number}}
>
> {% else %}
>
Hello,
On nearly every page of the website I'm creating, I have a list of recent
articles in the sidebar that works as a complete archive. You can sort them
by newest/oldest, and page through the entire archive. The template code for
the pagination looks like this
{% for page_number in page_list
okay, thanks. i think this will bring me to a comfortable solution.
--~--~-~--~~~---~--~~
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
On 2007-12-20 14:33:47 -0700, Julian <[EMAIL PROTECTED]> said:
>
> hi there,
>
> I do want to use pagination, but I don't know how to solve a problem.
>
> template-code:
>
> {% for p in paginator.page_range %}
> {{p}}
> {% endfor %}
>
>
different users aren't sharing the same
cached object (for things like search caching anyway). Thats not
using the built-in pagination though, so you might have to build your
own doing it just with ids.
--~--~-~--~~~---~--~~
You received this message because you
at is ran and takes about 50 seconds to
> completely and is pretty resource intensive. So what I have done is
> cached it into a key via cache.set('my_query_results', results, 300)
>
> The problem is that I also use pagination which results from this
> query. So when navigating to ?page=2~ it
I have a large query that is ran and takes about 50 seconds to
completely and is pretty resource intensive. So what I have done is
cached it into a key via cache.set('my_query_results', results, 300)
The problem is that I also use pagination which results from this
query. So when navigating
is '{% spaceless %}'. They say to put that in the template?
Thanks for any help
On Oct 19, 10:31 am, Rob Hudson <[EMAIL PROTECTED]> wrote:
> I don't think it's 100% to your specs but take a look at
> this:http://blog.localkinegrinds.com/2007/09/06/digg-style-pagination-in-d...
>
>
I don't think it's 100% to your specs but take a look at this:
http://blog.localkinegrinds.com/2007/09/06/digg-style-pagination-in-django/
It's close enough for tweaking to get you 95% of the way there
(maybe).
--~--~-~--~~~---~--~~
You received this message
Hello,
I'm using Pagination to display my results in a page. Everything is
working great. Let's say that a user does a search for a product and
1000 products get returned. I currently show 10 per page. So this is
how it would look
Previous 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,etc,,,99,100
Hello,
I'm using Pagination to display my results in a page. Everything is
working great. Let's say that a user does a search for a product and
1000 products get returned. I currently show 10 per page. So this is
how it would look
Previous 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,etc,,,99,100
Hello,
I'm using Pagination to display my results in a page. Everything is
working great. Let's say that a user does a search for a product and
1000 products get returned. I currently show 10 per page. So this is
how it would look
Previous 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,etc,,,99,100
On Oct 11, 5:43 pm, johnny <[EMAIL PROTECTED]> wrote:
> I was going over documentation on pagination and it mentions you can
> do it in two ways as follows:
>
> URL... ?page=x
> or
> (r'^objects/page(?P[0-9]+)/$', 'object_list', dict(info_dict))
>
> My question is, y
I was going over documentation on pagination and it mentions you can
do it in two ways as follows:
URL... ?page=x
or
(r'^objects/page(?P[0-9]+)/$', 'object_list', dict(info_dict))
My question is, you would use
"URL... ?page=x" for regular views?
"(r'^objects/page(?P[0-9]+)/$
I'd read that as well Collin and obviously totally forgotten about.
I'll give that a whirl!
On Aug 13, 11:54 pm, Collin Grady <[EMAIL PROTECTED]> wrote:
> As the documentation for object_list says, it will append _list to
> template_object_name, so you should actually be checking
>
request["filter"] is a session variable, that's why it works :)
On Aug 10, 5:25 am, "Kai Kuehne" <[EMAIL PROTECTED]> wrote:
> On 8/10/07, james_027 <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > hi,
>
> > > def list_filter(request):
> > > """Update session filter"""
> > > # request['filter']
hi,
On Aug 10, 11:25 am, "Kai Kuehne" <[EMAIL PROTECTED]> wrote:
> On 8/10/07, james_027 <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > hi,
>
> > > def list_filter(request):
> > > """Update session filter"""
> > > # request['filter'] is a hidden field. frankly, I don't know if
> > > this is
On 8/10/07, james_027 <[EMAIL PROTECTED]> wrote:
>
> hi,
>
> > def list_filter(request):
> > """Update session filter"""
> > # request['filter'] is a hidden field. frankly, I don't know if
> > this is really needed.
> > # I added it in case I add another form to the template
> >
hi,
> def list_filter(request):
> """Update session filter"""
> # request['filter'] is a hidden field. frankly, I don't know if
> this is really needed.
> # I added it in case I add another form to the template
> if request.method == 'POST' and request['filter'] == '1':
>
Hi,
On 8/10/07, james_027 <[EMAIL PROTECTED]> wrote:
> Hi Kai,
> Could you share you code how your save your filter in session?
Yes:
def list_filter(request):
"""Update session filter"""
# request['filter'] is a hidden field. frankly, I don't know if
this is really needed.
# I added
Hi Kai,
>
> Do you mean that the filter works on the first page but
> is lost when you go to another page? If yes:
> I save my filter in a session and filter on each page using
> that filter values (the values that were given to the input fields
> of the filter form). I don't know whether this
hi,
I am trying to put a page list for a search result. So far here's what
I've try by using the django.views.generic.list_detail.object_list and
the pagination tag (http://code.djangoproject.com/wiki/PaginatorTag)
and later found out that it won't meet my needs.
def search_employee(request
hi,
I am trying to do this http://code.djangoproject.com/wiki/PaginatorTag
I have two apps in my projects which are main and manning. I put the
pagination tag code in the main/templatetags/extra_tags.py file. And I
am trying to use the tag from a template in manning/templates/
results.htm
) and
> > Sortable Headers (from djangosnippets) with some changes too, newforms
> > to createsearchform and generic list.
> > Changes I had to do were necessary because each of those components -
> > sort, filter and pagination should
> > know about others parameters,
y "dictionary-like" object instance as its
> submitted data (request.GET and request.POST are both dictionary-like
> objects.)
>
> > I'm trying to
> > figure out how to paginate results from a search form, and I'm passing
> > GET values to the pagination
rm, and I'm passing
> GET values to the pagination view, instantiating an instance of the
> Form object with request.GET as an argument (instead of the typical
> request.POST). I can't find any mention of GET support in the
> documentation, is this something that will eventually be added o
Greetings,
Is it not possible to use Newforms with GET requests? I'm trying to
figure out how to paginate results from a search form, and I'm passing
GET values to the pagination view, instantiating an instance of the
Form object with request.GET as an argument (instead of the typical
> sort, filter and pagination should
> know about others parameters, eg. while sorting you shouldn't lost
> filter parameters etc.
Maybe you could put it at djangosnippets for others? I would be more
then happy to take a look at it :)
Przemek
--
AIKIDO TANREN DOJO - Poland - Warsaw - Mokotow
> I don't think there are pre-made components that will provide you with
> all of those things, and being somewhat new to django I can only point
> you to one bit of documentation and code that I found helpful for
> pagination:
>
> http://code.djangoproject.com/wiki/PaginatorT
On 7/23/07, Nis Jørgensen <[EMAIL PROTECTED]> wrote:
>
> Is there anything in your proposal that isn't solved by using something
> like
>
> MyModel.objects.order_by('some_field')
>
> for the queryset passed to the paginator?
This will reverse the order of objects, you do not want to show the
I don't think there are pre-made components that will provide you with
all of those things, and being somewhat new to django I can only point
you to one bit of documentation and code that I found helpful for
pagination:
http://code.djangoproject.com/wiki/PaginatorTag
Regards,
Syd
On Jul 23, 7
Hi!
I need to implement list (grid) with pagination, sorting and simple
search interface. I've looked at djangosnippets, generic list etc, but
so far I didn't find something that has all of these things. So my
question is if there are any ready components that allows to simply
create such form
Amit Upadhyay skrev:
> Hi,
>
> You are all aware of object pagination, search results, your photo on
> flickr, stories on reddit, all have a next page/previous page paradigm.
> Django makes it trivially easy to create such pages by providing object_list
> generic view. There
Hi,
You are all aware of object pagination, search results, your photo on
flickr, stories on reddit, all have a next page/previous page paradigm.
Django makes it trivially easy to create such pages by providing object_list
generic view. There are some problems with the current implementation
meters. I'd be happy if django would come up with a nice solution to that
problem.
I'd also be happier if django's pagination template context parameters didn't
pollute the template context so much. It'd be nice to stuff them all in a dict
called paginator:
{{paginator.next}}
etc.
But id
.
I like the clean URL of: /url/page2/
But I like how this works better in the template: /url/?page=2
Unless I'm missing something which I thought I might be.
Perhaps the pagination stuff could add support for building URLs for
you in either case and add "prev_url" and "next_url&
> I don't understand. If you're one /foo/bar/baz/page1/, then why can't
> you write as the link? It will work, is a
> well-formed URL and is independent of the prefix. Note that you must
> ensure your URLs are canonicalised if you use this system, though:
> always ending with a trailing slash,
> I don't understand. If you're one /foo/bar/baz/page1/, then why can't
> you write as the link? It will work, is a
> well-formed URL and is independent of the prefix. Note that you must
> ensure your URLs are canonicalised if you use this system, though:
> always ending with a trailing slash,
On Thu, 2007-06-21 at 21:10 +, Rob Hudson wrote:
> On Jun 21, 1:23 pm, Tyson Tate <[EMAIL PROTECTED]> wrote:
> > Look at "next" and "previous" context variables. You can do:
> >
> > Next
> >
> > and
> >
> > Previous
>
> Right, but it's the 'href="/url/..."' part that doesn't feel right to
>
ant to (a) re-use this template for other URLs (list
view by tag, list view by date, etc) or (b) decide later that I want /
url/ to be /foo/ in urls.py, then I have to remember to change the
template, which I don't trust myself to do.
I was kind of expecting to find in the pagination context v
Look at "next" and "previous" context variables. You can do:
Next
and
Previous
to get what you want, as long as you've set up the URL regexes
properly in urls.py. You'll want to surround each of the above with
an if block to check and see if you do, indeed, have a next or
previous page
I've set up a list view that I want paginated and I'm using the
list_detail generic view. I was thinking that I would prefer the /url/
page2/ URL over /url?page=2 so I set that up. The problem is, in my
template where I want to display the prev/next links there's no way
that I see to avoid hard
Thanks for your suggestion, but the problem was in the generated link
for the pagination: they pointed to '?page=X/' instead of '?page=X'. I
removed the ending slash and everything now works fine!
--~--~-~--~~~---~--~~
You received this message because you
I am sorry for the typo.
(r'^list/$', 'django.views.generic.list_detail.object_list', entry_dict),
should be: (r'^list/$', 'django.views.generic.list_detail.object_list',
myObj_dict),
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
I think a dict contain queryset and extra info should be passed in url
patterns as third parameter.
maybe this will work in your urls.py
myObj_dict = {
'queryset': myObj.objects.all(),
'paginate_by': 10,
}
(r'^list/$', 'django.views.generic.list_detail.object_list', entry_dict),
Anybody has any suggestion?
--~--~-~--~~~---~--~~
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
Hi all!
I'm a new python and django user, and this is my first post in this
group!
I'm writing a small app that shows a list of objects after a
successfull login.
I made a custom view to handle authentication and at the same time to
keep the semplicity of the generic view
t up the query set in the template using
> "slice". For example:
>
> {% for object in object_list|slice:"1:6" %}area one {% endfor %}
> {% for object in object_list|slice:"6:9" %}area two {% endfor %}
> etc
>
> My problem is that this is not work
%}area one {% endfor %}
{% for object in object_list|slice:"6:9" %}area two {% endfor %}
etc
My problem is that this is not working with pagination correctly when
the pagination returns less than the initial slice ( in this case 6). I
get the following errors (see below).
Can anybody suggest
I have 301220 records in a simple(3 cols) mysql table and in the Admin
interface the pagination is too slow, even with only 10 records per
page. There are any reason for this?
Curious, is when I click in a visited page is fast.
Thanks,
Nuno Mariz
Thanks, this seems to work, now I just have to change the paginator.py
template tag to accept a parameter (as the extra_context info doesn't
seem to be available to it)
-Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Personally, I think you're overthinking it, and only mapping the
starting point for each topic is the appropriate (and expected)
behavior.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
Thanks for the explanation Rajesh.
On Dec 4, 2:31 pm, "RajeshD" <[EMAIL PROTECTED]> wrote:
> On Dec 3, 8:36 pm, "Silas" <[EMAIL PROTECTED]> wrote:
>
> > I have a problem with generic.list_detail.object_list, a limiting
> > queryset, and pagi
On Dec 3, 8:36 pm, "Silas" <[EMAIL PROTECTED]> wrote:
> I have a problem with generic.list_detail.object_list, a limiting
> queryset, and pagination variables.
>
> For some reason when I use the code below, results are restricted to
> the sliced 100, but all the pa
I have a problem with generic.list_detail.object_list, a limiting
queryset, and pagination variables.
For some reason when I use the code below, results are restricted to
the sliced 100, but all the pagination variables show results as if the
slice wasn't there.
Example:
{{ pages }} = 12
That was supposed to go into a separate topic.. sorry!
--~--~-~--~~~---~--~~
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
holy ... , how stupid.
but it led not to the solution, which is:
TMergeDoc().by_categories()
I had to instantiate the object, of course.
Now there are some paginator problems I have to analyze.
thank you very much so far!
robert
--~--~-~--~~~---~--~~
You
On 11/16/06, soundseeker <[EMAIL PROTECTED]> wrote:
> I'm desperately searching for a solution as described here (paginator +
> costom sql):
In the example you've posted, the method name is 'by_categories', but
you seem to be using 'by_category' to execute it. A method named
'by_categories' will
hello,
I'm desperately searching for a solution as described here (paginator +
costom sql):
http://groups.google.com/group/django-users/browse_frm/thread/1aa04d3ab8fc9203/ab1384a82c9d5508#ab1384a82c9d5508
and here:
[EMAIL PROTECTED] wrote:
> Specifically:
>
> unsupported operand type(s) for -: 'str' an
Oh... I've forgot to cast a string to an int :-). The line:
int(request.GET.get('page', '1'))
In fact you should also check for errors here because user can submit
something with "page=blah" and it
Sorry, I meant:
unsupported operand type(s) for -: 'str' and 'int'
[EMAIL PROTECTED] wrote:
> Specifically:
>
> unsupported operand type(s) for -: 'str' an
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Ivan: Thanks so much for your quick reply. One more question - how
would I define the page in the URL... ?page=x throws errors at me
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
Specifically:
unsupported operand type(s) for -: 'str' an
--~--~-~--~~~---~--~~
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
[EMAIL PROTECTED] wrote:
> Hey,
>
> I was just wondering if someone could help me out. I want to paginate
> some views, but they are not generic. This is one of the views I want
> to paginate:
>
> def category_list(request):
> categories = Category.objects.order_by('name')
>
>
Hey,
I was just wondering if someone could help me out. I want to paginate
some views, but they are not generic. This is one of the views I want
to paginate:
def category_list(request):
categories = Category.objects.order_by('name')
return
Gnissem wrote:
> I am using generic views to produce a paginated specimen list. In the
> list, you can click on a specimen to get the generic view detail.
> After viewing the detail, the user will likely want to go back to the
> specimen list, on the page where the link came from. Pressing the
I am using generic views to produce a paginated specimen list. In the
list, you can click on a specimen to get the generic view detail.
After viewing the detail, the user will likely want to go back to the
specimen list, on the page where the link came from. Pressing the back
button works, but
or tips on style would be appreciated.
> >
> > --Jon
>
> Your code looks perfectly legible to me (disclaimer: I'm a C++
> programmer!). But...
>
> Is there a pressingly good reason you're not using generic views for
> your "list" pages? Pagination is exceptionally simp
On Tue, Aug 15, 2006 at 12:47:27PM +0100, Jon Atkinson wrote:
>
> Hi,
>
> One of the things which I love about django is the lack of code I have
> to write. I recently refactored some of my views from approximately 30
> lines of code down to just two, but I'm worried about the readablity
> of
ndex.html', {'title': "Planet X",
> 'items': paginator.get_page(page)})
[snip]
> Any ideas or tips on style would be appreciated.
>
> --Jon
Your code looks perfectly legible to me (disclaimer: I'm a C++
programmer!). But...
Is there a pressingly good reason you're not using generic
On 8/15/06, Jon Atkinson <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> One of the things which I love about django is the lack of code I have
> to write. I recently refactored some of my views from approximately 30
> lines of code down to just two, but I'm worried about the readablity
> of my code.
>
>
Hi,
One of the things which I love about django is the lack of code I have
to write. I recently refactored some of my views from approximately 30
lines of code down to just two, but I'm worried about the readablity
of my code.
For the simplest view, I think my code looks fine, and it's pretty
Excuse me for multiple posts.
I've sent these post from Thurs, Aug 10 2006 11:08 am, but Google has
published it only at Thurs, Aug 10 2006 3:32 pm. every time giving me
fake message about "momentarily" publishing of my posts.
--~--~-~--~~~---~--~~
You received
to URL:
http://127.0.0.1:8000/objects/search_results/?q=sometext===Search
What is the "x" and "y"?
Can I use it for pagination? Please give me a little example of usage.
--~--~-~--~~~---~--~~
You received this message because you are subs
submit.x and submit.y are the coordinates of where the user clicked the
submit image.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
jrs wrote:
> submit.x and submit.y are the coordinates of where the user clicked the
> submit image.
Thanks, jrs.
Thus, avoiding "http://127.0.0.1:8000/tasks/search_results/?q=1=Search
Do you know how to include ih such URL the "offset" and "limit"
parameters?
It is needed by a paginator
URL:http://127.0.0.1:8000/objects/search_results/?q=sometext===Search
What is the "x" and "y"? Can I use it for pagination? Please give me a little
example of usage.
___
Join Excite! - http://www.excite.com
The most personalized p
On 7/22/06, Maciej Bliziñski <[EMAIL PROTECTED]> wrote:
>
> The Django documentation refers to the pagination:
> http://www.djangoproject.com/documentation/generic_views/#notes-on-pagination
>
> And suggests following pagination scheme:
>
> ^objects/ -- object list,
The Django documentation refers to the pagination:
http://www.djangoproject.com/documentation/generic_views/#notes-on-pagination
And suggests following pagination scheme:
^objects/ -- object list, first page
^objects/page2/ -- second page
^objects/page3/ -- third page, and so on
Let's say I'm
On 6/22/06, Patrick J. Anderson <[EMAIL PROTECTED]> wrote:
>
> Yes, that's true, but what would be the easiest way to reuse the
> pagination "widget" (if you can call it that) instead of writing my
> own? Sorry, if I haven't explained it in more detail
I don't
Yes, that's true, but what would be the easiest way to reuse the
pagination "widget" (if you can call it that) instead of writing my
own? Sorry, if I haven't explained it in more detail
--~--~-~--~~~---~--~~
You received this message because you are
On 6/23/06, Patrick J. Anderson <[EMAIL PROTECTED]> wrote:
>
> What is the best way to reuse admin pagination in a generic object_list
> view template?
What part do you want to reuse? Because object_list already has the
paginate_by a
What is the best way to reuse admin pagination in a generic object_list
view template?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dj
The answer to the second part of my question *was* very obvious... I
was editing the wrong copy of the source file. I needed to change the
copy installed under my Python directory, not the one in the Django
directory.
--~--~-~--~~~---~--~~
You received this
Hello,
I've just started looking at Django, it's certainly looking like a very
good choice for the sort of projects I'll be doing in the near future.
Just now I've been looking at pagination and have a question:
I'm using the generic view "list_detail" to view a list of result
301 - 388 of 388 matches
Mail list logo