Re: Problem with view

2021-02-24 Thread Maurizio Faccin


Ciao,
cambiando il nome delle classi funziona.

Grazie mille!


Maurizio

Il 25/02/2021 01:14, Umberto Moffa ha scritto:
Ciao, prova a cambiare il nome delle classi, forse chiamandosi Fatture 
sia il Model che la View va in pappa, oppure sovrascrivi il nome del 
Model quando lo importi nella view


Esempio:
“from model. import Fatture as *qualsiasi altro nome*

Il giorno gio 25 feb 2021 alle 00:54 Maurizio Faccin 
mailto:maurizio.fac...@tiscali.it>> ha 
scritto:



Hello,
I'am a newbie in usign django and django rest.
I have a problem with a modelsetview
The message error is:

Exception Type: AttributeError
Exception Value:

type object 'Fatture' has no attribute 'objects'

Exception Location:
C:\Lavoro\Python\scambiosdi\scambiosdi\fatture\api\views.py, line
15, in get_queryset

This is the model.py:
from django.db import models
from scambiosdi import dataset
from utenti.models import Utenti

class Fatture(models.Model):
    utente = models.ForeignKey(Utenti, on_delete=models.CASCADE,
related_name="fatture")
    tipo_fattura = models.IntegerField(choices=dataset.TIPOFATTURA)
    denominazione = models.CharField(max_length=80)
    numero = models.CharField(max_length=20)
    data = models.DateField()
    totale = models.DecimalField(max_digits=18, decimal_places=2,
default=0)
    identificativo_sdi = models.CharField(max_length=50, blank=True)
    percorso_file_originale = models.CharField(max_length=240,
blank=True)
    percorso_file_pulito = models.CharField(max_length=240,
blank=True)

    class Meta():
    verbose_name = 'Fattura'
    verbose_name_plural = 'Fatture'

    def __str__(self):
    return '{} {} {}'.format(self.denominazione, self.numero,
self.data)


This is the serializers.py:
from rest_framework import serializers
from fatture.models import Fatture

class FatturaSerializer(serializers.ModelSerializer):
    user = serializers.StringRelatedField(read_only=True)

    class Meta:
    model = Fatture
    fields = "__all__"



And this is the views.py:
from rest_framework.viewsets import ModelViewSet
from rest_framework.permissions import IsAuthenticated
from fatture.models import Fatture
from fatture.api.serializers import FatturaSerializer

class Fatture(ModelViewSet):
    serializer_class = FatturaSerializer
    permission_classes = [IsAuthenticated]

    def get_queryset(self):
    queryset = Fatture.objects.all()
    idfattura = self.request.query_params.get("idfattura", None)
    if idfattura is not None:
    queryset = queryset.filter(id=idfattura)
    return queryset

If I change the Fatture class in this way works correctly:
class Fatture(ModelViewSet):
    queryset = Fatture.objects.all()
    serializer_class = FatturaSerializer
    permission_classes = [IsAuthenticated]




Maurizio

-- 
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/d1883242-9b48-a158-1e27-cd021c60fd85%40tiscali.it

.

--
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/CAFdc%3DxTYDDDb0yKme0Nsu-73ORhfpf9938%2B8nS3wFkZf6SxRcQ%40mail.gmail.com 
.



--
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/4acfb8fc-d9f1-e9f6-efa1-1a93a65e1a7e%40tiscali.it.


Re: Problem with view

2021-02-24 Thread Maurizio Faccin



I changed the classes name and works!
Thank you


Maurizio


Il 25/02/2021 01:09, Kasper Laudrup ha scritto:

On 24/02/2021 21.00, Maurizio Faccin wrote:


Hello,
I'am a newbie in usign django and django rest.
I have a problem with a modelsetview
The message error is:

Exception Type: AttributeError
Exception Value:

type object 'Fatture' has no attribute 'objects'



You have two classes called Fatture. In your models file and your 
views file. The Python interpreter needs to figure out which one of 
them to use.


When you call the objects method on the Fatture class it is using the 
class inheriting from models.Model but the tries to find the objects 
attribute as a static member in the same class where you're making the 
call.


