Mysql Query:
SELECT * FROM
`user_profiles` WHERE `user_profiles`.`user_id` = 4
Django ORM QuerySet Syntax:
user_profile_obj = UserProfile.objects.get(user=request.user)
Keys Used :
Django: objects,get
Mysql: select,from,where
Note:
- UserProfile is the class in model
- request.user value is 4
No comments:
Post a Comment