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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:01:58+00:00 2026-06-12T08:01:58+00:00

I have custom plugin with the next structure. models.py looks like class ProductDescription(models.Model): name

  • 0

I have custom plugin with the next structure.
models.py looks like

    class ProductDescription(models.Model):
        name = models.CharField(max_length=30)
        icon = models.ImageField(upload_to="installation_image", blank=True, null=True)
        description = models.TextField(blank=True, null=True)

        def __unicode__(self):
            return self.name

    class ProductPlugin(CMSPlugin):
            product = models.ForeignKey(ProductDescription)

    class ProductSpecification(models.Model):
        product = models.ForeignKey(ProductDescription)
        specification = models.TextField(blank=True, null=True)

    class InstallationStep(models.Model):
        product = models.ForeignKey(ProductDescription)
        step = models.TextField(blank=True, null=True)
        image = models.ImageField(upload_to="installation_image", blank=True, null=True)

admin.py

    class InstallationStepInline(admin.StackedInline):
        model = InstallationStep
        extra = 0

    class ProductSpecificationInline(admin.StackedInline):
        model = ProductSpecification
        extra = 0

    class DeviceAdmin(admin.ModelAdmin):
        inlines = [ProductSpecificationInline ,
        InstallationStepInline]

    admin.site.register(ProductDescription, DeviceAdmin)

and cms_plugin.py

    class CMSProductPlugin(CMSPluginBase):
        model = ProductPlugin
        name = _("Product Description")
        render_template = "product_description.html"

        def render(self, context, instance, placeholder):
            context.update({
                'product':instance.product,
                'object':instance,
                'placeholder':placeholder
            })

            return context

    plugin_pool.register_plugin(CMSProductPlugin)

So, each product could have none or several specifications and installation steps.
And the question is how can I render those specification and steps in template?
I know how to get data for the ProductDescription class. It is like

  <div class="test">{{ product.description }}</div>

but how can I extract other data? i guess it should be something like

    {% for steps in product.InstallationStep.all %}
        <div class="test">{{ steps.step }}</div>
    {% endfor %}

but it does not do anything =(

Thanks in advance!

  • 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-12T08:01:59+00:00Added an answer on June 12, 2026 at 8:01 am

    I think you just need:

    product.InstallationStep_set.all
    

    Since you have a ForeignKey in the InstallationStep model class, django puts the _set method into the referenced class.

    You can experiment with this in the django shell. Templates will fail silently if you try doing foo.bar and there’s no bar in foo…

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

Sidebar

Related Questions

In my custom Eclipse plugin, I have the fully qualified class name of a
I have a custom plugin, with a constructor like this: (function($){ $.fn.extend({ myplugin: function(options)
I have a webpage that uses a custom plugin, like this: <embed height=0 width=0
I have a custom jQuery plugin which binds a change event to a form
I am using jquery validation plugin for form validation. I have added a custom
I have a custom WordPress plugin I made and it doesn't seem to work
I have a custom WordPress plugin that works fine on my local dev machine,
I have a custom plugin that was made for powerpoint and has a functionality
I have a custom OS X NPAPI plugin built as universal 32 bit bundle.
So I have this jQuery Validation plugin, and it has a custom success message.

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.