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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:28:21+00:00 2026-05-14T02:28:21+00:00

In my django views i have the following def create(request): query=header.objects.filter(id=a)[0] a=query.criteria_set.all() logging.debug(a.details) I

  • 0

In my django views i have the following

def create(request):

  query=header.objects.filter(id=a)[0]
  a=query.criteria_set.all()
  logging.debug(a.details)

I get an error saying ‘QuerySet’ object has no attribute ‘details’ in the debug statement
.What is this error and what should be the correct statemnt to query this.And the model corresponding to this is as follows

where as the models has the following:

class header(models.Model):
   title = models.CharField(max_length = 255)
   created_by = models.CharField(max_length = 255)

   def __unicode__(self):
     return self.id()

 class criteria(models.Model):
    details =   models.CharField(max_length = 255)
    headerid = models.ForeignKey(header)

    def __unicode__(self):
      return self.id()

Thanks..

  • 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-05-14T02:28:21+00:00Added an answer on May 14, 2026 at 2:28 am

    QuerySet.all() returns a QuerySet. Index it or iterate over it if you want to access the individual models:

    logging.debug(a[0].details)
    
    for m in a:
      logging.debug(m.details)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following settings URL urlpatterns = patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_DOC_ROOT}), url(r'^index/$','pMass.views.index', name='index'),
I have the following models: http://slexy.org/view/s20T8yOiKZ from mxutils.cms_services import generate_secid from django.db import models
I have a urlpatterns like this: urlpatterns = patterns('', ... (r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', info_dict, 'poll_detail'),
(r'^media/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.MEDIA_ROOT}), As you can see, I have a directory called media under
Basically, I currently have login/ in urls.py redirect to the django.contrib.auth.views.login and that seems
I have a django view that returns HTTP 301 on a curl request: grapefruit:~
I have a Django view called change_priority. I'm posting a request to this view
In views.py I have the following view which gets called when a new user
Following this documentation ( https://docs.djangoproject.com/en/dev/topics/http/views/#customizing-error-views ), I am trying to create a custom error
I have a really strange problem with the standard logging module used in django

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.