I'm working on a project using Python(3.7) and Django(2.5) in which I'm building an application something like a freelancing site, but I'm stuck at one point while implementing the delivery submission part.
A user will create a service to sell and then a buyer will order his service, after that the seller has to be done the agreed job and need to submit the work to the buyer as a delivery.
The delivery will be in the form of a file, can be a text file, image file, audio, video or a code file, the problem is that I don't know how I can implement this thing in Django, so a user can send a file to another user in a private manner, so only both of these users will be able to access that file.
Here's what I have so far, for order between buyer and seller:
class Order(models.Model):
status_choices = (
('Active', 'Active'),
('Completed', 'Completed'),
('Late', 'Late'),
('Short', 'Short'),
('Canceled', 'Canceled'),
('Submitted', 'Submitted')
)
gig = models.ForeignKey('Gig', on_delete=models.CASCADE)
seller = models.ForeignKey(User, on_delete=models.CASCADE, related_name='selling')
buyer = models.ForeignKey(User, on_delete=models.CASCADE, related_name='buying')
created_at = models.DateTimeField(auto_now=timezone.now())
charge_id = models.CharField(max_length=234)
days = models.IntegerField(blank=False)
status = models.CharField(max_length=255, choices=status_choices)
def __str__(self):
return f'{self.buyer} order from {self.seller}'
Any idea to implement the file sharing as delivery between two authenticated users?
Thanks in advance!