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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:57:54+00:00 2026-06-06T13:57:54+00:00

I use the django comments from contrib and I have an object (entry) that

  • 0

I use the django comments from contrib and I have an object (entry) that has some comments associated with it. In my tastypie resources I have:

class CommentResource(ModelResource):
    user = fields.ForeignKey(UserResource, 'user')

class Meta:
    queryset = Comment.objects.all()
    resource_name = 'comments'
    allowed_methods = ['get']
    fields = ['comment', 'resource_uri', 'submit_date', 'user',]
    filtering = {
        'user': ALL_WITH_RELATIONS,
    }

and I can get all the comments, or filter them by user. It’s working ok.
Now I’m not sure, how would I do the same kind of filter but based on a certain entry object instead of user?

Thanks for your help.

  • 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-06T13:57:55+00:00Added an answer on June 6, 2026 at 1:57 pm

    Without knowing what is the relationship between the entry and comment it is hard to give a concrete answer but in a nut shell given that entry and comments are linked via manytomany relationship:

    • Create an EntryResource
    • Add the fields.ToManyField to the EntryResource for CommentResource
    • Add the `fields.ToOneField’ to the CommentResource for EntryResource
    • Add 'comments' : ALL_WITH_RELATIONS to the filtering dict in EntryResource

    Additionally, you could add a nested resource or a custom URL to the Comment to filter them based on an entry, but it all depends on your design.

    Almost verbatim example for the above is given in Tastypie docs here.

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

Sidebar

Related Questions

I have two django sites that use the same database and share some of
So I simply want to use the delete() from the django.contrib.comments.views.moderation module, but only
I want to use django.contrib.comments in a blogging application and customize the way the
I am trying to use a textarea form entry which I have some javascript
I am making use of Django's contrib.comments and want to know the following. Are
I am using django-registration app. and have following code in forms.py from django.contrib.auth.forms import
I wonder whether it is possible to use Django in-built comments framework for other
I am working to use django's ContentType framework to create some generic relations for
I am trying to use the dynamic django form script from http://www.djangosnippets.org/snippets/714/ The dynamic
I have 2 models I use this models to show the avatar in comments.

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.