Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimise the rendering process for ModelAdmin's IndexView #11

Open
ababic opened this issue Feb 20, 2017 · 0 comments
Open

Optimise the rendering process for ModelAdmin's IndexView #11

ababic opened this issue Feb 20, 2017 · 0 comments

Comments

@ababic
Copy link

ababic commented Feb 20, 2017

Currently, when rendering a row of items in IndexView, the following things happen:

  1. In templates/modeladmin/index.html the {% result_list %} tag is called
  2. result_list does some working out, then renders a template templates/modeladmin/includes/result_list.html
  3. The above template cycles through the results created by result_list and calls another tag {% result_row_display %} for each row.
  4. {% result_row_display %} renders another template (templates/modeladmin/result_row.html), which cycles through each of the column values for that row and calls another template tag {% result_row_value_display %} to render each of those (In a listing of 100 items with 5 columns each result_row_value_display would be called 500 times).
  5. result_row_value_display renders a template (templates/modeladmin/result_row_value.html) to show the column value, and also conditionally includes another template (templates/modeladmin/includes/button.html) if buttons need to be included.

I would like to make it so that {% result_row_display %} in step 4 does everything it needs to do, and can just render everything to templates/modeladmin/result_row.html, without having to call upon more tag calls or templates.

I've already managed this once in another branch (https://github.com/rkhleics/wagtail/blob/modeladmin/style-tweaks/wagtail/contrib/modeladmin/templatetags/modeladmin_tags.py), but it was part of a PR that ended up going way out of scope and I cancelled in the end, because it never would have been merged.

Hopefully now, with a clearer brief, I can recreate the changes in their own PR and it'll be possible to review them on their own?

@laymonage laymonage transferred this issue from wagtail/wagtail Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants