Re: problem with a formset from model

2010-08-11 Thread refreegrata
ok, i understand.

On 11 ago, 08:00, Nuno Maltez  wrote:
> This happens to me as well (also with 1.2.1). Seems like a bug with
> _queryset vs queryset on BaseModelFormSet.
>
> Maybe you could submit a ticket tohttp://code.djangoproject.com/query
>
> Nuno
>
> On Tue, Aug 10, 2010 at 9:21 PM, refreegrata  wrote:
> > Hello list. I have a problem. I'm a newbie in Django using his first
> > formset.
>
> > I have this:
> > 
> > class BaseFormFormato_habilitar(BaseModelFormSet):
> >    def __init__(self, *args, **kwargs):
> >        super(BaseFormFormato_habilitar, self).__init__(*args,
> > **kwargs)
> >        self.queryset = Formato.objects.filter(actividad=True)
>
> > FormFormato_habilitar = modelformset_factory(Formato, max_num=0,
> > formset=BaseFormFormato_habilitar)
> > 
>
> > I want a formset with forms filtered for
> > "Formato.objects.filter(actividad=True)", however, the formset always
> > returns all the rows in the table. My alternatively subclass
> > "BaseFormFormato_habilitar" don't works. What am I doing wrong?
> > the problem is solved if i do "FormFormato_habilitar(queryset =
> > Formato.objects.filter(actividad=True))" in a view, but i prefer solve
> > the problem with a subclass in the "forms.py".
>
> > thanks for read, and sorry for my poor english
>
> > P.D.: I use Django 1.2.1
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: problem with a formset from model

2010-08-11 Thread Nuno Maltez
This happens to me as well (also with 1.2.1). Seems like a bug with
_queryset vs queryset on BaseModelFormSet.

Maybe you could submit a ticket to http://code.djangoproject.com/query

Nuno

On Tue, Aug 10, 2010 at 9:21 PM, refreegrata  wrote:
> Hello list. I have a problem. I'm a newbie in Django using his first
> formset.
>
> I have this:
> 
> class BaseFormFormato_habilitar(BaseModelFormSet):
>    def __init__(self, *args, **kwargs):
>        super(BaseFormFormato_habilitar, self).__init__(*args,
> **kwargs)
>        self.queryset = Formato.objects.filter(actividad=True)
>
> FormFormato_habilitar = modelformset_factory(Formato, max_num=0,
> formset=BaseFormFormato_habilitar)
> 
>
> I want a formset with forms filtered for
> "Formato.objects.filter(actividad=True)", however, the formset always
> returns all the rows in the table. My alternatively subclass
> "BaseFormFormato_habilitar" don't works. What am I doing wrong?
> the problem is solved if i do "FormFormato_habilitar(queryset =
> Formato.objects.filter(actividad=True))" in a view, but i prefer solve
> the problem with a subclass in the "forms.py".
>
> thanks for read, and sorry for my poor english
>
> P.D.: I use Django 1.2.1
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



problem with a formset from model

2010-08-10 Thread refreegrata
Hello list. I have a problem. I'm a newbie in Django using his first
formset.

I have this:

class BaseFormFormato_habilitar(BaseModelFormSet):
def __init__(self, *args, **kwargs):
super(BaseFormFormato_habilitar, self).__init__(*args,
**kwargs)
self.queryset = Formato.objects.filter(actividad=True)

FormFormato_habilitar = modelformset_factory(Formato, max_num=0,
formset=BaseFormFormato_habilitar)


I want a formset with forms filtered for
"Formato.objects.filter(actividad=True)", however, the formset always
returns all the rows in the table. My alternatively subclass
"BaseFormFormato_habilitar" don't works. What am I doing wrong?
the problem is solved if i do "FormFormato_habilitar(queryset =
Formato.objects.filter(actividad=True))" in a view, but i prefer solve
the problem with a subclass in the "forms.py".

thanks for read, and sorry for my poor english

P.D.: I use Django 1.2.1

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.