Hi, i need i new widget for Select fields.
I have in my models 2 classes:
class address(models.Model):
lastname = models.CharField(max_length=255, default="", )
firstname = models.CharField(max_length=255, default="", blank=True,
null=True)
and a second class:
class emailaddress(models.Model):
address_link = models.ForeignKey(Address, on_delete=models.CASCADE,
blank=False, null=False, default=None,) Now i want define
in my forms.py:
class Emailsform(forms.ModelForm):
class Meta:
model = emailaddress fields = ["address_link"]
widgets = {'address_link':multiselectfilterview()}
Now in frontend i want a normal multiselect field. When user click on this
input field then a modal open with a Adress view. This Adress view should
get all adresses with ajax. In this Adress View Paging and Filtering must
be possible. In this modal in left column checkboxes are shown and user can
select multiple adresses with this checkbox. In Modal View there must be a
submit button and when user click on submit all adresses which is checked
is submit to original multiselect field. This widget must be modular so i
can use it for another foreingkey relations.
Have anyone a idea how i can implement such a widget or have already done
this?
Regards
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/9debba1c-e5ea-44be-90a4-32c7e71228adn%40googlegroups.com.