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

  • Home
  • SEARCH
  • 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 7750729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:21:55+00:00 2026-06-01T11:21:55+00:00

In this scenario, I have 2 or more models: class Store(models.Model): name = models.CharField(max_length

  • 0

In this scenario, I have 2 or more models:

class Store(models.Model):
    name = models.CharField(max_length = 100)
    homepage = models.URLField(verify_exists = False)
    ....

class Product(models.Model):
    display = models.BooleanField(default = True)
    created = models.DateTimeField(auto_now_add = True)
    changed = models.DateTimeField(auto_now_add = True, auto_now = True)
    ....

These each need a different comment model/form. For instance:

  • the product comment I’d like to have some extra info like product rating, pros, cons, etc.
  • But for the store, I would like to have some fields like rate customer support, rate communication/response, boolean if shipping prices reasonable, etc.

Both those models would be subclassing the contrib Comments model so it is compatible with the existing admin and comments template tags.

However, it seems that the built-in comments settings from Django is fairly rigid, only allowing customisation of one model/form by using the get_model() and get_form() methods.

I’ve got it working properly in both cases using a different method, but it involves a great deal of code duplication and it’s rather impractical if I were to add a 3rd or 4th type of comment subclass.

Does anyone know of a better way of doing this?
I’ve tried searching StackOverflow but no results seem to resemble this use case.

  • 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-01T11:21:56+00:00Added an answer on June 1, 2026 at 11:21 am

    I ended up implementing an extra model which sits above the current Django contrib comments module.

    The comments system is now much more flexible, allowing a variety of new functionality such as:

    • First and foremost, allows you to associate various comment models to specific target models
    • Link your comment models directly to the target model in ORM without any hacks like in the contrib comment module
    • Allows custom validation in forms and doesn’t raise 500 if fields are invalid
    • Display comment previews in the current page, without having to redirect the user to a blank page
    • Easier to implement pre-post comment events WITHOUT using signals
    • Hooks into the contrib comment system, making it compatible with existing database/plugins/template tags/template filters
    • Maintains support for the comments “comment_was_posted” signal
    • Easy to theme. The model names are included in the form class names so you can specify styles for each forms.
    • Easy to override templates (See below)

    This module is available at github if you’re interested in helping with development and/or testing.

    It is compatible with the contrib comments system, so many of the existing tags still work and you don’t have to redo all your existing templates. Please see the documentation for further information.

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

Sidebar

Related Questions

Please Consider this scenario: We have a base class called clsMain : class clsMain
I have this scenario. I want group on Country and Category. A store can
I have a model that looks something like this: public class SampleModel { public
Imagine this scenario: You have a desktop and a laptop. The desktop has a
I have this scenario where I would like to redirect my domains using the
Consider this scenario. I have my own website, that I use as my identifier,
Consider this scenario. I have an object, lets call it.... Foo. Foo raises a
The architecture for this scenario is as follows: I have a table of items
I was wondering how other people implemented this scenario. I have an internal rails
Maybe it's not worth worrying about in this scenario, but lets say you have

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.