Stacked Inline with many rows crashing in Django -
when trying navigate 'add presentation' in django admin, have wait ~1 minute response render. problem have ~500 slides in database , admin selecting slides 3 different times fill in menues. doing wrong model definitions, wouldn't expect amount of data bring server knees. visibility why experiencing issue way have defined relationships or using django admin?
class presentationtitle(models.model): title = models.charfield(max_length=255) order_number = models.integerfield(default=0) def __unicode__(self): return self.title class presentationuser(models.model): user = models.onetoonefield(user) authorized_modules = models.manytomanyfield(presentationtitle) class presentation(models.model): title = models.foreignkey(presentationtitle) user = models.foreignkey(presentationuser) presentation_date = models.datetimefield() def __unicode__(self): return self.title.title class slide(models.model): .... submodule = models.foreignkey(submodule) presentation = models.manytomanyfield(presentation, through='presentationslide') ... class meta: order_with_respect_to = 'submodule' ordering = ['order'] class presentationslide(models.model): presentation = models.foreignkey(presentation) slide = models.foreignkey(slide) slide_order = models.integerfield()
additionally, admin contains:
class presentationslideinline(admin.stackedinline): model = presentationslide class presentationadmin(admin.modeladmin): inlines = [presentationslideinline] admin.site.register(presentation, presentationadmin)
understandably, removing having presentationadmin admin.site.register
makes load responsively.
resolved issue -- there culprit @ play: django-debug-toolbar
after removing setup, admin panel presentation loads.
thanks on interest , support, wary of profiling add-ons when experience performance issues.
Comments
Post a Comment