Skip to content

Commit fb01475

Browse files
committed
associate user with Picture
1 parent 11e927b commit fb01475

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fileupload/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
from django.db import models
2+
from django.contrib.auth.models import User
23

34
class Picture(models.Model):
45
# This is a small demo using FileField instead of ImageField, not
56
# depending on PIL. You will probably want ImageField in your app.
67
file = models.ImageField(upload_to="pictures")
78
slug = models.SlugField(max_length=50, blank=True)
9+
creator = models.ForeignKey(User)
810

911
def __unicode__(self):
1012
return self.file

0 commit comments

Comments
 (0)