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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:32:32+00:00 2026-05-14T05:32:32+00:00

/mysite/project4 class notes(models.Model): created_by = models.ForeignKey(User) detail = models.ForeignKey(Details) Details and User are in

  • 0

/mysite/project4

 class notes(models.Model):
   created_by = models.ForeignKey(User)
   detail = models.ForeignKey(Details) 

Details and User are in the same module i.e,/mysite/project1
In project1 models i have defined

   class User():
      ......

   class Details():
      ......

When DB i synced there is an error saying

Error: One or more models did not validate:
project4: Accessor for field 'detail' clashes with related field . Add a related_name argument to the definition for 'detail'.

How can this be solved..

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-14T05:32:32+00:00Added an answer on May 14, 2026 at 5:32 am

    Gee we just had this one; and I answered…

    You have a number of foreign keys which django is unable to generate unique names for.

    You can help out by adding “related_name” arguments to the foreignkey field definitions in your models. Eg:

     class notes(models.Model):
        created_by = models.ForeignKey(User, related_name="note_created_by_user")
        detail = models.ForeignKey(Details, related_name="noted_and_detailed")
    

    See here for more. http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.related_name

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

Sidebar

Related Questions

I have a deployed web application project that references my Utility.dll class library. I
I have a controller called MetricsController with a single action method: public class MetricsController
Assume I have 3 Models: City, Area, Entry. Each city has several Areas and
I have an existing Django project that has several models using concrete inheritance of
In a project i use the following code to open a window: window.open(href, 'mysite'
I'd like all queries like http://mysite.com/something/otherthing?foo=bar&x=y to be rewritten as http://mysite.com/something/otherthing.php?foo=bar&x=y In other words,
If I use an URL like http://mysite/myfolder/myfile.dll , I get a dialog Do you
How can I redirect www.mysite.com/picture/12345 to www.mysite.com/picture/some-picture-title/12345? Right now, /picture/12345 is rewritten on picture.aspx?picid=12345
Based on the following example URL structure: mysite.com/mypage.aspx?a=red&b=green&c=blue Pages in the application use ASP.net
I am implementing jQuery tabs on mysite, one of the tabs holds a form

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.