You could either make it explicit which class to use by prefixing the 
call like *fattura.models.Fatture* but a better solution is probably 
to rename the classes to FattureModel and FattureView. That would also 
follow the naming patter from calling your serializer class 
FatturaSerializer.


Kind regards,

Kasper Laudrup



--
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/fd4fa7e8-90eb-f02d-6472-e3cf077c2409%40tiscali.it.


Question about models. test

2021-02-24 Thread dupakoor kannan
Hello everyone,

I have the following model

class Publication(models.Model):
name = models.CharField(max_length=25, blank=True, null=False)
publication_url = models.TextField(blank=True)

and observed there are some inactive URLs on the production server (due to
data entry mistakes). Is there any way I can write a test for the inactive
URLs from the database (local copy)?.


Thanks
Kannan

-- 
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/CADiZb_d9uiad-mJ0FoJH2ZH7017L31rO8tw9knSyLSsRRdrO2g%40mail.gmail.com.


Any volunteers for integrating React.js with existing Django web application

2021-02-24 Thread Milson Munakami
Dear Django devs,

Hello, any django programmer interested in volunteering to coach or
participate in integrating React.js based template on my project please
connect with me.

I would love to share more details in person regarding the project scope
which is functionally almost complete now.

-- 
Thank you,

Milson Munakami

https://misltein.me   <208.220.2943>

-- 
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/CAP1qhGsTSQ1zNnmTT4U10W2YLYbc13Wy3niW1Qm0Y6Nz3e%3DRSg%40mail.gmail.com.


Pg Full Text search in the ORM

2021-02-24 Thread Stats Student
Hi, does anyone know how to translate the following query to the ORM?

select * from company where to_tsvector(name) @@ to_tsquery('gold:*')

So far I have the following, but cannot seem to integrate the [:*] piece.

Company.objects.annotate(search = SearchVector('name')).filter(search =
SearchQuery('gold'))


TIA

-- 
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/CAMZO7wK99QAXeoEQCxCcyFc9RMvOQ_YPpmfn4m2o7rFT6UNvhg%40mail.gmail.com.


Re: Problem with view

2021-02-24 Thread Umberto Moffa
Ciao, prova a cambiare il nome delle classi, forse chiamandosi Fatture sia
il Model che la View va in pappa, oppure sovrascrivi il nome del Model
quando lo importi nella view

Esempio:
“from model. import Fatture as *qualsiasi altro nome*

Il giorno gio 25 feb 2021 alle 00:54 Maurizio Faccin <
maurizio.fac...@tiscali.it> ha scritto:

>
> Hello,
> I'am a newbie in usign django and django rest.
> I have a problem with a modelsetview
> The message error is:
>
> Exception Type: AttributeError
> Exception Value:
>
> type object 'Fatture' has no attribute 'objects'
>
> Exception Location:
> C:\Lavoro\Python\scambiosdi\scambiosdi\fatture\api\views.py, line 15, in
> get_queryset
>
> This is the model.py:
> from django.db import models
> from scambiosdi import dataset
> from utenti.models import Utenti
>
> class Fatture(models.Model):
> utente = models.ForeignKey(Utenti, on_delete=models.CASCADE,
> related_name="fatture")
> tipo_fattura = models.IntegerField(choices=dataset.TIPOFATTURA)
> denominazione = models.CharField(max_length=80)
> numero = models.CharField(max_length=20)
> data = models.DateField()
> totale = models.DecimalField(max_digits=18, decimal_places=2,
> default=0)
> identificativo_sdi = models.CharField(max_length=50, blank=True)
> percorso_file_originale = models.CharField(max_length=240, blank=True)
> percorso_file_pulito = models.CharField(max_length=240, blank=True)
>
> class Meta():
> verbose_name = 'Fattura'
> verbose_name_plural = 'Fatture'
>
> def __str__(self):
> return '{} {} {}'.format(self.denominazione, self.numero,
> self.data)
>
>
> This is the serializers.py:
> from rest_framework import serializers
> from fatture.models import Fatture
>
> class FatturaSerializer(serializers.ModelSerializer):
> user = serializers.StringRelatedField(read_only=True)
>
> class Meta:
> model = Fatture
> fields = "__all__"
>
>
>
> And this is the views.py:
> from rest_framework.viewsets import ModelViewSet
> from rest_framework.permissions import IsAuthenticated
> from fatture.models import Fatture
> from fatture.api.serializers import FatturaSerializer
>
> class Fatture(ModelViewSet):
> serializer_class = FatturaSerializer
> permission_classes = [IsAuthenticated]
>
> def get_queryset(self):
> queryset = Fatture.objects.all()
> idfattura =  self.request.query_params.get("idfattura", None)
> if idfattura is not None:
> queryset = queryset.filter(id=idfattura)
> return queryset
>
> If I change the Fatture class in this way works correctly:
> class Fatture(ModelViewSet):
> queryset = Fatture.objects.all()
> serializer_class = FatturaSerializer
> permission_classes = [IsAuthenticated]
>
>
>
>
> Maurizio
>
> --
> 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/d1883242-9b48-a158-1e27-cd021c60fd85%40tiscali.it
> 
> .
>

