Problem with django reverse relation on custom user model

70 views
Skip to first unread message

Wazed Khan

unread,
Aug 18, 2022, 11:19:24 AM8/18/22
to django...@googlegroups.com
Hi 
I have created an online store project where every product has a user who is the seller.
I wanted to access seller info from the product using reverse relation "product.user.sellar"
but it returns appname.Model.None
here is my usermodel and sellar model
image.png
image.png

image.png
(there is a spelling mistake seller is sellar)

Please help me I'm kind of stuck with the problem for two days

Chetan Ganji

unread,
Aug 18, 2022, 3:00:00 PM8/18/22
to django...@googlegroups.com
Im not sure whats wrong with this one. 

Why dont you try extending using AbstractUser It has worked for me. 
https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html

Regards,
Chetan Ganji
+91-900-483-4183


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

Wazed Khan

unread,
Aug 18, 2022, 3:45:00 PM8/18/22
to django...@googlegroups.com
Thank you for your response
It worked 


subin

unread,
Aug 18, 2022, 7:09:38 PM8/18/22
to django...@googlegroups.com

subin

unread,
Aug 18, 2022, 7:11:45 PM8/18/22
to django...@googlegroups.com
Thanks again for all your help.

subin

unread,
Aug 18, 2022, 7:29:56 PM8/18/22
to django...@googlegroups.com
I will ok forward to meeting you on February 15.

--

MAHESH KUMAR

unread,
Aug 24, 2022, 9:18:35 AM8/24/22
to Django users

1. User Authentication APIs:
    1. get or create user by phone number, params: “phone_no”, response {“user_id”,”auth_token”},
    2. get or create user by email, params: “email”, response {“user_id”,”auth_token”},

how to write this i was try but i didn't get plz help sir

Wazed Khan

unread,
Aug 24, 2022, 9:45:49 AM8/24/22
to django...@googlegroups.com
Use the relationship in this way
Product -> Seller-> User
Instead Product -> User -> Seller

Reply all
Reply to author
Forward
0 new messages