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 8784957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:14:05+00:00 2026-06-13T21:14:05+00:00

Debug show me that: comments = Comment.get_for_intention(id) is: {QuerySet} Unable to get repr for

  • 0

Debug show me that:

comments = Comment.get_for_intention(id)

is:

{QuerySet} Unable to get repr for class ‘django.db.models.query.QuerySet’

Comment model:

class Comment(models.Model):
    user = models.ForeignKey(User)
    intention = models.ForeignKey(Intention)
    text = models.TextField()
    created = models.DateTimeField(default=datetime.datetime.now())

    @staticmethod
    def get_for_intention(intention_id):
        return Comment.objects.filter(intention=intention_id)[:10]

I have no idea what I am doing wrong. Could someone give me any advice?

  • 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-06-13T21:14:06+00:00Added an answer on June 13, 2026 at 9:14 pm

    I think problem is because of intention. it is foreign key and you want to use all intention object.

    You should use

    def get_fot_intention(self):
       return self.Intention.intention_id
    

    if you want to take comments only you dont have to define get_fot_intention and you dont have to use intention_id , just use intention object. You can use this for example:

    def intention_detail(request,slug=None):
    
        intention = get_object_or_404(Intention,slug=slug)
        comments = Comment.objects.filter(intention=intention) 
    

    but you have to slug field in intention.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For debug use I want to show the type of a variable in Google
I will show a UITextView with all messages from the NSLog in my debug
The debug build of some code utilizing SFHFKeychainUtils that is working without complaint on
I'm struggling to debug an application that builds as a Sling bundle. The application
We are developing a custom textual DSL, that will ultimately get integrated into Visual
I am adding some functionality to an existing application to show debug info. When
Debug.WriteLine(ucFollow.Visible); ucFollow.Visible = true; Debug.WriteLine(ucFollow.Visible); ucFollow is a custom UserControl, nothing fancy. The above
Debug HTTP is easy, you have all sort of tools to do it (like
Debug mode in MigLayout is quite powerful option for development and debugging. It is
Debug.WriteLine(Timer is high-resolution: {0}, Stopwatch.IsHighResolution); Debug.WriteLine(Timer frequency: {0}, Stopwatch.Frequency); Result: Timer is high-resolution: True

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.