-- 
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/CAFdc%3DxTYDDDb0yKme0Nsu-73ORhfpf9938%2B8nS3wFkZf6SxRcQ%40mail.gmail.com.


Re: Problem with view

2021-02-24 Thread Kasper Laudrup

On 24/02/2021 21.00, Maurizio Faccin wrote:


Hello,
I'am a newbie in usign django and django rest.
I have a problem with a modelsetview
The message error is:

Exception Type: AttributeError
Exception Value:

type object 'Fatture' has no attribute 'objects'



You have two classes called Fatture. In your models file and your views 
file. The Python interpreter needs to figure out which one of them to use.


When you call the objects method on the Fatture class it is using the 
class inheriting from models.Model but the tries to find the objects 
attribute as a static member in the same class where you're making the call.


You could either make it explicit which class to use by prefixing the 
call like *fattura.models.Fatture* but a better solution is probably to 
rename the classes to FattureModel and FattureView. That would also 
follow the naming patter from calling your serializer class 
FatturaSerializer.


Kind regards,

Kasper Laudrup

--
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/698f2316-465e-9218-3b1b-2b59a48bb6a1%40stacktrace.dk.


Problem with view

2021-02-24 Thread Maurizio Faccin


Hello,
I'am a newbie in usign django and django rest.
I have a problem with a modelsetview
The message error is:

Exception Type: AttributeError
Exception Value:

type object 'Fatture' has no attribute 'objects'

Exception Location: 
C:\Lavoro\Python\scambiosdi\scambiosdi\fatture\api\views.py, line 15, in 
get_queryset


This is the model.py:
from django.db import models
from scambiosdi import dataset
from utenti.models import Utenti

class Fatture(models.Model):
    utente = models.ForeignKey(Utenti, on_delete=models.CASCADE, 
related_name="fatture")

    tipo_fattura = models.IntegerField(choices=dataset.TIPOFATTURA)
    denominazione = models.CharField(max_length=80)
    numero = models.CharField(max_length=20)
    data = models.DateField()
    totale = models.DecimalField(max_digits=18, decimal_places=2, 
default=0)

    identificativo_sdi = models.CharField(max_length=50, blank=True)
    percorso_file_originale = models.CharField(max_length=240, blank=True)
    percorso_file_pulito = models.CharField(max_length=240, blank=True)

    class Meta():
    verbose_name = 'Fattura'
    verbose_name_plural = 'Fatture'

    def __str__(self):
    return '{} {} {}'.format(self.denominazione, self.numero, 
self.data)



This is the serializers.py:
from rest_framework import serializers
from fatture.models import Fatture

class FatturaSerializer(serializers.ModelSerializer):
    user = serializers.StringRelatedField(read_only=True)

    class Meta:
    model = Fatture
    fields = "__all__"



And this is the views.py:
from rest_framework.viewsets import ModelViewSet
from rest_framework.permissions import IsAuthenticated
from fatture.models import Fatture
from fatture.api.serializers import FatturaSerializer

class Fatture(ModelViewSet):
    serializer_class = FatturaSerializer
    permission_classes = [IsAuthenticated]

    def get_queryset(self):
    queryset = Fatture.objects.all()
    idfattura =  self.request.query_params.get("idfattura", None)
    if idfattura is not None:
    queryset = queryset.filter(id=idfattura)
    return queryset

