Re: Django tutor.

2022-07-27 Thread Cisco Gmail
Honestly this Django community is cool, you can ask any question.
What do you want to do ? Django rest API or 
Django in full stack ?

Bien cordialement,

Julien Munar.


> Le 27 juil. 2022 à 18:52, nick washington  a écrit :
> 
> 
> Cool
> 
>> On Wed, Jul 27, 2022, 18:19 Md Aminul Haque  
>> wrote:
>> Show Django Official website 
>> 
>> Sent from my Huawei phone
>> 
>> 
>>  Original message 
>> From: pediah wanmi 
>> Date: Wed, Jul 27, 2022, 5:22 PM
>> To: django-users@googlegroups.com
>> Subject: Django tutor.
>> I am a djongk intermediary, please can I
>>  get a tutor?
>> 
>> -- 
>> 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/CABd3QauHU4wdePFvGsY3V-GSO8Ly37zMqgmcV2tyDV56Sw81Tw%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/dun4asa4bdzxtzjwj4-3qjf8j-urdlt42i1gaiz8sfaua9chke-albmexg650pjd8w9no-mjoqq4cguikj-bk51if-em08lf-jw7g21idl3xdyre5d8-v97n9i-lanxvz6om99w-w4oi0-dog49dbovagl.1658932720646%40email.android.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/CAETXisem7FDUpRd1VZt7kFu2VhdNp7XTUU0eLSAMJrhnFOv-Wg%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/C80904A8-FC3E-4235-BD2B-317560CC7B6A%40gmail.com.


How to create current user field in dango rest framework

2022-07-27 Thread Ashok garsulla
Please tell me how can I create current User in dango Rest Framework

-- 
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/21baa025-b118-4f15-bba3-52f4875c1d33n%40googlegroups.com.


Re: Django tutor.

2022-07-27 Thread Ing.Daniel Bojorge
🌋 👉 #Ruta #Aprendizaje #Desarrollo #Web con #Python 🐍 y #Django👈 Desde
💰 USD 9.99 | 🚫 Válido hasta el 04 de Agosto 👇

👉 https://tinyurl.com/debs-promo-hasta-20220804 👈

💪Te dejo la lista de los cursos.

💥Cupón JULIO-2022-2 y JULIO-2022-3

🔹Desarrollo Web con Sistema de Compra y Facturación usando Django de
Python.
🔹Despliega Aplicaciones Django (o Flask) en varios entornos (Apache, Nginx)
🔹Domina el ORM de Django.
🔹Desarrolla Rest Api con Django
🔹Vue (FrontEnd) + Django (BackEnd)
🔹Replicación de Datos, cualquier BD (relacional) y cualquier Sistema
Operativo
🔹Curso Desarrollo Web con Django (básico)
🔹Web Api con NetCore 2.0
🔹Programación en Capas con ADO Net (Web Forms y Win Forms)
🔹Entity FrameWork para Principiantes
🔹SQL Server y Replicación


Dios L@s Bendiga

Saludos,



[image: --]

