Re: Question about m2m and forms

2017-04-02 Thread Carlo Ascani
Il giorno sabato 18 febbraio 2017 11:02:25 UTC+1, Carlo Ascani ha scritto: > > > > Il giorno venerdì 17 febbraio 2017 20:09:15 UTC+1, Matthew Pava ha scritto: >> >> Hi Carlos, >> You probably want to create a new widget and override its >> label_from_instance method. >> >> class BModelMultiple

Re: Question about m2m and forms

2017-02-18 Thread Carlo Ascani
Il giorno venerdì 17 febbraio 2017 20:09:15 UTC+1, Matthew Pava ha scritto: > > Hi Carlos, > You probably want to create a new widget and override its > label_from_instance method. > > class BModelMultipleChoiceField(forms.ModelMultipleChoiceField): > def label_from_instance(self, obj

RE: Question about m2m and forms

2017-02-17 Thread Matthew Pava
'))) -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Carlo Ascani Sent: Friday, February 17, 2017 12:14 PM To: django-users@googlegroups.com Subject: Question about m2m and forms Hi all, I have

Question about m2m and forms

2017-02-17 Thread Carlo Ascani
Hi all, I have a model A with a m2m to B: -- class A(models.Model): to_b = models.ManyToManyField(B) class B(models.Model): name = models.CharField(max_length=100) -- In a view, I am listing A objects and I