Mario Gonzalez said the following:
> That's what I want to solve, give the opportunity to the programmer
> to change the queryset easily when a form_for_model is needed but you
> don't need the default queryset.
I understand what you want, and you can do it with a formfield_callback!
You do /n
On 27 sep, 18:36, Collin Grady <[EMAIL PROTECTED]> wrote:
>
> Actually, you don't - I just checked the formfield method of
> ManyToManyField, and you can pass the queryset directly to that, so it
> will use that when it generates the field instead of whatever it would
> normally default to.
>
Ye
Mario Gonzalez said the following:
> I haven't seen this before, I'll try it but IMVHO it seems a hack
> because you've got to generate a field and _then_ change the queryset.
> I think the queryset must be defined once and not after.
Actually, you don't - I just checked the formfield method of
Mario Gonzalez said the following:
> I should have to write the all callback and I think that's not what
> I want. My proposal is if you've got a special queryset, just pass it
> trough form_for_model() method only. Then you haven't got to re-write
> all over again.
Rewrite what all over? All y
On 27 sep, 18:03, Collin Grady <[EMAIL PROTECTED]> wrote:
> Mario Gonzalez said the following:
>
> > I should have to write the all callback and I think that's not what
> > I want. My proposal is if you've got a special queryset, just pass it
> > trough form_for_model() method only. Then you hav
Mario Gonzalez said the following:
> In my DB I've got lot of users, each one with different groups and
> permissions, and I don't want to show them in my form. So, I want to
> pass a parameter in form_for_model() and I wrote a patch for that:
Just make your own formfield_callback, that's what it
On 27 sep, 16:25, Collin Grady <[EMAIL PROTECTED]> wrote:
> Mario Gonzalez said the following:
>
> > In my DB I've got lot of users, each one with different groups and
> > permissions, and I don't want to show them in my form. So, I want to
> > pass a parameter in form_for_model() and I wrote a pa
Hello:
I usually show forms using form_for_model(), however there's
something I think is missing. My model is something like:
class TransferFile(models.Model):
file = models.FileField(upload_to="/some/path/in/my/system/")
owner = models.ForeignKey(User, db_column="owner", db_ind