If I change the Fatture class in this way works correctly:
class Fatture(ModelViewSet):
    queryset = Fatture.objects.all()
    serializer_class = FatturaSerializer
    permission_classes = [IsAuthenticated]


Maurizio

--
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/d1883242-9b48-a158-1e27-cd021c60fd85%40tiscali.it.


Re: learning steps

2021-02-24 Thread dupakoor kannan
Hi,

There are several good YouTube tutorials. Here are my recommendations

Corey Schafer -
https://www.youtube.com/watch?v=UmljXZIypDc=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p
Coding for entrepreneurs - https://www.youtube.com/watch?v=F5mRW0jo-U4
Navin - https://www.youtube.com/watch?v=OTmQOjsl0eg


Hope it helps
Kannan

On Sat, Feb 13, 2021 at 5:25 AM Madhav Nandan  wrote:

> Hey Anant! Welcome to the community first.
>
> About your query: There are many good resources for django on web. However
> for beginners I would recommend some best proven learning tracks.
>
> 1. Django Official Documentation
>
> 2. Learning Path on django from  LinkedIn learning
>
> 3. Django course by Dennis Ivy
>
> 4.  Django learning by djangogirls.com
>
> These are really amazing that gets beginners started and later on learning
> rest of django, integration with payment and api and all will surely make
> you best version of django developer.
>
> Cheers!
>
>
> On Fri, Feb 12, 2021, 2:39 AM Theresa Taye 
> wrote:
>
>> Hello Anant,
>>
>> online communities like this will help, also browse youtube for videos in
>> case you enjoy learning that way. lay your hands-on problems to solve, if
>> you get stuck use StackOverflow or generally search google.
>> As for the flow of learning, it is good you already started learning
>> python, also learn HTML, CSS, and JAVASCRIPT if you don't know them before,
>> frameworks like bootstrap will help but learn the basics of those
>> programming languages first.
>>
>> I hope this helps a bit
>>
>>
>> Best regards
>> Theresa
>>
>> On Thu, 11 Feb 2021 at 15:12, Anant Sakhare 
>> wrote:
>>
>>> Hello everyone,
>>> I'm a mechanical engineering student, a few days ago I have started to
>>> learn Python basics. Now I wanted to learn the Django framework.
>>>
>>> can anyone guide me to
>>> 1. what are the learning resources I use?
>>> 2. Flow of learning
>>> 3. prerequisite for the start
>>>
>>>
>>> I would like to say thank you in advance for accepting me in this
>>> community.
>>>
>>> regards,
>>> Anant s.
>>>
>>> --
>>> 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/e6f536e3-4c07-49d4-bc34-2f93ef75ace9n%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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/CAENBRfM-gNZE355MV_hQDcJ%3D2h5cfhTB3z7ggOn5ten6hbnGmQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAGXYL6JSZpZSGqDrDqB7nLWCKNr0JFDVWh1mPJ%2BiVU-GeZepfw%40mail.gmail.com
> 
> .
>

-- 
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/CADiZb_c4BhNO2GzsiD0w8hxbfU5TsmJd5%3D-0zABXyjfGO02hXg%40mail.gmail.com.


Re: django voluntary work.

2021-02-24 Thread Alberto Degli Esposti
Hi Mehedi

We started a python open source project you may be interested in:

https://github.com/airspot-dev/krules

it's an ambitious project. Basically it is a framework which enables the 
development of event-based microservices using knative and in particular 
its eventing part

This is a very complex stack for a novice developer. But...

...we are now working on the development of a component whose goal is to 
enable a Django developer to work productively on this kind of 
architectures using their already acquired skills. The aim of the project 
is precisely to make the underlying complexity easily accessible. 
Therefore, I believe that in this context there is an opportunity to 
operate starting from basic skills if armed with good will and desire to 
learn.

What we need now is the development of cases using the tool and the 
drafting of technical documentation also inspired by your learning path.

This is potentially profitable for us and consequently for you

Contact me if you are interested

Il giorno mercoledì 24 febbraio 2021 alle 05:00:36 UTC+1 
sharifm...@gmail.com ha scritto:

