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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:21:39+00:00 2026-06-07T15:21:39+00:00

So I have the standard django tutorial polls app and I made a little

  • 0

So I have the standard django tutorial polls app and I made a little blog app. Is there a simple way to add a poll to some of the blog posts but not all.

I’ve found this:

from django.models.polls import polls
from django.models.blogs import posts

def my_view(request):
        return render_to_response("template_name", {
                "poll_list" : polls.get_list(),
                "post_list" : posts.get_list(),
        }

But how do I pick which poll I want in the template and if I add it to the template won’t it show up in every post? I feel like im seriously over-thinking or under-thinking this. Any advice or links would be appreciated. Thanks.

models.py #for the blog app
class Post(models.Model):
    title = models.CharField(max_length=60)
    description = models.TextField()
    body = models.TextField()
    created = models.DateTimeField(auto_now_add=True)

    def display_mySafeField(self):
        return mark_safe(self.body)

    def __unicode__(self):
        return self.title

views.py # for blog class
def post(request, pk):
    """Single post with comments and a comment form."""
    post = Post.objects.get(pk=int  (pk))
    comments = Comment.objects.filter(post=post)
    d = dict(post=post, comments=comments, form=CommentForm(), user=request.user,
             months=mkmonth_lst())
    d.update(csrf(request))
    return render_to_response("post.html", d)

I want to add a poll to a post but not all of them.

  • 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-07T15:21:42+00:00Added an answer on June 7, 2026 at 3:21 pm

    Add something which will indicate which poll is associated to which model. You can use ForeignKey, ManyToManyField, GenericForeignKey, OneToOneField, etc and then use that indicator to get poll/s associated to post/s .

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

Sidebar

Related Questions

I have a standard Forge generated Trigger.io app, I made a separate one to
I have a pretty standard django app, and am wondering how to set the
Using the standard Django templating system, is there any snippet/reusable template tag to have
i have a django template - one that is normally loaded via a standard
I have a social community built in Django, and i want to add a
I have a single Django-project on standard webfaction plan (256mb ram). The average loading
I have a really strange problem with the standard logging module used in django
I am new to django (and have no experience in SQL), so maybe there
I have a standard Django Admin page that is used to upload multiple files.
I have a Django application that logs users in and out using the standard

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.