class ItemChat(models.Model):
class Meta:
verbose_name = "ItemChat"
verbose_name_plural = "ItemChats"
def __str__(self):
pass
def my_directory(instance, filename):
return 'company_{0}/{1}'.format(instance.item.client, filename)
item = models.ForeignKey(Order, on_delete=models.SET_NULL, blank=True, null=True)
personal = models.ForeignKey(PersonalProfile, on_delete=models.SET_NULL, blank=True, null=True)
client = models.ForeignKey(ClientProfile, on_delete=models.SET_NULL, blank=True, null=True)
comment = models.CharField(blank=True, null=True, max_length=50)
design_img = models.ImageField(blank=True, null=True, upload_to=my_directory)