In one of the models overview panel, after I filter the items by month, I have to select them all and then create a document with information regarding them (kind of like a monthly report). This is a problem when one month has more than 100 items as Django paginates the filtering results.
Is there a way to increase the number of items shown from 100 to 400 or select all the items from the filtering result?
Selecting all the items from one page, creating a document, going to the next, creating another, etc, then merging the documents isn't an option.
django-inline-actions provides a handy templatetag render_inline_action_fields , which adds these information as hidden fields to a form. As the action does not know that an intermediate form is used, we have to include some special handling.
Proxy models allow us to change the Python behavior of a model without changing the database. vehicles/models.py. from django.db import models. class Car(models.Model): vin = models.CharField(max_length=17)
You can customize the Django admin to do almost anything you want. In this tutorial, you learned how to: Register your object models with the Django admin. Add attributes as columns in the change list.
The through attribute/field is the way you customize the intermediary table, the one that Django creates itself, that one is what the through field is changing.
See http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_per_page
In your ModelAdmin definition, set list_per_page
:
class MyModelAdmin(admin.ModelAdmin):
list_per_page = 400
I believe you can also add the all
GET parameter to your query (ie, add ?all
to the end of your url), but that only works if you have less than 200 items, and this limit is hardcoded in the admin. Therefore it's only useful if you have more than list_per_page
(100) and less than 200 items, but the admin will offer you a link for this anyway when this is the case.
If you're talking about admin, see this.
ModelAdmin.list_per_page
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With