> Mr. Gilwell Muhati,
>
> Since you haven't made any decision yet probably because you are doubting 
> my ability to work with docker. I can assure you even though I am new to 
> docker, I am a quick learner, and have gone through the official docker 
> guide, I will have no trouble using docker.
>
> I only ask you to give me a chance to prove myself.
>
> Thank you
> - Mehedi
> On Tuesday, February 23, 2021, 12:24:39 PM GMT+6, Sharif Mehedi <
> sharifm...@gmail.com> wrote: 
>
>
> >>> Hello @Sharif,
> >>> Do you have any experience with the following:-
> >>>
>
>1. version control? git or svn? 
>   2. docker?
>
>
> >>>* Regards,*
>
> >>>* Gilwell Muhati | +254 710 739 116 |*
> >>>* ~~“The mind is its own place and in itself can make a heaven of 
> hell, a hell of heaven…”~~John Milton*
>
> Hello Gilwell Muhati,
>
> I have experience with git (version control), and as with docker, I took a 
> tutorial and set up a docker container environment with wsl-2 (Ubuntu 18.04 
> Bionic), I understand how docker works and can work with docker.
>
> Thank you for considering me to include in your team. I will be glad to 
> get instructions from you in getting started on your workflow.
>
> Regards,
> - Mehedi
> On Monday, February 22, 2021 at 10:31:33 PM UTC+6 gilw...@gmail.com wrote:
>
> Hello @Sharif,
> Do you have any experience with the following:-
>
>1. version control? git or svn? 
>2. docker?
>
>
>
>
>
> *Regards,Gilwell Muhati | +254 710 739 116 | *
> *~~“The mind is its own place and in itself can make a heaven of hell, a 
> hell of heaven…”~~John Milton *
>
>
> On Mon, Feb 22, 2021 at 6:55 PM Sharif Mehedi  
> wrote:
>
> Hello everybody,
> I am trying to start a career in development. I can work around any 
> problem with python. I have gone through a fair amount of django 
> documentation.
> I am looking forward to work as a volunteer on any professional django 
> project that should boost my learning and also assist on building a resume. 
> I am not expecting any payment. If you hire me and see that I can assist on 
> your work flow, then I am hoping I can join your team as a paid contributor.
> It would be a great help if anybody suggest anybody else where there is 
> such a scope to join as a volunteer.
> Thank you for spending your time in reading this.
> - Mehedi
>
> -- 
> 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...@googlegroups.com.
>
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/fbeb0825-2860-407d-8764-70e6de4759a9n%40googlegroups.com
>  
> 
> .
>
> -- 
> 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...@googlegroups.com.
> To view this discussion on the web visit 
>
> https://groups.google.com/d/msgid/django-users/a699f454-902f-4448-8ec8-33543985f5dbn%40googlegroups.com
>  
> 
> .
>

-- 
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/89ee2769-e3e7-45bd-ae82-cec791a4ef46n%40googlegroups.com.


Re: Date Range picker

2021-02-24 Thread Sanjay Singh
Normally u can use jquery date picker.
*Thanks & Regards,*

*Sanjay Singh**Senior Software Engineer*

*SRM Techsol Private Limited*
B-48, Sector-C, Aliganj Lucknow-226024
Phone : (+91) 522 2328654
Skype: sanjay1.singh_1




On Wed, Feb 24, 2021 at 4:03 PM neha bhurke  wrote:

> Hello ,
>
> I want to create a date picker in which it should contain a format of list
> which consist of today , yesterday, tomorrow ,  next week , previous week ,
> next month previous month ...
>
> How can I create this
>
> Please help me .
>
> --
> 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/8791262b-6e5e-4ef5-92d4-ee7f74e9d3d8n%40googlegroups.com
> 
> .
>

-- 
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/CALE7zHhVoJzSt273S7NWGRH5TSHPNFx_iPPJZ7RnHPtnjqiN%2BA%40mail.gmail.com.


Re: Sorting by distance and date from classifieds page.

2021-02-24 Thread Christian Ledermann
https://stackoverflow.com/questions/19703975/django-sort-by-distance/35896358#35896358
will point you in the right direction

On Wed, 24 Feb 2021 at 08:27, Salima Begum 
wrote:

