ofertasinlineformset = inlineformset_factory(Assinatura, Ofertas,
form=OfertasEditForm,
max_num=ass_ativa.total_produtos_oferta,
extra=ass_ativa.total_produtos_oferta,
exclude=(),
can_delete=False)
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')

--
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...@googlegroups.com.
To post to this group, send email to django...@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.
For more options, visit https://groups.google.com/d/optout.
<form action="{% url 'desk_ofertas' %}" method="post" id="form_ofertas">
{% csrf_token %}
{{ formset.management_form }}
<div class="form-group">
<div class="table-responsive">
{% crispy formset helper %}
</div>
</div>
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/051dc2ae-f02d-41b4-be4b-e54a3553d04b%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/ya5E5UQtEQU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@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/CAF1jwZFMQC6JiRY_YrGRbz_%3DwgtBR%2BbAcZO7Lx0sT7GgY67R_Q%40mail.gmail.com.