daniel.bojorge
[image: http://]about.me/daniel.bojorge

 [image: snake]*Curso Desarrollo Web con Python usando Django 2.2 Para
Principiantes con Descuento 95%    *[image:
snake]
*WebService RestFul API con Python usando Django RestFrameWork*

*Fácil Replicación de Cualquier Base de Datos y/o Sistema Operativo*

*Programación en Capas (Web y Escritorio)* 
Mi Blog 
Nicaragua

"Si ustedes permanecen unidos a mí, y si permanecen fieles a mis
enseñanzas, pidan lo que quieran y se les dará.
(Juan 15:7 DHH)
Bendito el varón que se fía en el SEÑOR, y cuya confianza es el SEÑOR.
(Jeremías 17:7 RV2000)




El mié, 27 jul 2022 a las 12:30, Lalit Suthar ()
escribió:

> https://github.com/lalit97/django-developer-resources
>
> On Wed, 27 Jul 2022 at 22:22, nick washington  wrote:
>
>> Cool
>>
>> On Wed, Jul 27, 2022, 18:19 Md Aminul Haque 
>> wrote:
>>
>>> Show Django Official website
>>>
>>> Sent from my Huawei phone
>>>
>>>
>>>  Original message 
>>> From: pediah wanmi 
>>> Date: Wed, Jul 27, 2022, 5:22 PM
>>> To: django-users@googlegroups.com
>>> Subject: Django tutor.
>>>
>>> I am a djongk intermediary, please can I
>>>  get a tutor?
>>>
>>> --
>>> 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/CABd3QauHU4wdePFvGsY3V-GSO8Ly37zMqgmcV2tyDV56Sw81Tw%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/dun4asa4bdzxtzjwj4-3qjf8j-urdlt42i1gaiz8sfaua9chke-albmexg650pjd8w9no-mjoqq4cguikj-bk51if-em08lf-jw7g21idl3xdyre5d8-v97n9i-lanxvz6om99w-w4oi0-dog49dbovagl.1658932720646%40email.android.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/CAETXisem7FDUpRd1VZt7kFu2VhdNp7XTUU0eLSAMJrhnFOv-Wg%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/CAGp2JVFe%2BfKcgdOnkOYzao%2BBhiAKCoyQ1ihN4UEthCoqQwfwbQ%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/CAMQeQjZ

Re: Django tutor.

2022-07-27 Thread Lalit Suthar
https://github.com/lalit97/django-developer-resources

On Wed, 27 Jul 2022 at 22:22, nick washington  wrote:

> Cool
>
> On Wed, Jul 27, 2022, 18:19 Md Aminul Haque 
> wrote:
>
>> Show Django Official website
>>
>> Sent from my Huawei phone
>>
>>
>>  Original message 
>> From: pediah wanmi 
>> Date: Wed, Jul 27, 2022, 5:22 PM
>> To: django-users@googlegroups.com
>> Subject: Django tutor.
>>
>> I am a djongk intermediary, please can I
>>  get a tutor?
>>
>> --
>> 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/CABd3QauHU4wdePFvGsY3V-GSO8Ly37zMqgmcV2tyDV56Sw81Tw%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/dun4asa4bdzxtzjwj4-3qjf8j-urdlt42i1gaiz8sfaua9chke-albmexg650pjd8w9no-mjoqq4cguikj-bk51if-em08lf-jw7g21idl3xdyre5d8-v97n9i-lanxvz6om99w-w4oi0-dog49dbovagl.1658932720646%40email.android.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/CAETXisem7FDUpRd1VZt7kFu2VhdNp7XTUU0eLSAMJrhnFOv-Wg%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/CAGp2JVFe%2BfKcgdOnkOYzao%2BBhiAKCoyQ1ihN4UEthCoqQwfwbQ%40mail.gmail.com.


Re: ForeignKey Reverse Relation Fail

2022-07-27 Thread Malik Rumi
Thanks, but the recursive foreignkey *is* a one to many relationship...
unless you're talking about something else?
*“None of you has faith until he loves for his brother or his neighbor what
he loves for himself.”*


On Wed, Jul 27, 2022 at 10:16 AM Ammar Mohammed 
wrote:

> Hi
> Have you tried using OneToMany relationship ?
> On 27 Jul 2022 12:18, "Malik Rumi"  wrote:
>
>> I have a model with a recursive foreign key to 'self'. This is intended
>> to model a parent child
>> relation among instances. The forward relation, on a field called
>> 'childof', works as expected.
>> The reverse relation, using the related_name 'parent', comes up as a
>> RelatedManager,
>> again as expected. However, parent.count(), parent.all(), etc., always
>> give me the "Manager is
>> not accessible on instances" error. Many of these parent instances will
>> themselves also be a
>> childof some other instance, and apparently, that's my problem. I don't
>> know how to make Django
>> recognize the dual nature of some instances. Is there a way to hack the
>> RelatedManager to fix this?
>>
>> I am not getting any accessor errors from manage.py check.
>>
>> I posted this to Django Forum, but the respondent was not able to
>> duplicate my issue - i.e.,
>> he said it worked as expected for him. :-(
>>
>> I saw a suggestion to use an explicit junction table on Stack Overflow,
>> but making a round trip - or two - to an external table seems like an
>> awful lot of overhead for this situation.
>>
>> If instead of a junction table, if I made an explicit parentto field on
>> the model, would that work?
>> Presumably the related name on the childof field would still fail like it
>> does now,
>> but I would instead have the explicit parent field to work with. I still
>> would not have the
>> automatic reverse relation, and I would have to come up with a script to
>> fill in the parentto
>> field, but that might solve my problem:
>> # pseudocode
>> family = c.itertools.groupby(instance.childof)
>> family = c.pandas.groupby(instance.childof)
>> for f in family:
>> pop = c.objects.get(instance.childof)
>> OR
>> pop = instance.childof
>> c.objects.update(pop.parentto=f) # where parentto is a Postgresql
>> ArrayField
>> OR #
>> https://docs.djangoproject.com/en/4.0/ref/models/relations/#django.db.models
>> .fields.related.RelatedManager.add:
>> >>> b = Blog.objects.get(id=1)
>> >>> e = Entry.objects.get(id=234)
>> >>> b.entry_set.add(e) # Associates Entry e with Blog b
>> SEE ALSO:
>> https://docs.djangoproject.com/en/4.0/topics/db/examples/many_to_one/
>>
>> If I did this two field hack, then I don't really need either one to be
>> ForeignKeys any more,
>> do I? They could be a CharField and an ArrayField, couldn't they? That
>> breaks the extended
>> lookup chain - but I don't have that now, anyway - or at least, I only
>> have it in one direction.
>>
>> --
>> 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/3555d391-9c9e-440f-a603-103c9ccdc858n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/xGtwxhx2Nrw/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAHs1H7tjom_GRucP8Dx3x8AzQobS4GCva8a0nuN3bEWVB2Taqw%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/CAKd6oBxYfR6ntzGe8EGbnm0z6%2BxjiJDP5nmg9kF5kuB9pCZiEg%40mail.gmail.com.


Re: Django tutor.

2022-07-27 Thread nick washington
Cool

On Wed, Jul 27, 2022, 18:19 Md Aminul Haque 
wrote:

> Show Django Official website
>
> Sent from my Huawei phone
>
>
>  Original message 
> From: pediah wanmi 
> Date: Wed, Jul 27, 2022, 5:22 PM
> To: django-users@googlegroups.com
> Subject: Django tutor.
>
> I am a djongk intermediary, please can I
>  get a tutor?
>
> --
> 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/CABd3QauHU4wdePFvGsY3V-GSO8Ly37zMqgmcV2tyDV56Sw81Tw%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/dun4asa4bdzxtzjwj4-3qjf8j-urdlt42i1gaiz8sfaua9chke-albmexg650pjd8w9no-mjoqq4cguikj-bk51if-em08lf-jw7g21idl3xdyre5d8-v97n9i-lanxvz6om99w-w4oi0-dog49dbovagl.1658932720646%40email.android.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/CAETXisem7FDUpRd1VZt7kFu2VhdNp7XTUU0eLSAMJrhnFOv-Wg%40mail.gmail.com.


Re: Best digital ocean plan for a production server

2022-07-27 Thread Ram
Hi Abdul,

Thank you for your suggestion, but since you mentioned Docker image in your
earlier email, I've listed all my software stack that is required for our
Web Application. So I'm looking for any managed solution from any provider
that can help us to focus only on coding. It does not have to be Kubernetes
solution and anything is fine as long as we don't have to spend time on
infrastructure and yet scalable & feasible.

Also, along with the previous list of software stack, we are planning to
develop Django REST APIs and a mobile app using Flutter which could add
additional software to the list.

I explored both Digital Ocean and Heroku so far and I'm struggling to find
the right solution from both of them. So I emailed them to see what they
can recommend to us.

Best regards,
~Ram

On Sun, Jul 24, 2022 at 8:30 PM Abdul Qoyyuum 
wrote:

> Not sure what you mean. All of those can be in separate docker images to
> build (except for 11 and 13) but have to be docker-composed properly. But
> since you're moving to Docker images, you can then instead deploy to any
> Kubernetes cluster and scale with X number of nodes. Even better if you
> want to test and make sure all of the deploy settings work properly each
> time with Terraform but that's my opinion.
> https://www.digitalocean.com/community/questions/best-practices-to-deploy-docker-on-digitalocean-using-terraform
>
> On Sun, Jul 24, 2022 at 1:22 AM Ram  wrote:
>
>> Thank you all for your input. I would like to sign up for a plan which
>> can let us focus only on coding and still scalabile, but my concern is our
>> application requires following:
>>
>> 1. Linux OS
>> 2. Postgres
>> 3. Python 3.10
>> 4. Django latest
>> 5. Vue.js
>> 6. Gunicorn
>> 7. Nginx
>> 8. Let's Encrypt or any SSL
>> 9. Redis
>> 10. Celery
>> 11. Github
>> 12. Jenkins CI/CD
>> 13. Support for API: Stripe, Twillio, Google and etc.
>>
>> If these can be packaged into a docker image that would be great. I know
>> some of them cannot be in Docker image. I'm planning to check this with
>> both Digital Ocean and Heroku anyway, but I wanted to understand experts
>> advice in this community.
>>
>> Best regards,
>> ~Ram
>>
>> On Wed, Jul 13, 2022 at 12:24 AM Abdul Qoyyuum <
>> aqoyy...@cardaccess.com.au> wrote:
>>
>>> I prefer Heroku and deploying Django as a docker image to Heroku. Less
>>> maintenance, worry less about server setups and focus more on code than
>>> anything else (i.e. serverless). Start with a hobby plan and if able to get
>>> customers, then start paying for scalability features.
>>>
>>> On Sunday, July 10, 2022 at 11:21:00 AM UTC+8 ram.mu...@gmail.com wrote:
>>>
 Hi,

 We are planning to launch our application in production once all the
 testing is completed after deployment to our development server. We are
 using Jenkins CI automation to deploy the code to the development server
 and we will do the same in production server too, but we are currently
 doing a feasibility study to understand which options are good for Django
 web application for both Web and Mobile app.

 If anyone in this Django users community is currently on any Digital
 Ocean's production server plan, could you share some details and
 suggestions.

 Best regards,
 ~Ram

>>> --
>>> 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/be3bb62c-7ce7-47c6-8bc1-80951927712dn%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/C_v8NaMOx4Q/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/CA%2BOi5F0zneD-%2BmKb8dZcV8iu-5pryw2Yt9djnjJisWr6k381ow%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Abdul Qoyyuum Bin Haji Abdul Kadir
> HP No: +673 720 8043
>
> --
> 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/CAA3DN%3DW03Tpj%3Dxs61o5cNUCn21bOk2xjXuemArcAG4P0oiChkw%40mail.g

Re:Django tutor.

2022-07-27 Thread Md Aminul Haque
Show Django Official website Sent from my Huawei phone Original message From: pediah wanmi Date: Wed, Jul 27, 2022, 5:22 PMTo: django-users@googlegroups.comSubject: Django tutor.I am a djongk intermediary, please can I get a tutor?



-- 
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/CABd3QauHU4wdePFvGsY3V-GSO8Ly37zMqgmcV2tyDV56Sw81Tw%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/dun4asa4bdzxtzjwj4-3qjf8j-urdlt42i1gaiz8sfaua9chke-albmexg650pjd8w9no-mjoqq4cguikj-bk51if-em08lf-jw7g21idl3xdyre5d8-v97n9i-lanxvz6om99w-w4oi0-dog49dbovagl.1658932720646%40email.android.com.


Re: ForeignKey Reverse Relation Fail

2022-07-27 Thread Ammar Mohammed
Hi
Have you tried using OneToMany relationship ?
On 27 Jul 2022 12:18, "Malik Rumi"  wrote:

> I have a model with a recursive foreign key to 'self'. This is intended to
> model a parent child
> relation among instances. The forward relation, on a field called
> 'childof', works as expected.
> The reverse relation, using the related_name 'parent', comes up as a
> RelatedManager,
> again as expected. However, parent.count(), parent.all(), etc., always
> give me the "Manager is
> not accessible on instances" error. Many of these parent instances will
> themselves also be a
> childof some other instance, and apparently, that's my problem. I don't
> know how to make Django
> recognize the dual nature of some instances. Is there a way to hack the
> RelatedManager to fix this?
>
> I am not getting any accessor errors from manage.py check.
>
> I posted this to Django Forum, but the respondent was not able to
> duplicate my issue - i.e.,
> he said it worked as expected for him. :-(
>
> I saw a suggestion to use an explicit junction table on Stack Overflow,
> but making a round trip - or two - to an external table seems like an
> awful lot of overhead for this situation.
>
> If instead of a junction table, if I made an explicit parentto field on
> the model, would that work?
> Presumably the related name on the childof field would still fail like it
> does now,
> but I would instead have the explicit parent field to work with. I still
> would not have the
> automatic reverse relation, and I would have to come up with a script to
> fill in the parentto
> field, but that might solve my problem:
> # pseudocode
> family = c.itertools.groupby(instance.childof)
> family = c.pandas.groupby(instance.childof)
> for f in family:
> pop = c.objects.get(instance.childof)
> OR
> pop = instance.childof
> c.objects.update(pop.parentto=f) # where parentto is a Postgresql
> ArrayField
> OR # https://docs.djangoproject.com/en/4.0/ref/models/
> relations/#django.db.models
> .fields.related.RelatedManager.add:
> >>> b = Blog.objects.get(id=1)
> >>> e = Entry.objects.get(id=234)
> >>> b.entry_set.add(e) # Associates Entry e with Blog b
> SEE ALSO: https://docs.djangoproject.com/en/4.0/topics/db/examples/
> many_to_one/
>
> If I did this two field hack, then I don't really need either one to be
> ForeignKeys any more,
> do I? They could be a CharField and an ArrayField, couldn't they? That
> breaks the extended
> lookup chain - but I don't have that now, anyway - or at least, I only
> have it in one direction.
>
> --
> 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/3555d391-9c9e-440f-a603-103c9ccdc858n%
> 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/CAHs1H7tjom_GRucP8Dx3x8AzQobS4GCva8a0nuN3bEWVB2Taqw%40mail.gmail.com.


Re: Django tutor.

2022-07-27 Thread Ammar Mohammed
Hi
Yes of course
Available every weekend !

Ammar Mohammed
On 27 Jul 2022 15:49, "pediah wanmi"  wrote:

> I am a djongk intermediary, please can I
>  get a tutor?
>
> --
> 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/CABd3QauHU4wdePFvGsY3V-GSO8Ly37zMqgmcV2tyDV56Sw81Tw%
> 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/CAHs1H7t9Uh35%2B8pdsN1JjMLqphkimWaHwoRusWuhx8mndgsZLQ%40mail.gmail.com.


Re: Django tutor.

2022-07-27 Thread Saad Olamilekan
You always consult, anytime you need help...

On Wed, Jul 27, 2022, 2:49 PM pediah wanmi  wrote:

> I am a djongk intermediary, please can I
>  get a tutor?
>
> --
> 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/CABd3QauHU4wdePFvGsY3V-GSO8Ly37zMqgmcV2tyDV56Sw81Tw%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/CAP%2BiQEYyo9a%2BFu%2BjDzxGh6snMH2sNg30jecQQYW1sYTwWXWhcA%40mail.gmail.com.


Django tutor.

2022-07-27 Thread pediah wanmi
I am a djongk intermediary, please can I
 get a tutor?

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


ForeignKey Reverse Relation Fail

2022-07-27 Thread Malik Rumi
I have a model with a recursive foreign key to 'self'. This is intended to 
model a parent child
relation among instances. The forward relation, on a field called 
'childof', works as expected.
The reverse relation, using the related_name 'parent', comes up as a 
RelatedManager,
again as expected. However, parent.count(), parent.all(), etc., always give 
me the "Manager is
not accessible on instances" error. Many of these parent instances will 
themselves also be a
childof some other instance, and apparently, that's my problem. I don't 
know how to make Django
recognize the dual nature of some instances. Is there a way to hack the 
RelatedManager to fix this?

I am not getting any accessor errors from manage.py check.

I posted this to Django Forum, but the respondent was not able to duplicate 
my issue - i.e.,
he said it worked as expected for him. :-(

I saw a suggestion to use an explicit junction table on Stack Overflow, but 
making a round trip - or two - to an external table seems like an
awful lot of overhead for this situation.

If instead of a junction table, if I made an explicit parentto field on the 
model, would that work?
Presumably the related name on the childof field would still fail like it 
does now,
but I would instead have the explicit parent field to work with. I still 
would not have the
automatic reverse relation, and I would have to come up with a script to 
fill in the parentto
field, but that might solve my problem:
# pseudocode
family = c.itertools.groupby(instance.childof)
family = c.pandas.groupby(instance.childof)
for f in family:
pop = c.objects.get(instance.childof)
OR
pop = instance.childof
c.objects.update(pop.parentto=f) # where parentto is a Postgresql ArrayField
OR # 
https://docs.djangoproject.com/en/4.0/ref/models/relations/#django.db.models
.fields.related.RelatedManager.add:
>>> b = Blog.objects.get(id=1)
>>> e = Entry.objects.get(id=234)
>>> b.entry_set.add(e) # Associates Entry e with Blog b
SEE ALSO: 
https://docs.djangoproject.com/en/4.0/topics/db/examples/many_to_one/

If I did this two field hack, then I don't really need either one to be 
ForeignKeys any more,
do I? They could be a CharField and an ArrayField, couldn't they? That 
breaks the extended 
lookup chain - but I don't have that now, anyway - or at least, I only have 
it in one direction.

-- 
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/3555d391-9c9e-440f-a603-103c9ccdc858n%40googlegroups.com.