user = models.ForeignKey(User, null=False, blank= False)
`
I have created a model for file upload as shown above. docfile is the field that represents file to be uploaded and user field stores the name of the user that is uploading the file.I want the additional fields so that file uploaded is visible to the ones with whom it has been shared. Tell me the fields for achieving the sharing task.
Mike Dewhirst
unread,
Dec 10, 2015, 7:35:51 PM12/10/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
On 11/12/2015 5:00 AM, Vasu Dev Garg wrote:
> models.py :
>
> Â `class Document(models.Model):
> Â Â Â docfile = models.FileField(upload_to='documents/%Y/%m/%d')
> Â Â Â user = models.ForeignKey(User, null=False, blank= False)
> `
>
>
> I have created a model for file upload as shown above. docfile is the
> field that represents file to be uploaded and user field stores the name
> of the user that is uploading the file.I want the additional fields so
> that file uploaded is visible to the ones with whom it has been shared.
> Tell me the fields for achieving the sharing task.
Maybe you should use a ManyToManyField so many users may be linked to
any Document.