Malcolm, I tried you code but it's still not displaying any of the members for that minute instance. Below is the code for my url, view, model, and template
url (r'^csi/rso/(minutes)/(\w{1,100})/$', 'mysite.rso.views_rso.showminutespage'), ///////// view def showminutespage(request, thetable, partitle): thetabinfo = eval(thetable).objects.get(id=partitle) return render_to_response(thetable + '_detail.html', {'thetabinfo': thetabinfo, 'leftnav': leftnav.objects.all(), 'secondstuff': minutes.lmembers.all()}) //////////////// model class members(models.Model): title = models.CharField(maxlength=100) names = models.CharField(maxlength=100) email = models.EmailField() city = models.CharField(maxlength=100) state = models.USStateField() image = models.ImageField(upload_to='c:/django/site_media/') class minutes(models.Model): date = models.DateField() lasted = models.IntegerField() lmembers = models.ManyToManyField(members) body = models.TextField(maxlength=5000) //////////////////// template {% for x in secondstuff %} {{ x }} {% endfor %} /////////////////////// I did notice that when I opened my minutes table the column lmembers was null for every row. When i open my rso_minutes_lmembers I do have three records that contain the id number of the minutes instance. On May 6, 8:17 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2007-05-06 at 13:46 -0700, gsmith wrote: > > I have the following tables > > > class members(models.Model): > > title = models.CharField(maxlength=100) > > names = models.CharField(maxlength=100) > > email = models.EmailField() > > city = models.CharField(maxlength=100) > > state = models.USStateField() > > image = models.ImageField(upload_to='c:/django/site_media/') > > > class minutes(models.Model): > > date = models.DateField() > > lasted = models.IntegerField() > > lmembers = models.ManyToManyField(members) > > body = models.TextField(maxlength=5000) > > > My minutes table has a 'ManyToManyField' called lmembers. I have > > created a minutes page that is supposed to show all the members tied > > to a minutes instance. I am not sure how to display the results of my > > 'ManyToManyField' in my template. I know how to show the other fields > > in minutes by {{ minutes.date }}, {{ minutes.lasted }}, etc... > > However, I don't know how to show the members tied to that minutes > > class. > > The contents of lmembers is always going to be something that behaves > like a sequence (since there are "many" of them, by definition). So you > display them by iterating over that sequence. For example: > > {{ for member in minutes.lmembers.all }} > {{ member }} > {{ endfor }} > > The thing that most people forget or don't notice initially here is the > need for the call to the all() method to retrieve the collection that > you can iterate over. > > Regards, > Malcolm- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---