title: django file folder model
body: <p>I would like to know how to create django relation model for user, folder, file</p>
  
  <p>An user can have multiple files and folders.</p>
  
  <p>A folder can have a lot of files but cant have folder int folder.</p>
  
  <p>I tried something like that( I started learning django one day ago).</p>
  
  <p>I read some docs about ForeignKey and ManytoMany relation from djangobook but i'm not sure if I understand all of it.</p>
  
  <h2>User model</h2>
  
  <pre><code>class User_t(models.Model):
      username = models.CharField(max_length=30)
      user_id = models.CharField(max_length=30)
      pcw = models.CharField(max_length=30)
      name = models.CharField(max_length=30)
      surname = models.CharField(max_length=30)
      mail = models.EmailField(max_length=50)
      validateMail =  models.BooleanField()
      birthday = models.DateTimeField(max_length=60)
      premium = models.BooleanField()
      premiumEnd = models.DateTimeField(max_length=10)
      totalUpload = models.CharField(max_length=15)
      avatar = models.URLField()
  </code></pre>
  
  <h2>File model</h2>
  
  <pre><code>class FileItem(models.Model):
      file_id = models.CharField(max_length=30)
      file_name = models.CharField(max_length=75)
      date_upload = models.DateTimeField(max_length=10)
      data_size = models.CharField(max_length=75)
      key = models.CharField(max_length=75)
      owner_id = models.OneToManyField(User_t)
      login_accept = models.ManyToManyField(User_t)
      file_i = models.FileField(/mnt/test/)
  </code></pre>
  
  <h2>Folder model</h2>
  
  <pre><code>class FolderItem(models.Model):
      folder_id = models.CharField(max_length=30)
      folder_name = models.CharField(max_length=75)
      data_size = models.CharField(max_length=75)
      key = models.CharField(max_length=75)
      owner_id = models.ForeignKey(User_t)
      login_accept = models.ManyToManyField(User_t)
      files = models.ForeignKey(FileItem)
  </code></pre>