Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 856671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:16:19+00:00 2026-05-15T08:16:19+00:00

if a have a declaration like def inside_classroom(request,classname): theclass = Classroom.objects.get(classname = classname) members

  • 0

if a have a declaration like

 def inside_classroom(request,classname):


    theclass = Classroom.objects.get(classname = classname)
    members = theclass.members.all()
c = Courses.objects.filter(classroom = theclass)


return render_to_response('classroom/inside_classroom.html', {
    'theclass': theclass,
    'c':c,
    'members':members, 

    }, 
    context_instance=RequestContext(request)) 

and i want to display all the members(of a class) in a template, how should i do it??

if i write:

{{theclass.members.all}}

the output is an empty list(though the class has some members)

How should the elements of a m2m table be displayed in a template?
thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:16:20+00:00Added an answer on May 15, 2026 at 8:16 am

    You should put members in the Context and in the template then iterate over the all the members, eg.

    {% for member in members %}
       {{ member.name }}<br />
       {{ member.xxxx }}
    {% endfor %}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to have declaration like this: void Date::get_days_name(const Date& = this) which
I have a declaration in a cpp where a function is like: virtual void
Other languages with automatic variable declaration - like Perl - have a strict mode.
In pom.xml I have declaration like this <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <executions> <execution> <id>attach-javadocs</id> <goals>
If I have VB declaration like this Public ReadOnly Property Document() As XmlDocument ,
I noticed that if I have like thing = abc thing = def thing
I have css declaration like this #first, #second, #third { font-size:1em; background: url('path/to/image') no-repeat;
I have a method with declaration like this: public void OriginalMethod(Func<object,bool> selector) And I
I have a declaration like this #include Output/PtPathWriter.h // class PtPathWriter // I've also
I have a CSS declaration like this: font-family: font1, font2, font3; where font1 is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.