Django 0.97 filter for admin dashboard

2023-09-04 Thread Israr Hussain Rao
Hello Django developer, I am working on very old django version 0.97 because the system was developed long time ago and i am creating a new application by using new version, because updating from 0.97 to 4.1 is i don't know how much it is practically possible. In short, I need to create a filter

Re: Django ORM: move filter after annotate subquery

2023-04-28 Thread Aivan Fouren
I found a way to achieve the results I want: applying a filter, ` date_created__lte` in this example, outside of annotated query: sub = Model.objects.all() \ .annotate(ord=Window( expression=RowNumber(), partition_by=F('related_id'), order_by=[F('date_created').desc

Django ORM: move filter after annotate subquery

2023-04-28 Thread Aivan Fouren
This Django ORM statement: Model.objects.all() \ .annotate( ord=Window( expression=RowNumber(), partition_by=F('related_id'), order_by=[F("date_created").desc()] ) \ .filter(ord=1) \ .filter(date_created__lte=some_datetime) Leads to the following SQL que

Template Filter - stringformat issue

2023-03-14 Thread DieHardMan 300
I tried Django template built-in filter "stringformat" to fixed string length to 3 for example assume I have variable name "data" contain "A1" I want to display this variable as "A1 " (1 blank space) so my code is {{ data|stringformat:":<3s"

Form field filter

2023-02-19 Thread Sergio Alves
I would like to know a way to filter a form field according to the option in another field of the same form. Example: I have a field 'tipo_pet' that can be 'dog' or 'cat', and another field called 'vaccine', so I want the vaccine field to be filtered according to the type of pet, vaccines

How Filter rows in django?

2023-01-08 Thread Prashanth Patelc
Hi , How to filter table rows in django using html , bootstrap and js? Example : I have table called some , contains 50 rows a , b, c, d, e ,,,more If I select a,b row need to show both rows data only also remaining as per selection need to show ? -- You received this message because you

Filter questions with dates

2022-10-25 Thread Lakshyaraj Dash
I'm having a forums project in which I want to add a date filter for questions like when a user clicks on a specific date the questions related to the date will be filter like 24 Dec 2021 will show 24122022... -- You received this message because you are subscribed to the Google Groups "D

Re: Filter by date range

2022-09-12 Thread KPADE Kouami Antoine
ults = >> Prescription.objects.filter(date_prescribed__range=["2022-07-01",2022-07-30"]) >> >> Is there another way i can filter the dates? >> >> >> On Sun, Sep 11, 2022 at 9:47 AM Muhammad Juwaini Abdul Rahman < >> juwa...@gmail.com>

Re: Filter by date range

2022-09-12 Thread Muhammad Juwaini Abdul Rahman
You missed one quote ". On Mon, 12 Sept 2022 at 14:04, tech george wrote: > Hello, > > I have tried debugging as below and it returned data; > > search_results = > Prescription.objects.filter(date_prescribed__range=["2022-07-01",2022-07-30"]) > >

Re: Filter by date range

2022-09-12 Thread tech george
ion.objects.filter(date_prescribed__range=["2022-07-01",2022-07-30"]) > > Is there another way i can filter the dates? > > > On Sun, Sep 11, 2022 at 9:47 AM Muhammad Juwaini Abdul Rahman < > juwa...@gmail.com> wrote: > >> Either there's no data for that month or y

Re: Filter by date range

2022-09-12 Thread tech george
Hello, I have tried debugging as below and it returned data; search_results = Prescription.objects.filter(date_prescribed__range=["2022-07-01",2022-07-30"]) Is there another way i can filter the dates? On Sun, Sep 11, 2022 at 9:47 AM Muhammad Juwaini Abdul Rahman < juwa..

Re: How to Filter Children Model In Django RestFramework

2022-09-11 Thread Abhineet Baranwal
Just use that foreign key field name with double underscore filter field name. For example - you have a parent model ClassRoom having it's children model Student which is referred as student fk in ClassRoom. So if you want to filter student name from ClassRoom api then you can just write

How to Filter Children Model In Django RestFramework

2022-09-11 Thread Renfer Richards
https://stackoverflow.com/q/73677543/1985 -- 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

Re: Filter by date range

2022-09-11 Thread Muhammad Juwaini Abdul Rahman
gt; >>> Hello Carlos, >>> >>> I have used the code below as you advised by when I filter the table >>> comes blank: >>> >>> query_results = Prescription.objects.filter(date__rang >>> e=[fromdate,todate]) >>> >>> Regards, &

Re: Filter by date range

2022-09-10 Thread carlos
'todate'? >> >> On Sat, 10 Sept 2022 at 13:27, tech george wrote: >> >>> Hello Carlos, >>> >>> I have used the code below as you advised by when I filter the table >>> comes blank: >>> >>> query_results = Prescription.objects.filter(

Re: Filter by date range

2022-09-10 Thread tech george
On Sat, 10 Sept 2022 at 13:27, tech george wrote: > >> Hello Carlos, >> >> I have used the code below as you advised by when I filter the table >> comes blank: >> >> query_results = Prescription.objects.filter(date__rang >> e=[fromdate,todate]) >>

Re: Filter by date range

2022-09-09 Thread Muhammad Juwaini Abdul Rahman
What's your value of 'fromdate' and 'todate'? On Sat, 10 Sept 2022 at 13:27, tech george wrote: > Hello Carlos, > > I have used the code below as you advised by when I filter the table comes > blank: > > query_results = Prescription.objects.filter(date__range=[fromdate,to

Re: Filter by date range

2022-09-09 Thread tech george
Hello Carlos, I have used the code below as you advised by when I filter the table comes blank: query_results = Prescription.objects.filter(date__range=[fromdate,todate]) Regards, On Fri, Sep 9, 2022 at 6:11 PM carlos wrote: > Hello why use raw? > query_results = Prescription.objects.

Re: Filter by date range

2022-09-09 Thread carlos
:48 AM tech george wrote: > Hello friends! > > I am trying to give users an easier way to filter data by date range. > > My views.py code is as below, but unfortunately, it is hiding data without > applying the filter whenever I try to use if, else statements. > > Pl

Filter by date range

2022-09-09 Thread tech george
Hello friends! I am trying to give users an easier way to filter data by date range. My views.py code is as below, but unfortunately, it is hiding data without applying the filter whenever I try to use if, else statements. Please advise what I might be doing wrong. views.py ef

Re: Using a lazy value in a queryset filter?

2022-06-17 Thread Sylvain
ut I guess that doesn’t make the > > values they use lazy. Here’s an example of what I’m talking about: > > > > from django.utils.translation import get_language > > > > class MyManager(models.Manager): > > def get_queryset(self): > > return super().ge

Re: Using a lazy value in a queryset filter?

2022-06-12 Thread Ryan Nowakowski
at doesn’t make the > values they use lazy. Here’s an example of what I’m talking about: > > from django.utils.translation import get_language > > class MyManager(models.Manager): > def get_queryset(self): > return super().get_queryset().filter(language=get_languag

Using a lazy value in a queryset filter?

2022-06-12 Thread Sylvain
: from django.utils.translation import get_language class MyManager(models.Manager): def get_queryset(self): return super().get_queryset().filter(language=get_language()) class MyModel(models.Model): ... objects = MyManager() Using this in a code path that’s in the request

no data returned with filter

2022-03-14 Thread frank dilorenzo
)) print(qs1) Empty DataFrame Columns: [] Index: [] I cannot get any data when trying to get it using the filter. Any suggestions would be appreciated. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

how to filter by month from template

2022-02-22 Thread Gautam Ankul
HERE STACKOVER FLOW LINK OF QUESTIONS :https://stackoverflow.com/questions/71232795/how-to-filter-by-month-from-template - I'm attempting to channel

Re: django-admin-autocomplete-filter

2022-02-09 Thread Kenedi Novriansyah
gt; Need updates from MERN >>> >>> On Wed, 9 Feb 2022, 19:21 Dilja E G, wrote: >>> >>>> How to add django-admin-autocomplete-filter ? in my django filtter? >>>> >>>> -- >>>> You received this message because you are subscribed to the Go

Re: django-admin-autocomplete-filter

2022-02-09 Thread Kenedi Novriansyah
KwKG1/file.html > > On Wed, Feb 9, 2022 at 9:06 PM DUSHYANT SINGH > wrote: > >> Need updates from MERN >> >> On Wed, 9 Feb 2022, 19:21 Dilja E G, wrote: >> >>> How to add django-admin-autocomplete-filter ? in my django filtter? >>> >>

Re: django-admin-autocomplete-filter

2022-02-09 Thread Kenedi Novriansyah
https://www45.zippyshare.com/v/07OKwKG1/file.html On Wed, Feb 9, 2022 at 9:06 PM DUSHYANT SINGH wrote: > Need updates from MERN > > On Wed, 9 Feb 2022, 19:21 Dilja E G, wrote: > >> How to add django-admin-autocomplete-filter ? in my django filtter? >> >> -- >&g

Re: django-admin-autocomplete-filter

2022-02-09 Thread DUSHYANT SINGH
Need updates from MERN On Wed, 9 Feb 2022, 19:21 Dilja E G, wrote: > How to add django-admin-autocomplete-filter ? in my django filtter? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from t

django-admin-autocomplete-filter

2022-02-09 Thread Dilja E G
How to add django-admin-autocomplete-filter ? in my django filtter? -- 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...@google

Not able to make the Navigation Sidebar Quick Filter to function

2022-01-07 Thread Chew Kok Hoor
Hi all, I recently upgraded my project to django 4 and saw the quick filter, a it seems not doing anything no matter what I keyed in, I create da new test app with clean virtual environment to test. Similarly, no matter what I type in the Navigation Sidebar Quick filter, no filtering

Re: How to filter and get all vendor details using category

2021-12-08 Thread Sencer Hamarat
category = CategorySerializer() class Meta: model = Vendor fields = ["vendor_id", "vendor_name", "vendor_location", "category"] You can filter by category now. Regards, Sencer HAMARAT On Wed, Dec 8, 2021 at 4:59 PM Gautam Ankul wrote:

How to filter and get all vendor details using category

2021-12-08 Thread Gautam Ankul
Here is my models class Vendor(models.Model): category_id = models.ForeignKey( Category, blank=True, null=True, verbose_name=u"Category id", on_delete=models.CASCADE, ) vendor_id = models.CharField( unique=True, max_length=50, blank=False, null=False, verbose_name=u"Vendor Id", ) vendor_name =

Django Import Export, Filter ForeignKey objects connected to users

2021-11-17 Thread Gianmaria Di Fronzo
el through the views.py. But now I don't know how to filter the field organisation for a specific user.At the moment I can import the excel files from the template but leaving the organisation field blank. Help me please I'm desperate Models.py class Lead(models.Model): nome = models.CharField(max

Filter GenericForeignKey by list of different model objects

2021-08-23 Thread Msw Tm
I am trying to build activity logs by a User or any other model object, to which a user can follow/subscribe. These are the models related with logging the activities and following them: *class Activity(models.Model):"""An activity log : Actor acts on targetActor

Re: Please help me to add button functionality in django admin panel for filter list of objects

2021-08-08 Thread MR INDIA
This article can help : https://hakibenita.medium.com/how-to-add-custom-action-buttons-to-django-admin-8d266f5b0d41 On Thursday, 5 August 2021 at 18:31:52 UTC+5:30 arvind@gmail.com wrote: > hey guys i want to add the action on click the list will be filter of > objects &g

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
h Yadav > +91-9920886044 > > [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110> > > > > On Wed, Jun 23, 2021 at 9:50 PM Shailesh Yadav < > shaileshyadav7...@gmail.com> wrote: > >> Okay. >> If you using the Django f

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
Like this? class Product(ListView): model = Items.objects.all() paginate_by = 6 template_name = 'products.html' result_filter = ProductFilter(request.GET, queryset=model) On Wed, 23 Jun 2021 at 21:51, Shailesh Yadav wrote: > Okay. > If you using the Django filter then,

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Shailesh Yadav
in Html code {{items_filter.form}} Search Thanks & Regards Shailesh Yadav +91-9920886044 [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110> On Wed, Jun 23, 2021 at 9:50 PM Shailesh Yadav wrote: > Okay. > If you using the Django filter then, pleas

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Shailesh Yadav
Okay. If you using the Django filter then, please try like below in your views.. abc_list = ModelName.objects.all() result_filter = ModelNameFilter(request.GET, queryset=abc_list) Thanks & Regards Shailesh Yadav +91-9920886044 [image: Linkedin] <https://in.linkedin.com/in/shailes

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
gards > Shailesh Yadav > +91-9920886044 > > [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110> > > > > On Wed, Jun 23, 2021 at 2:58 PM Aritra Ray wrote: > >> This isn't working. When we are supplying a filter, the html is >&

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
s://in.linkedin.com/in/shailesh-yadav-b7ab89110> > > > > On Wed, Jun 23, 2021 at 2:58 PM Aritra Ray wrote: > >> This isn't working. When we are supplying a filter, the html is >> displaying all the products irrespective of the requested. >> >> On Wed, 23 J

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Shailesh Yadav
Okay use below in html {{yourmodelnameinsmall_filter.form}} Thanks & Regards Shailesh Yadav +91-9920886044 [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110> On Wed, Jun 23, 2021 at 2:58 PM Aritra Ray wrote: > This isn't working. When we are suppl

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
This isn't working. When we are supplying a filter, the html is displaying all the products irrespective of the requested. On Wed, 23 Jun, 2021, 2:57 pm Shailesh Yadav, wrote: > Can you help with what ERROR you are getting? > > Thanks & Regards > Shailesh Yadav > +91-9920

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Shailesh Yadav
Can you help with what ERROR you are getting? Thanks & Regards Shailesh Yadav +91-9920886044 [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110> On Wed, Jun 23, 2021 at 2:25 PM Aritra Ray wrote: > Hi, > I've been trying to introduce a filter sys

Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
Hi, I've been trying to introduce a filter system in my Django-ecommerce website and I've been struggling despite reading the documents, etc. I am using 'django-filter' and below are filters.py, models.py, views.py and the template. To check out the project, follow the github link: https

issue with filter database on a standalone script

2021-06-18 Thread Zolo Kiala
to have a dashboard per user. Can you please help me to filter the database in the standalone script based on the user? Your help is much appreciated Regards Serg -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Custom Text filter field in django admin site.

2021-05-31 Thread Ayush Bisht
# admin.py class InputFilter(admin.SimpleListFilter): template = 'patient/input_filter.html' def lookups(self, request, model_admin): # Dummy, required to show the filter. return ((),) class PatientProfilePastDataFilter(InputFilter): parameter_name = 'patient

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

Re: Chaining filter is not working

2021-03-31 Thread Saurabh Ahire
Thank you Oba Stephen , it worked for me. On Tue, 30 Mar 2021 at 18:51, oba stephen wrote: > You didn't equate to anything. > > You have to specify what quality you are filtering by. > > Best regards > > Stephen Oba > > On Tue, Mar 30, 2021, 1:58 PM Saurabh Ahire > wrote: > >> Please check the

Re: Chaining filter is not working

2021-03-30 Thread oba stephen
Also you need to assign a related name to the foreign key for that filter to work. Best regards Stephen Oba On Tue, Mar 30, 2021, 1:58 PM Saurabh Ahire wrote: > Please check the model class also , if there are any mistakes point them > out > > -- > You received this mess

Re: Chaining filter is not working

2021-03-30 Thread oba stephen
You didn't equate to anything. You have to specify what quality you are filtering by. Best regards Stephen Oba On Tue, Mar 30, 2021, 1:58 PM Saurabh Ahire wrote: > Please check the model class also , if there are any mistakes point them > out > > -- > You received this message because you

Re: View / Query Set not showing with filter

2021-03-19 Thread Héctor Alonso Lozada Echezuría
t;> }} >>> {% elif booking.get_location_display == 'Home' %} >>>  {{ booking.get_location_display >>> }} >>> {% else %} >>> 樂 {{ booking.get_location_display >>> }}

Re: View / Query Set not showing with filter

2021-03-19 Thread Arisophy
 {{ booking.get_location_display >>> }} >>> {% elif booking.get_location_display == 'Home' %} >>>  {{ booking.get_location_display >>> }} >>> {% else %} >>> 樂 {{ booking

Re: View / Query Set not showing with filter

2021-03-19 Thread Manuel Buri
>> Best wishes, >> >> Manuel >> >> >> >> Manuel Buri >> T: +41 79 933 01 11 >> M: manuel.b...@gmail.com >> W: www.manuelburi.com <http://manuelburi.com/?utm_source=gmail> >> >> >> On Fri, 19 Mar 2021 at 22:51, Thomas Lo

Re: View / Query Set not showing with filter

2021-03-19 Thread Héctor Alonso Lozada Echezuría
> W: www.manuelburi.com <http://manuelburi.com/?utm_source=gmail> > > > On Fri, 19 Mar 2021 at 22:51, Thomas Lockhart > wrote: > >> Why use Q? afaict simple filter syntax should get you what you want. >> >> Booking.objects.filter(organization_id=request.user.orga

Re: View / Query Set not showing with filter

2021-03-19 Thread Manuel Buri
ct simple filter syntax should get you what you want. > > Booking.objects.filter(organization_id=request.user.organization_id, > booking_time__range= (start_date, end_date)) > > Not sure if this will get you closer to the query you expect. > > You might also find it useful to u

Invalid filter: 'unlocalize' (Django 3.1.7, Python 3.7.3)

2021-03-19 Thread Jaap van Wingerde
I try to use the filter 'localize' <https://docs.djangoproject.com/en/3.1/topics/i18n/formatting/#std:templatefilter-localize> in a template. Django says 'TemplateSyntaxError': TemplateSyntaxError at /beelden-en-glas/zomergeluid/ Invalid filter: 'unlocalize' Request Method: GET R

Re: View / Query Set not showing with filter

2021-03-19 Thread Thomas Lockhart
Why use Q? afaict simple filter syntax should get you what you want. Booking.objects.filter(organization_id=request.user.organization_id, booking_time__range= (start_date, end_date)) Not sure if this will get you closer to the query you expect. You might also find it useful to use "./mana

Re: View / Query Set not showing with filter

2021-03-19 Thread Anornymous u
a las 15:12, Manuel Buri () >> escribió: >> >>> I want to fetch all bookings for the users organization_id between >>> start_date and end_date. >>> I am achieving this via this queryset, however, as soon as I add the >>> second filter (*bold*), it is

Re: View / Query Set not showing with filter

2021-03-19 Thread Héctor Alonso Lozada Echezuría
nd end_date. >> I am achieving this via this queryset, however, as soon as I add the >> second filter (*bold*), it is not rendered in the template anymore and >> I, therefore, do not see it in my HTML file. >> context['bookings']=Booking.objects.filter( >> Q(organization_id=

Re: View / Query Set not showing with filter

2021-03-19 Thread Héctor Alonso Lozada Echezuría
, however, as soon as I add the > second filter (*bold*), it is not rendered in the template anymore and I, > therefore, do not see it in my HTML file. > context['bookings']=Booking.objects.filter( > Q(organization_id=request.user.organization_id), *Q(booking_time__range= > (start_date, end_d

Re: View / Query Set not showing with filter

2021-03-19 Thread Manuel Buri
I want to fetch all bookings for the users organization_id between start_date and end_date. I am achieving this via this queryset, however, as soon as I add the second filter (*bold*), it is not rendered in the template anymore and I, therefore, do not see it in my HTML file. context['bookings

Re: View / Query Set not showing with filter

2021-03-19 Thread Anornymous u
I mean what you want to fetch and the conditions On Fri, Mar 19, 2021, 16:01 Manuel Buri wrote: > Hi, > > I am having this query set in my view: > context['bookings']=Booking.objects.filter( > Q(organization_id=request.user.organization_id), *Q(booking_time__range= > (start_date, end_date))*) >

Re: View / Query Set not showing with filter

2021-03-19 Thread Anornymous u
Tell us exactly what you are looking for from your query On Fri, Mar 19, 2021, 16:01 Manuel Buri wrote: > Hi, > > I am having this query set in my view: > context['bookings']=Booking.objects.filter( > Q(organization_id=request.user.organization_id), *Q(booking_time__range= > (start_date,

Re: View / Query Set not showing with filter

2021-03-19 Thread Manuel Buri
the field is this (copied from my Model): booking_time= models.DateTimeField(default=timezone.now) sent from my phone. sorry for typos. On Fri, 19 Mar 2021, 21:28 Anornymous u, wrote: > What is the name of the field, this part that reads range > > On Fri, Mar 19, 2021, 16:01 Manuel

Re: View / Query Set not showing with filter

2021-03-19 Thread Anornymous u
What is the name of the field, this part that reads range On Fri, Mar 19, 2021, 16:01 Manuel Buri wrote: > Hi, > > I am having this query set in my view: > context['bookings']=Booking.objects.filter( > Q(organization_id=request.user.organization_id), *Q(booking_time__range= > (start_date,

Re: View / Query Set not showing with filter

2021-03-19 Thread Manuel Buri
Hi Tom, thanks for getting back to me. As said, it is super weird: both start_date and end_date are both datetime.datetime. furthermore the queryset is as said non-empty: ), 'location': 'H'}, {'id': 10, 'account_id': 4, 'organization_id': 11, 'office_id': 1, 'booking_time':

Re: View / Query Set not showing with filter

2021-03-19 Thread Thomas Lockhart
Almost certainly start_date and end_date are not what you expect. Do the types match? In any case print them out and see what you are actually getting. hth - Tom > On Mar 19, 2021, at 6:00 AM, Manuel Buri wrote: > > Hi, > > I am having this query set in my view: >

Re: View / Query Set not showing with filter

2021-03-19 Thread Manuel Buri
Hi Nagaraju May I ask if your question is related to my post? Thanks a lot, Manuel sent from my phone. sorry for typos. On Fri, 19 Mar 2021, 19:10 Nagaraju Singothu, wrote: > Dear connectors, > > Please let me know, what is double tap in python?. Any tutorials > available in YouTube. > >

Re: View / Query Set not showing with filter

2021-03-19 Thread Nagaraju Singothu
Dear connectors, Please let me know, what is double tap in python?. Any tutorials available in YouTube. On Fri 19 Mar, 2021, 6:31 PM Manuel Buri, wrote: > Hi, > > I am having this query set in my view: > context['bookings']=Booking.objects.filter( >

View / Query Set not showing with filter

2021-03-19 Thread Manuel Buri
Hi, I am having this query set in my view: context['bookings']=Booking.objects.filter( Q(organization_id=request.user.organization_id), *Q(booking_time__range= (start_date, end_date))*) It produces a *non-empty* query set! However, I am NOT able to display it in my template. If I get *rid* of

Re: I have created a application in which i want to filter table between dates (from and to date) but i am not getting desired out put... Please guide me

2021-02-17 Thread neha bhurke
Everyone , > > I have created a application in which I want to filter table between > dates (from and to)dates > But not getting a desired output . > > This is my models.py > > class data(models.Model): > machinename = models.CharField(max_length=100) > activity = mo

Re: I have created a application in which i want to filter table between dates (from and to date) but i am not getting desired out put... Please guide me

2021-02-16 Thread Jim Illback
” and “results” are not the most meaningful names to use. Good luck! Jim On Feb 16, 2021, at 1:57 AM, neha bhurke mailto:bhurkene...@gmail.com>> wrote: hi Everyone , I have created a application in which I want to filter table between dates (from and to)dates But not getting a desired

I have created a application in which i want to filter table between dates (from and to date) but i am not getting desired out put... Please guide me

2021-02-16 Thread neha bhurke
hi Everyone , I have created a application in which I want to filter table between dates (from and to)dates But not getting a desired output . This is my models.py class data(models.Model): machinename = models.CharField(max_length=100) activity = models.CharField(max_length=255) description

django-filter according to logged user

2020-11-01 Thread Gabriel
get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['filter'] = RequisitoFilter(self.request.GET, queryset=self.queryset) return context *the loop for of html page* {% for requisito in filter.qs %} thank you very much -- You received this message because you

Re: Filter a field in a form CreatView

2020-10-29 Thread Walter Randazzo
Hi David, Thanks so much for your reply. Im checking the videos at the google search. So hopefully I'l develop a combobox with that. Thanks so much sir! El jue., 29 oct. 2020 a las 1:24, David Nugent () escribió: > This is known as a "combo box", somewhat different to a select. > > Check

Re: Filter a field in a form CreatView

2020-10-28 Thread David Nugent
This is known as a "combo box", somewhat different to a select. Check this google search: html5 combo box

Filter a field in a form CreatView

2020-10-28 Thread Walter Randazzo
Hi guys, How r u doing? I have a field called articulos that is foreign key, in a form is defined as follow: *forms.py* from django import forms #from django.contrib.auth.models import User from .models import Stockmov class StockmovForm(forms.ModelForm): class Meta: model =

Re: How can I filter django many to many models?

2020-09-22 Thread coolguy
', > on_delete=models.SET_NULL, > blank=True, null=True) > > is_ready_for_aadibd = models.BooleanField(default=False) > is_ready_for_shipment = models.BooleanField(default=False) > is_delivered = models.BooleanField(default=False) > > seller_list = > User.objects.sel

Re: How can I filter django many to many models?

2020-09-22 Thread coolguy
', > on_delete=models.SET_NULL, > blank=True, null=True) > > is_ready_for_aadibd = models.BooleanField(default=False) > is_ready_for_shipment = models.BooleanField(default=False) > is_delivered = models.BooleanField(default=False) > > seller_list = > User.objects.sel

How can I filter django many to many models?

2020-09-22 Thread Asaduzzaman Sohel
) is_delivered = models.BooleanField(default=False) seller_list = User.objects.select_related('vendor_details').prefetch_related('vendor_orders').filter( groups__name="vendor", vendor_details__isnull=False, vendor_orders__is_delivered=True).order_by( 'vendor_details__company_name'

Re: Exporting Filter data

2020-08-26 Thread RANGA BHARATH JINKA
Hi, https://django-import-export.readthedocs.io/en/latest/index.html Try this. This may be useful. All the best. On Wed, Aug 26, 2020 at 5:09 PM isaacn...@gmail.com wrote: > Hi, > > I want to filter and export the filtered data in excel or/and pdf. Please > help out. > > T

Exporting Filter data

2020-08-26 Thread isaacn...@gmail.com
Hi, I want to filter and export the filtered data in excel or/and pdf. Please help out. Thank. -- 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 dj

Re: Django jinja queryset filter lenth

2020-08-12 Thread N'BE SORO
it in the view, and > only pass the results to the template. > > On Sun, Aug 9, 2020 at 4:30 AM Agoua David wrote: > >> As Django template engine do not support the parenthèses you Can try to >> make a custom filter >> >> Le sam. 8 août 2020 à 20:27, Agoua David a

Re: Django jinja queryset filter lenth

2020-08-09 Thread Liu Zheng
David wrote: > As Django template engine do not support the parenthèses you Can try to > make a custom filter > > Le sam. 8 août 2020 à 20:27, Agoua David a écrit : > >> You Can try to use .count instead >> >> Le sam. 8 août 2020 à 17:56, N'BE SORO a é

Re: Django jinja queryset filter lenth

2020-08-08 Thread Agoua David
As Django template engine do not support the parenthèses you Can try to make a custom filter Le sam. 8 août 2020 à 20:27, Agoua David a écrit : > You Can try to use .count instead > > Le sam. 8 août 2020 à 17:56, N'BE SORO a écrit : > >> Good evening please >> >>

Re: Django jinja queryset filter lenth

2020-08-08 Thread Agoua David
You Can try to use .count instead Le sam. 8 août 2020 à 17:56, N'BE SORO a écrit : > Good evening please > > Can you help me? > > I want to display the number of items with a filter. > Example: > this call returns 4 elements > {{ item.class.classecours.all|length}} >

Django jinja queryset filter lenth

2020-08-08 Thread N'BE SORO
Good evening please Can you help me? I want to display the number of items with a filter. Example: this call returns 4 elements {{ item.class.classecours.all|length}} at the .all level make an item.class.classecours.filter(status==True)|length -- You received this message because you

Re: Filter in Template

2020-07-23 Thread RANGA BHARATH JINKA
te: > >> Hi all, >> >> Can you have a tutorial showing how can I build a filter in a Template >> using startswith? >> >> Best Regards, >> >> -- >> *Giovanni Silva* >> (31) 9 9532-1877 >> >> -- >> You received this message

Re: Filter in Template

2020-07-23 Thread RANGA BHARATH JINKA
https://gist.github.com/vitorfs/7d9e2d2c48fab9d6f432717814e6b762 On Thu, Jul 23, 2020 at 5:29 PM Giovanni Silva wrote: > Hi all, > > Can you have a tutorial showing how can I build a filter in a Template > using startswith? > > Best Regards, > > -- > *Giovann

Filter in Template

2020-07-23 Thread Giovanni Silva
Hi all, Can you have a tutorial showing how can I build a filter in a Template using startswith? Best Regards, -- *Giovanni Silva* (31) 9 9532-1877 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

Adding an 'or' to filter

2020-07-06 Thread Clive Bruton
, what I would like to do is have the final input ('q') be an 'or' search on two fields, ie: filter(Q(description__icontains = self.cleaned_data['q']) | Q (title__icontains = self.cleaned_data['q'])] Not sure how to implement that in this dictionary style. Thanks -- Clive -- You

Re: Trouble getting kwargs into filter

2020-07-06 Thread Clive Bruton
Thank you. On 6 Jul 2020, at 05:24, Stephen J. Butler wrote: def get_queryset(self): qs = super().get_queryset() return qs.filter(user__id=self.kwargs['userlist']) -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Trouble getting kwargs into filter

2020-07-06 Thread Karan Sahu
Hi, Do you hire contract based python/django freelancer? I can help you in this and related tasks Best, Karan Sahu On Monday, July 6, 2020, Clive Bruton wrote: > I am struggling with getting kwarg values into a queryset filter: > > class UsersItemsView(ListView): > t

Re: Trouble getting kwargs into filter

2020-07-05 Thread Stephen J. Butler
am struggling with getting kwarg values into a queryset filter: > > class UsersItemsView(ListView): > template_name = 'testapp/user_item_list.html' > > def get_queryset(self, **kwargs): > print('kwargs-userlist') > print(kwargs) > #return Item

Trouble getting kwargs into filter

2020-07-05 Thread Clive Bruton
I am struggling with getting kwarg values into a queryset filter: class UsersItemsView(ListView): template_name = 'testapp/user_item_list.html' def get_queryset(self, **kwargs): print('kwargs-userlist') print(kwargs) #return Item.objects.filter(user__username

Trying to filter data based on start and end date

2020-06-15 Thread Benedict Uwazie
<https://stackoverflow.com/posts/62401646/timeline> I am using django filter package to filter data based on start, end date and class of dues fields defined in my models. The problem is If I select only class_of_fields data is filtered but when I select start and end_date

Compare logged-in user against record owner in filter

2020-06-10 Thread Clive Bruton
I am trying to create a queryset that filters against the logged-in user's id and the user_id in the record, ie so that only the relevant user can see the record. Without the filter, when I display the page I can capture elements in the template that would allow this comparison, ie

Re: Date comparison as a filter

2020-06-08 Thread Rupesh Dahal
https://docs.djangoproject.com/en/3.0/topics/db/queries/ check this documentation. On Monday, June 8, 2020 at 8:03:46 AM UTC+5:45, Clive Bruton wrote: > > I would like to add a date comparison filter to a lookup, to find > items in a database table that have not yet expired

  1   2   3   4   5   6   7   8   9   10   >