Django Select Filter Widget

2021-05-18 Thread sebasti...@gmail.com
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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9debba1c-e5ea-44be-90a4-32c7e71228adn%40googlegroups.com.


Re: Django select filter

2017-09-12 Thread Bernd Wechner
Here are a pile of options:

https://djangopackages.org/grids/g/auto-complete/

and the winner it seems is:

https://djangopackages.org/packages/p/django-autocomplete-light/

Cheers,

Bernd.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/486292c1-1c46-4e9b-9c68-9a966ee343f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django select filter

2017-09-12 Thread sum abiut
I am trying to understand this code. Can someone explain where the
current_org came from

code taken from stackoverflow


{% for org in organisation %}
   
   {{org.name|capfirst}}
   {% endfor %}



cheers


On Wed, Sep 13, 2017 at 12:14 PM, ADEWALE ADISA 
wrote:

> you can make it interesting by using ajax to post the selected month to
> your view which u ve already written to accept the month variable. use the
> variable to filter the necessary queryset in your view, then return the
> response in json format. you can now collect it from your ajax response,
> use javascript to dynamically update your table.
> On Sep 13, 2017 12:43 AM, "sum abiut"  wrote:
>
>> Hi,
>> I am working on an app which has a dropdown/select option which contain
>> months of the year. What i want to accomplished is when the user click on
>> the drop down and select a particular  month of the year the app should
>> display a table filter by that particular   selected month.
>>
>>
>> Please point me to the right direction to get me started.
>>
>> cheer
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CAPCf-y5JQoekZfW%3DymeNJHyXQj6ExJHweENW2gAf
>> QiBhnXg6%3DA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAMGzuy_crJPMm%2Bh8DyhGHAc5AqtseM6e5PMp55BYyb
> fP1X7L6w%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCf-y7KrVdJ4kYXrjq7d6ofGnvOw9s-RakqymDOJe4n%2BQsR0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django select filter

2017-09-12 Thread ADEWALE ADISA
you can make it interesting by using ajax to post the selected month to
your view which u ve already written to accept the month variable. use the
variable to filter the necessary queryset in your view, then return the
response in json format. you can now collect it from your ajax response,
use javascript to dynamically update your table.
On Sep 13, 2017 12:43 AM, "sum abiut"  wrote:

> Hi,
> I am working on an app which has a dropdown/select option which contain
> months of the year. What i want to accomplished is when the user click on
> the drop down and select a particular  month of the year the app should
> display a table filter by that particular   selected month.
>
>
> Please point me to the right direction to get me started.
>
> cheer
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAPCf-y5JQoekZfW%3DymeNJHyXQj6ExJHweENW2gAfQiBh
> nXg6%3DA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMGzuy_crJPMm%2Bh8DyhGHAc5AqtseM6e5PMp55BYybfP1X7L6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django select filter

2017-09-12 Thread Oladipupo Elegbede
I think the filtering should be done in your view.
You pass the value of the selected month to the view as a post item.

Then do a query based on the view.

On Sep 12, 2017 7:43 PM, "sum abiut"  wrote:

> Hi,
> I am working on an app which has a dropdown/select option which contain
> months of the year. What i want to accomplished is when the user click on
> the drop down and select a particular  month of the year the app should
> display a table filter by that particular   selected month.
>
>
> Please point me to the right direction to get me started.
>
> cheer
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAPCf-y5JQoekZfW%3DymeNJHyXQj6ExJHweENW2gAfQiBh
> nXg6%3DA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHjgLX6wL8qPMiZisWMDOEkr3G5BnvfgRmWi0S2%3DGtwXGV5tAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django select filter

2017-09-12 Thread sum abiut
Hi,
I am working on an app which has a dropdown/select option which contain
months of the year. What i want to accomplished is when the user click on
the drop down and select a particular  month of the year the app should
display a table filter by that particular   selected month.


Please point me to the right direction to get me started.

cheer

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPCf-y5JQoekZfW%3DymeNJHyXQj6ExJHweENW2gAfQiBhnXg6%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.