#34415 closed Uncategorized (invalid)

Django Admin List View Loads Slow When List Editable is Populated with Django Money Field

Reported by: Jameson Parker Owned by: nobody
Component: Uncategorized Version: 4.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm utilizing the django-money package in my model like so.

class MyModel(models.Model):

price_low = MoneyField(
        max_digits=10,
        default=0,
        decimal_places=2,
        null=True,
        blank=True,
        default_currency="USD",
    )
    price_medium = MoneyField(
        max_digits=10,
        default=0,
        decimal_places=2,
        null=True,
        blank=True,
        default_currency="USD",
    )
    price_high = MoneyField(
        max_digits=10,
        default=0,
        decimal_places=2,
        null=True,
        blank=True,
        default_currency="USD",
    )

And then loading the models in an Admin List with these fields set as editable like so.

class IssueAdmin(admin.ModelAdmin):
    
    list_editable = (
            "price_low",
            "price_medium",
            "price_high"
        )

     list_per_page = 20

With this setup and 400k records in the database it takes approx. 6 seconds to load the page.

I'm limiting the results returned to 20 just to get this page to return in somewhat of a respectable time frame.

If I remove the money fields from list_editable and put different fields that are basic inputs or even autocompletes the page loads in approx 1.5 seconds.

I'm hopeful that I'm just doing something incorrectly. Any feedback would be appreciated.

Thank you!

Change History (1)

comment:1 by Tim Graham, 20 months ago

Resolution: invalid
Status: newclosed

See TicketClosingReasons/UseSupportChannels for ways to get help debugging your issue.

Note: See TracTickets for help on using tickets.
Back to Top