title: Django get_or_create how to use it on foriegnkey?
body: <p>How do i use get_or_create in foriegnkey? i have this code, that if the <code>Student_Users</code>(foriegnkey) doesnt exist the data will inserted and if not the data will update, but in my case even though the <code>Student_Users</code> exist the record inserted.</p>
  <pre><code>insert_data, created = studentsRecord.objects.get_or_create(
    Student_Users=student,
    School_Year = schoolyear
    Education_Levels = educationlevel
  )
  if not created:
    insert_data.Student_Users = student
    insert_data.School_Year = schoolyear
    insert_data.Education_Levels = educationlevel
    insert_data.save()
  </code></pre>