How are you querying it? Is it from python script or database query?
If it is a SQL database like postgres, you can join the two tables using
the "JOIN" syntax . You join the two tables using their ids

*SELECT **
*FROM profile p*
*JOIN skill s ON s.user_profile = p.id <http://p.id>*

NB: You can customize the SELECT to select specific columns from both tables
*AJAYI Sunday *
(+234) 806 771 5394
*[email protected] <[email protected]>*



<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Mar 12, 2020 at 9:55 AM Soumen Khatua <[email protected]>
wrote:

> Hi Folks,
> My profile model is Foreignkey in another model called Skill,Now I fetch
> all the data of this user from Profile table(model) and store it into a
> variable called user_profile and now my query is I want to fetch the data
> of the Skill table(model) by using this variable.How I can do that??
>
> Thank you in advance
>
>
> Regards,
> Soumen
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WbQEQGF1U4UVKT4kJBWCsHJ%2BC5JX-_u-UpQREcMCuV6XA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPUw6WbQEQGF1U4UVKT4kJBWCsHJ%2BC5JX-_u-UpQREcMCuV6XA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKYSAw2tFN0aENXu8vUWWNoWamUis4i6xS36Vo%2B%3Di5XzkFNr5A%40mail.gmail.com.

Reply via email to