Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6054881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:12:10+00:00 2026-05-23T08:12:10+00:00

I have the following variable in my admin: class ModelAdmin(admin.ModelAdmin): qs = QuerySet …

  • 0

I have the following variable in my admin:

class ModelAdmin(admin.ModelAdmin):
    qs = QuerySet
    ...

and the following def within the admin:

def changelist_view(self, request, extra_context=None):
    from django.contrib.admin.views.main import ChangeList
    cl = ChangeList(request, self.model, list(self.list_display), 
                    self.list_display_links, self.list_filter, 
                    self.date_hierarchy, self.search_fields,  
                    self.list_select_related, 
                    self.list_per_page, 
                    self.list_editable, 
                    self) 
    ModelAdmin.qs = cl.get_query_set()
    return super(ModelAdmin, self).changelist_view(request, extra_context=extra_context)

I’m using this to generate reports with geraldo reporting as follows:

def groupreport(self, request, extra_context=None):
    resp = HttpResponse(mimetype='application/pdf')
    report = MOdelGroupReport(queryset=ModelAdmin.qs.extra(order_by = ['project_string','code','-pub_date']))
    report.generate_by(PDFGenerator, filename=resp)
    return resp

It works well on my development machine however when I deploy it on a UWSGI server the report prints the entire queryset rather than the current filtered queryset. Is there a better way of doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:12:10+00:00Added an answer on May 23, 2026 at 8:12 am

    I ended up using the actions feature of the admin and used the queryset passed into that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have the following nvarchar variable - BTA200, how can I extract just
Let's say I have the following simple table variable: declare @databases table ( DatabaseID
Alright, I have been doing the following (variable names have been changed): FileInputStream fis
I have the following string in the smarty (php templating system) variable $test: <img
What I have is following: <xsl:variable name=myvar select=.//spss:category[((not @varName) or @varName=$colVarName) and @text=$series]/spss:cell/@text/> What
I have defined the following variable: myVar=true now I'd like to run something along
I have the following scenario where i invest variable amount of principal every month,
I have the following code to pass variable from example1.html to example2.html , what
I have the following code shown below to allow the admin to add a
I have the following variable definition: @monday = (Time.now).at_beginning_of_week I use that in different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.