Hi,

 I ve just begun playing with Django, primarily because I like Python
 and was looking for a quick web development kit ( bah to Ruby and
 Rails ). However I cant figure something out.

 If I have 2 tables A and B.

 A                                  B
----------               --------------
     ID                          ID
     Name                    AID
     Variable               Variables

 I can produce a page of B like this
         ID         AID          Variables

 but I actually want
       ID           Name           Variables

 How could I do this using Django, I m guessing its in views.py.

 Many Thanks in advance

 Nathan

 Below is essentially A (Contig) and B (Contig_Hit)  (models.py) and the
 views.py

 class Contig(models.Model):
     seq_id = models.TextField()
     file_name =
models.FilePathField(path="/home/nathan/plan-blastdbs/contigs/",
 match="*.fa")

 class Contig_Hit(models.Model):
     src = models.ForeignKey(Query)
     src_start = models.IntegerField()
     src_end = models.IntegerField()
     src_ori = models.IntegerField()
     dest = models.ForeignKey(Contig)
     dest_start = models.IntegerField()
     dest_end = models.IntegerField()
     dest_ori = models.IntegerField()
     e_value = models.FloatField(max_digits=2, decimal_places=10)
     class Admin:
         pass


 VIEWS.PY

 def contig_seq(request, src_id):
         contigs = Contig.objects.get(id__exact = src_id )
         t = loader.get_template("contigs.html")
         c = Context ( { 'contigs':contigs } )
         return HttpResponse(t.render(c))

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to