It's a simple HTML with these code: <div class="col-md4"> {{ formset helper }} </div>
T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh <https://fedoraproject.org/wiki/User:Fellipeh>* *Blog: *http:www.fellipeh.eti.br *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* *Twitter: @fh_bash* On Mon, Oct 19, 2015 at 6:29 PM, Mark Steadman <m...@steadman.io> wrote: > Can you provide the HTML you're using to render the formset view? > > > On Thursday, 15 October 2015 21:43:29 UTC+1, Fellipe Henrique wrote: >> >> Hello, >> >> I try to use "inlineformset", but for each record (each form) django >> create and run 20 selects (same select), I take the one snapshot [1]. >> >> Can anyone explain to me, why django do that? How can I fix these? It's >> take a some amout of time!!! >> >> Here is my view: >> >> ofertasinlineformset = inlineformset_factory(Assinatura, Ofertas, >> form=OfertasEditForm, >> >> max_num=ass_ativa.total_produtos_oferta, >> >> extra=ass_ativa.total_produtos_oferta, >> exclude=(), >> can_delete=False) >> >> form: >> >> class OfertasEditForm(ModelForm): >> class Meta: >> model = Ofertas >> exclude = [] >> >> def __init__(self, *args, **kwargs): >> u = kwargs.pop('usuario', None) >> super(OfertasEditForm, self).__init__(*args, **kwargs) >> self.fields['produto'].queryset = >> Produto.objects.filter(usuario_id=u).filter(status='A') >> >> >> Debug [1]: >> >> [image: Inline image 1] >> >> >> T.·.F.·.A.·. S+F >> *Fellipe Henrique P. Soares* >> >> e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ >> 's/(.)/chr(ord($1)-2*3)/ge' >> *Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh >> <https://fedoraproject.org/wiki/User:Fellipeh>* >> *Blog: *http:www.fellipeh.eti.br >> *GitHub: https://github.com/fellipeh <https://github.com/fellipeh>* >> *Twitter: @fh_bash* >> >> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/d4ff4f3d-6c8c-4bda-bd4a-971639febe71%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/d4ff4f3d-6c8c-4bda-bd4a-971639febe71%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF1jwZFDNYuE9EGsfoudTeTtRjbzNZ4n%2BnoW_dudZvydoQRTZQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.