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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:56:32+00:00 2026-06-11T08:56:32+00:00

I am working on a website with Django. I have created two models, one

  • 0

I am working on a website with Django.

I have created two models, one for photo and the other for a person.

class Photo(models.Model):    
    photo  = models.ImageField(upload_to = 'toto')
    description = models.CharField(_('Description'), max_length = 250)
    people = models.ManyToManyField('Person', related_name = _('Person'))

    def display_img(self):
        return u'<img src="%s" /> - %s - %s' % (self.photo, self.description, self.people )

    display_img.allow_tags = True

class Person(models.Model):
    name = models.CharField(_('Name'), max_length = 50)

In my mind what I want is to be able to tag people on a photo.

My problem is that I am able to create a new photo with the admin, but when I want to modify/view it (http://127.0.0.1:8000/admin/module/photo/1/) I get this error:

Django Version: 1.4.1
Exception Type: TypeError
Exception Value:    
filter() keywords must be strings
Exception Location: C:\Python26\Lib\site-packages\django\db\models\fields\related.py in get_query_set, line 543

and I am not able to understand it.

  • 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-11T08:56:33+00:00Added an answer on June 11, 2026 at 8:56 am

    The full traceback would have been useful.

    I expect the problem comes from the related_name attribute in your people field. You’ve marked this for translation, but that makes no sense: this is an attribute you use in your code, not something for public consumption. Take out the _() call.

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

Sidebar

Related Questions

I have a website I've built in django that I'm trying to get working
I'm working on a website which uses Django templates, and I have to produce
I'm working on a soccer league management website using Django. Among others, I have
I am working on creating a website in Django which consists of two parts:
I'm working on a website where I sell products (one class Sale, one class
I am working on a cookbook website using django and have run into a
I am working on a django recipe website and one of the pages is
I'm working on a Django website where I have various compilation programs that need
I'm new to Django but am working on the tutorial on the Django website
I have a working website, where I use this expression everywhere. price.ToString(C) It currently

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.