title: Relation made on calculated field
body: <p>Let's assume i have a models.py like this:</p>
  
  <pre><code>class Employee(models.Model):
      name = char...
      code = int...
      email = email...
      evaluations = fk(Evaluation) &lt;-----
  
  class Evaluation(models.Model):
      date = date...
      points = int...
      emp_code = char... &lt;-----
  </code></pre>
  
  <p>Is it possible to do a relation based on a computed field?</p>
  
  <p>I mean in the DB I can not store the <code>emp_code</code> from <code>Evaluation</code> in plain text so I have a function to hide the code but I don't know how to make the relationship based on a function.</p>
  
  <p>Edit 1:
  To clarify some questions: employee.code could be the primary key since its a unique field.
  emp_code MUST be hashed. i CANNOT save it in plain text.</p>
  
  <p>i dont need employee.evaluations like a field, it could be some sort of function or whatever that make a comparision based on a processed attribute</p>
  
  <p>Lets assume i have employee.code = 1234, after hashing it comes out as 'abcdef' i would like to get employee object with code = 1234 and all evaluations for emp_code = 'abcdef'</p>