> Hi all,
>
> 1. After posting an Ad it will display in the classifieds page. After user
> logged in user zip code and based on classifieds ad zip code distance we
> are showing in classifieds page.
> 2. Based on distance and added date of Ad we need to show a listing in the
> classifieds page.
> 3. within 40 miles first we need to show listings of Ads and then in that
> again within 40 miles based on the added date we need to show in
> classifieds page.
> 4. And next 80 miles and then in that added by date in the classifieds
> page.
>
> Example:-
> title  logged   Adzip distance  added_date
>
> Testing post Ad   80023   80027  10.5 mi
>  2021-01-2213:37:44.32801+05:30
>
>
> Can anyone help me to achieve this? Thank you
>
> Thanks
> ~Salima
>
> --
> 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/CAMSz6bn%3D6wZ%2BAoLQOkM6Dxr7Bx4%2BvVKY79mq4JUvydcqOq8YDg%40mail.gmail.com
> 
> .
>


-- 
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}<(((*>

-- 
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/CABCjzWpq%2BfsF9Q9KgW2iB0reMiQXj2mdAgkxOEdErw4VRu7aFQ%40mail.gmail.com.


Re: Date Range picker

2021-02-24 Thread Omkar Parab
Use django-filter

On Wed, Feb 24, 2021, 5:12 PM neha bhurke  wrote:

>
> *Regard,*
> *Neha Bhurke*
>
> Like this 
>
>
> On Wed, Feb 24, 2021 at 5:04 PM Omkar Parab  wrote:
>
>> Something like this? 
>>
>> On Wed, Feb 24, 2021, 4:37 PM neha bhurke  wrote:
>>
>>> How to create the range format means the calendar view with the list
>>>
>>> On Wednesday, February 24, 2021 at 4:35:52 PM UTC+5:30
>>> deshde...@gmail.com wrote:
>>>
 U can use js libraray

 On Wed, 24 Feb 2021, 4:03 pm neha bhurke,  wrote:

> Hello ,
>
> I want to create a date picker in which it should contain a format of
> list which consist of today , yesterday, tomorrow ,  next week , previous
> week , next month previous month ...
>
> How can I create this
>
> Please help me .
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8791262b-6e5e-4ef5-92d4-ee7f74e9d3d8n%40googlegroups.com
> 
> .
>
 --
>>> 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/40c3ef96-2c6a-4bc0-a3d5-710823835043n%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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/CAJY8mfw94xgBWd%2BRn5i9WmnMiuKoKqbgV72oj8%2BPfJ2uMTENrg%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAEwf5Q0zPxRUSsWztt3hnNjqb1dFbw98ri1-3y9PFwk_e1SSug%40mail.gmail.com
> 
> .
>

-- 
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/CAJY8mfzQr6Z78Psdz1Org78uieQxOYrdDucgzMzQFRx9EbZYBw%40mail.gmail.com.


Re: Date Range picker

2021-02-24 Thread neha bhurke
*Regard,*
*Neha Bhurke*

Like this 


On Wed, Feb 24, 2021 at 5:04 PM Omkar Parab  wrote:

> Something like this? 
>
> On Wed, Feb 24, 2021, 4:37 PM neha bhurke  wrote:
>
>> How to create the range format means the calendar view with the list
>>
>> On Wednesday, February 24, 2021 at 4:35:52 PM UTC+5:30
>> deshde...@gmail.com wrote:
>>
>>> U can use js libraray
>>>
>>> On Wed, 24 Feb 2021, 4:03 pm neha bhurke,  wrote:
>>>
 Hello ,

 I want to create a date picker in which it should contain a format of
 list which consist of today , yesterday, tomorrow ,  next week , previous
 week , next month previous month ...

 How can I create this

 Please help me .

 --
 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...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/8791262b-6e5e-4ef5-92d4-ee7f74e9d3d8n%40googlegroups.com
 
 .

>>> --
>> 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/40c3ef96-2c6a-4bc0-a3d5-710823835043n%40googlegroups.com
>> 
>> .
>>
> --
> 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/CAJY8mfw94xgBWd%2BRn5i9WmnMiuKoKqbgV72oj8%2BPfJ2uMTENrg%40mail.gmail.com
> 
> .
>

-- 
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/CAEwf5Q0zPxRUSsWztt3hnNjqb1dFbw98ri1-3y9PFwk_e1SSug%40mail.gmail.com.


Re: Date Range picker

2021-02-24 Thread neha bhurke
How to create the range format means the calendar view with the list

On Wednesday, February 24, 2021 at 4:35:52 PM UTC+5:30 deshde...@gmail.com 
wrote:

> U can use js libraray
>
> On Wed, 24 Feb 2021, 4:03 pm neha bhurke,  wrote:
>
>> Hello ,
>>
>> I want to create a date picker in which it should contain a format of 
>> list which consist of today , yesterday, tomorrow ,  next week , previous 
>> week , next month previous month ...
>>
>> How can I create this
>>
>> Please help me .
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/8791262b-6e5e-4ef5-92d4-ee7f74e9d3d8n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/40c3ef96-2c6a-4bc0-a3d5-710823835043n%40googlegroups.com.


Re: Date Range picker

2021-02-24 Thread Desh Deepak
U can use js libraray

On Wed, 24 Feb 2021, 4:03 pm neha bhurke,  wrote:

> Hello ,
>
> I want to create a date picker in which it should contain a format of list
> which consist of today , yesterday, tomorrow ,  next week , previous week ,
> next month previous month ...
>
> How can I create this
>
> Please help me .
>
> --
> 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/8791262b-6e5e-4ef5-92d4-ee7f74e9d3d8n%40googlegroups.com
> 
> .
>

-- 
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/CAJ0m4xgSxeB8y_Drs%3DWvxc8YTYcotoOe5gAB3SgG5dDb%3DYQvZA%40mail.gmail.com.


Date Range picker

2021-02-24 Thread neha bhurke
Hello ,

I want to create a date picker in which it should contain a format of list 
which consist of today , yesterday, tomorrow ,  next week , previous week , 
next month previous month ...

How can I create this

Please help me .

-- 
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/8791262b-6e5e-4ef5-92d4-ee7f74e9d3d8n%40googlegroups.com.


Re: Filtering serializermethodfield in DRF

2021-02-24 Thread shreeh...@gmail.com
Okay, thanks for the help.
On Wednesday, February 24, 2021 at 10:22:51 AM UTC+5:30 
kunalsol...@gmail.com wrote:

> I don't the exact use case here, but you can pass context while passing 
> data to specializer.And then use it inside creializer clas by self.context.
> In this case you can pass query params to context
>
> On Wed, Feb 24, 2021, 10:15 shreeh...@gmail.com  
> wrote:
>
>> I have to filter my queryset based on a query param. I have to filter 
>> based on serializermethodfield. 
>> Any help would be appreciated.
>>
>>
>> Thank you 
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/0a62f492-3a41-4692-9140-48dd23d7bdbbn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/91aaf871-9696-4c87-92d1-cc4f9fb5411bn%40googlegroups.com.


SVG, clipPath, listview django.

2021-02-24 Thread Siarhei Siarhei
Есть слайдер - файл "svg", картинки - "обтравка-clipPath"


(image cont от 6 и более)
Как же, это пропустить через - ListView?
Надеюсь что кто то, с таким сталкивался...

-- 
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/81bcb532-5ca1-4903-b2e9-171f3f086f01n%40googlegroups.com.


Sorting by distance and date from classifieds page.

2021-02-24 Thread Salima Begum
Hi all,

1. After posting an Ad it will display in the classifieds page. After user
logged in user zip code and based on classifieds ad zip code distance we
are showing in classifieds page.
2. Based on distance and added date of Ad we need to show a listing in the
classifieds page.
3. within 40 miles first we need to show listings of Ads and then in that
again within 40 miles based on the added date we need to show in
classifieds page.
4. And next 80 miles and then in that added by date in the classifieds page.

Example:-
title  logged   Adzip distance  added_date

Testing post Ad   80023   80027  10.5 mi
 2021-01-2213:37:44.32801+05:30


Can anyone help me to achieve this? Thank you

Thanks
~Salima

-- 
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/CAMSz6bn%3D6wZ%2BAoLQOkM6Dxr7Bx4%2BvVKY79mq4JUvydcqOq8YDg%40mail.gmail.com.