That's the problem, I don't know how to cache the queryset.
But for what it's worth, here's something i tried. I tried to take
advantage of the default caching of querysets, but that doesn't work
here.
mediaform = CustomMediaForm
# get the initial queryset fo a large table
qs=mediaform.base_fields['somefield'].queryset
forms = []
for i in requested_forms:
form=mediaform(data, auto_id="some_generated_id")
# assign the queryset to the choices
form.base_fields['somefield'].queryset = qs
forms.append(form)
And yes, I know it's hackish and not nice at all ;-)
cheers, sean
On Aug 22, 3:40 pm, RajeshD <[EMAIL PROTECTED]> wrote:
> On Aug 22, 8:08 am, sean <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> > I'm running into a performance problem with some pages i created. The
> > page has multiple forms, which are all the same, with the exception of
> > the initial data (it's a kind of batch insert functionality), but all
> > foreign keys and such are identical (and as such lead to the same
> > querysets, that populate the select fields).
>
> > the view code looks like this:
>
> The form code snippet doesn't show how you are caching the querysets.
> Consider pasting in your form class in its entirety so we can help
> you.
>
> -Rajesh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---