title: Django model with FileField -- dynamic 'upload_to' argument
body: <p>I am using the model with FileField to deal with file uploading. Now the files can be uploaded successfully. However, there is one more small improvement I want to make, which is to create folder for the user with the username.</p>
  
  <p>Here is the code I've tried</p>
  
  <pre><code>class UserFiles(models.Model):
      user = models.OneToOneField(User)
      file = models.FileField(upload_to='files/users/user.username/%Y_%m_%d/')
  </code></pre>
  
  <p>this would give the folder of 'user.username' instead of 'John'(one example of username)</p>
  
  <p>I have also tried other ways like <code>files/users/%user.username/%Y_%m_%d/</code>
  ,but it would not give the folder with the user name. Not sure how the syntax should be or whether this is possible.</p>
  
  <p>Can you give some suggestions on this?
  Thank you very much for your help and explanation.</p>