class BilingualCorpus(models.Model):
file_url = models.FileField(upload_to='corpus_files/', validators=[FileExtensionValidator(allowed_extensions=['txt', 'csv', 'tmx', 'xlsx'])])
file_name = models.CharField(max_length=255, default='none')
name = models.CharField(max_length=50,default='none')
s_lang = models.CharField(max_length=5,default='en')
t_lang = models.CharField(max_length=5,default='th')
note = models.TextField(blank=True)
user = models.ForeignKey(User, on_delete=models.CASCADE)
created_at = models.DateTimeField(auto_now_add=True, blank=True)
updated_at = models.DateTimeField(auto_now=True, blank=True)
class CorpusStatus(models.Model):
status = models.CharField(max_length=50, default='Unchecked')
class BilingualSentence(models.Model):
corpus = models.ForeignKey(BilingualCorpus, on_delete=models.CASCADE)
source = models.TextField(blank=True)
target = models.TextField(blank=True)
status = models.ForeignKey(CorpusStatus, blank=True, null=True, on_delete=models.SET_NULL)