Limit the choices for a ForeignKey

2020-09-27 Thread Marco Paradisi
Hi Everyone!

I need to filter the choices for a foreign key.

My Model has an attribute SEX that could be M or F, and two Foreign keys (
FATHER and MOTHER ), I want both filtered for sex.

How can I achieve it?

Thanks in advance

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFCTdWp0xJE_J-r%3DmHbHzVmeAsGvotFc1%3DyQBGuyEzjfiiVxTA%40mail.gmail.com.


Need help with inlineformset

2020-10-11 Thread Marco Paradisi
Hi everyone,

I have the following instruction:

forms.models.inlineformset_factory(Covata, Bird, fields=('rna_ucc', 
'sesso', 'nascita', 'anella', 'razza', 'mutazione', 'portatore',), 
can_delete=True, extra=1)

I want to initialize two fields of the model "Bird" to values taken from 
the form of the model "Covata".

anyone has any hint?

Thanks in advance

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/32896b20-0570-4d8f-b7e0-ab7b023d6d7fn%40googlegroups.com.


Re: Need help with inlineformset

2020-10-11 Thread Marco Paradisi
up

Il giorno domenica 11 ottobre 2020 alle 17:37:15 UTC+2 Marco Paradisi ha 
scritto:

> Hi everyone,
>
> I have the following instruction:
>
> forms.models.inlineformset_factory(Covata, Bird, fields=('rna_ucc', 
> 'sesso', 'nascita', 'anella', 'razza', 'mutazione', 'portatore',), 
> can_delete=True, extra=1)
>
> I want to initialize two fields of the model "Bird" to values taken from 
> the form of the model "Covata".
>
> anyone has any hint?
>
> Thanks in advance
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ebcd6c75-9529-4d3d-b479-ad854ee0792cn%40googlegroups.com.