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.
https://docs.djangoproject.com/en/1.8/ref/models/fields/#manytomanyfield
eg sharing = models.ManyToManyField('User')
--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/84c40695-9652-443a-98d0-b5d416f673ea%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/84c40695-9652-443a-98d0-b5d416f673ea%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/566A1A35.9030701%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.