Re: Pulling data from two table

2015-01-08 Thread sum abiut
Hi Vijay, Thanks very much for your assistance and recommendation. i will get back to you if needed more help. Sum On Fri, Jan 9, 2015 at 3:15 PM, Vijay Khemlani wrote: > Well, you can do something like this > > one_leave = leave.objects.get(pk=1) # Asuming there is a leave with pk 1 > print o

Re: Pulling data from two table

2015-01-08 Thread Vijay Khemlani
Well, you can do something like this one_leave = leave.objects.get(pk=1) # Asuming there is a leave with pk 1 print one_leave.staff.First_Name# Automatically joins with the staff table to print the first name of the associated staff Or something like this one_staff = staff.objects.get(pk=1)

Re: Pulling data from two table

2015-01-08 Thread sum abiut
Hi, i am trying to pull out all the information in both model. i can pull out information in each table but i am a but confuse in joining the two tables together. something like NATURAL JOIN in mysql. Cheers, On Fri, Jan 9, 2015 at 12:07 PM, Vijay Khemlani wrote: > OK, what query are you tryin

Re: Pulling data from two table

2015-01-08 Thread Vijay Khemlani
OK, what query are you trying to make? or what information do you want to display? On Thu, Jan 8, 2015 at 6:50 PM, sum abiut wrote: > Hi Vijay, > Thank you for your email. Here is my models. i want to be able to pull out > all the data from both table and display them. i am a bit new to django >

Re: Pulling data from two table

2015-01-08 Thread sum abiut
Hi Vijay, Thank you for your email. Here is my models. i want to be able to pull out all the data from both table and display them. i am a bit new to django still finding my way out. class staff(models.Model): First_Name = models.CharField(max_length=45) Last_Name =models.CharField(max_le

Re: Pulling data from two table

2015-01-08 Thread Vijay Khemlani
Please be more specific in your question, how are these tables related? what models are they associated with? On Thu, Jan 8, 2015 at 6:01 PM, sum abiut wrote: > Hi, > can someone please help. i am trying to pull data from two table in django > and display the results. can someone please point me