Re: Perform a join in 5 tables or more than that USIN ORM

2022-01-30 Thread Sam Chaffy
Yes you can

What’s your model look like ?

On Sun, Jan 30, 2022 at 7:26 AM narendra...@gmail.com <
narendrathapa...@gmail.com> wrote:

> hello folks,
>  any django ex[ert here, I want to know if anybody can do multiple join
> more than 5 tables at once using ORM
> Prefetch,prefetch_related,select_related using any of these or in a
> different way please ping, or just write over here how can we solve that. i
> didn't get any clue
> help will be appreciated
>
> --
> 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/a2097a78-1446-4456-83a1-c96059a12a1dn%40googlegroups.com
> 
> .
>
-- 
Oussama Chafiqui

-- 
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/CAPvcp%2BVtMGtBmC5RZNn8k_-6WRhY9UCbMg%3DqjFZDH7dc81%2B%3DCw%40mail.gmail.com.


Re: Is there a function that returns common elements in multiple lists

2022-01-25 Thread Sam Chaffy
You can use sets

On Tue, Jan 25, 2022 at 7:47 AM bnmng  wrote:

> Hello,
>
> Is there a built in function that compares two or more lists and returns
> elements common to all?
>
> like this:
>
> def in_both( list_a, list_b ):
> list_c=[]
> for value in list_a:
> if value in list_b:
> list_c.append(value)
> return list_c
>
> Or this:
> def in_all(list_of_lists):
> list_a = list_of_lists.pop(0)
> list_b = []
> for value in list_a:
> in_all_lists = True
> for each_list in list_of_lists:
> if not value in each_list:
> in_all_lists = False
> if in_all_lists:
> list_b.append(value)
> return list_b
>
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bf2cf505-6205-4fcf-affd-9a0a2f7e5e00n%40googlegroups.com
> 
> .
>
-- 
Oussama Chafiqui

-- 
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/CAPvcp%2BUcudpPQygoTNUrSYhdmLWFeMH%2BGO7ERuXGH5JNhcVQXg%40mail.gmail.com.


Re: can Django replace PHP ?

2021-06-28 Thread Sam Chaffy
Django gives you a builtin admin panel for free.

Enjoy

On Mon, Jun 28, 2021 at 3:49 PM Boris Pérez  wrote:

> Hi friend...u can do everything u need in django...without use php...
> Greetings
>
>
> 2021-06-28 10:23 GMT-04:00, Luis Zárate :
> > Hi, you can create several web applications with Django. So I guest you
> can
> > replace all web stuff with Django or other lib in python for web
> > development.
> >
> > El lun, 28 jun 2021 a las 7:17, Krishna Adhikari ()
> > escribió:
> >
> >> Hello all  my seniors
> >>
> >> I am doing Data Science programming (python) for 3 years now in my
> >> organization I also have to develop a Web Platform to deeply ML models
> >> and
> >> also to develop other web applications together.
> >>
> >> I searched a lot of information on google, but till now I did not make a
> >> decision should I learn PHP or I can handle it all with Django?
> >>
> >> *can we solve all kinds of web application problems with Django without
> >> learning PHP ?? *
> >> *or PHP also recommended.*
> >>
> >> Thank you all in advance
> >>
> >> --
> >> 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/f2007209-a90e-4a08-8d03-b2b3a1007e1en%40googlegroups.com
> >> <
> https://groups.google.com/d/msgid/django-users/f2007209-a90e-4a08-8d03-b2b3a1007e1en%40googlegroups.com?utm_medium=email_source=footer
> >
> >> .
> >>
> >
> >
> > --
> > "La utopía sirve para caminar" Fernando Birri
> >
> > --
> > 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/CAG%2B5VyOqHw6jRfSu3WL97csjz2npODsO-anVRkGALOhD7fbrvw%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/CAObPVPDDwTg2tCTu_EtC_r5kw7zAekV_0YEL0QEchVsVJqk3qw%40mail.gmail.com
> .
>
-- 
Oussama Chafiqui

-- 
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/CAPvcp%2BV6hPcKwL0Wjbuf%2B8WA4PXhsPmkLoguyOASYAwk1c18NA%40mail.gmail.com.


Re: Filtering fields in http response data from http request url ?

2021-05-31 Thread Sam Chaffy
Using django rest framework, create a serializer class and specify the
right field you want to display at the end.

Please check this link

https://www.django-rest-framework.org/api-guide/serializers/


On Sun, May 30, 2021 at 10:03 PM Mottaz Hegaze  wrote:

> Using Django Rest Framework , you can alter the output by overriting
> function to_represent in serializer.
>
> On Mon, 31 May 2021, 1:26 am Adaeit Telle, 
> wrote:
>
>> Hi Django Developers,
>> Json response from the django server is huge as the data fields contained
>> are of big size.
>> So, can I restrict the *fields* required in the response data from the
>> *HTTP Request Url* ?
>> Is there a generic param, which can be used ?
>>
>> Just like QuerySet, can we have "ValueSet" to restrict the fields(or
>> columns) in the json response data ?
>>
>> Regards,
>> Adaeit
>>
>> --
>> 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/f274b86b-e3fb-483b-802e-857362087619n%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/CAHV4E-dB0%3DHha6HgCoG4igdBbyyjPbQMO3rjkZBPaHH6_Kwscw%40mail.gmail.com
> 
> .
>
-- 
Oussama Chafiqui

-- 
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/CAPvcp%2BUVnw%2BncKDhkOA2dma%3Dd9bw%3DAtgjNy6cCcPZAxnZBVmOA%40mail.gmail.com.


Re: unable Integrating Djongo 1.3.1 with django 2.2.10

2020-03-20 Thread Sam Chaffy
Install pymongo package by > pip install pymongo


or, better practice

make a virtual environment directory where all your dependencies will be 
installed.


> python -m venv  myvenv (assuming you name it myvenv)

If you are in Windows 

activate virtual environment with:

> cd in directory where you created virtual environment

> myvenv\Scripts\activate

Make sure you have pip installed

> pip install pymongo

then you won't have this error. 


On Thursday, March 19, 2020 at 1:35:52 PM UTC-7, Eswar Subramanyam wrote:
>
> Hi 
>
> I opted for Djongo to take advantage of Django ORM with MongoDB..
>
> but while starting the server, i get the following error
>
> AppData\Roaming\Python\Python38\site-packages\django\db\utils.py", line 
> 121, in load_backend
> raise ImproperlyConfigured(
> django.core.exceptions.ImproperlyConfigured: 'djongo' isn't an available 
> database backend.
> Try using 'django.db.backends.XXX', where XXX is one of:
> 'mysql', 'oracle', 'postgresql', 'sqlite3'
>
>
> I have lost a lot of time trying to figure out, and came to a conclusion 
> that i cant use ORM on Mongo DB.
>
> Have someone got a clue on what going wrong ?
>
> I dump also all the installed packages
>
> Thanks for your help/
>
> Package   Version
> - --
> asgiref   3.2.5
> bson  0.5.8
> certifi   2019.11.28
> chardet   3.0.4
> dataclasses   0.6
> Django2.2.11
> django-menu-generator 1.0.4
> djongo1.3.1
> idna  2.9
> mongoengine   0.19.1
> pip   20.0.2
> pymango   0.1.1
> pymongo   3.10.1
> python-dateutil   2.8.1
> pytz  2019.3
> requests  2.23.0
> setuptools41.2.0
> six   1.14.0
> sqlparse  0.2.4
> urllib3   1.25.8
>

-- 
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/c6142786-1e5e-4230-b6f7-4607035cb3b6%40googlegroups.com.