from __future__ import unicode_literals

from django.db import models
from django.contrib.auth.models import User


# Create your models here.

def generate_filename(self, filename):
    url = 'documents/%s/%s' %(self.user.username, filename)
    return url

class Document(models.Model):
    user = models.ForeignKey(User)
    docfile = models.FileField(upload_to=generate_filename)
