Tuesday, July 24, 2012

Re: Retrieve Data from Database

On Tuesday, 24 July 2012 08:00:02 UTC+1, Madhu wrote:
Hi!
I am new in django, i want to get the table from one table also want the some content from another table.
Can anybody tell me how it should be done?

My module class structure is as below

class A(models.Model):
    name =models.CharField(max_length=100)
    content = models.CharField(max_length=100)
    B = models.ForeignKey(B)

class B(models.Model):
   details =models.CharField(max_length=100)

i want to display the details from table A as name, content also wants to display details from table B.


What, exactly, are you having trouble with? What have you tried?

I see you also commented on a three-year-old post of mine answering a very similar question. What about that answer did not help you?
--
DR.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/NcMMP9XhasEJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment