Conversion_Kitchen_Code/kitchen_counter/conversion/models.py

74 lines
3.5 KiB
Python
Raw Normal View History

2024-04-27 09:33:09 +00:00
import uuid
from django.db.models.fields import UUIDField
from django.db import models
from django.contrib.auth.models import User
from conversion.override import OverwriteStorage
# Create your models here.
class UploadScript(models.Model):
script = models.FileField(upload_to='scripts', storage=OverwriteStorage())
class pptconversion(models.Model):
ppt_id = models.UUIDField(
primary_key=True, default=uuid.uuid4, editable=False)
user_id = models.ForeignKey(User, on_delete=models.CASCADE)
ppt_string = models.CharField(max_length=100, blank=True)
date_at = models.DateTimeField(auto_now_add=True)
upload_ppt = models.FileField(upload_to='ppt/original')
translated_ppt = models.CharField(max_length=100, blank=True)
error_faced_feedback = models.CharField(max_length=100, blank=True)
attention_feedback = models.CharField(max_length=100, blank=True)
improvement_feedback = models.CharField(max_length=100, blank=True)
exp_rate = models.IntegerField(default=0, null=True)
content_accuracy_rate = models.IntegerField(default=0, null=True)
translation_accuracy_rate = models.IntegerField(default=0, null=True)
target_lang = models.CharField(max_length=100, blank=True)
target_script = models.CharField(max_length=100, blank=True)
source_script = models.CharField(max_length=100, blank=True)
source_lang = models.CharField(max_length=100, blank=True)
slide_count = models.IntegerField(default=1, null=True, blank=True)
amount = models.IntegerField(default=0, null=True, blank=True)
lpp = models.BooleanField(default=False, null=True)
vetted_file = models.CharField(max_length=100, blank=True)
timestamp = models.IntegerField(default=0, null=True, blank=True)
translated_ppt_encoded = models.BinaryField(blank=True, null=True)
uploaded_ppt_encoded = models.BinaryField(blank=True, null=True)
central_payment_id = models.CharField(default="", max_length=256)
payment_order_id = models.CharField(default="", max_length=256)
class StoryConversion(models.Model):
story_id = models.CharField(max_length=100, blank=True)
user_id = models.ForeignKey(User, on_delete=models.CASCADE)
date_at = models.DateTimeField(auto_now=True)
upload_story = models.FileField(upload_to='scripts/story')
translated_story_docx = models.FileField(
upload_to='scripts/story/translated')
translated_story_pdf = models.FileField(
upload_to='scripts/story/translated')
status = models.CharField(max_length=100, blank=True)
target_language = models.CharField(max_length=100, blank=True)
source_language = models.CharField(max_length=100, blank=True)
class BookConversion(models.Model):
book_id = models.CharField(max_length=100, blank=True)
user_id = models.ForeignKey(User, on_delete=models.CASCADE)
date_at = models.DateTimeField(auto_now=True)
upload_book = models.FileField(upload_to='scripts/book')
numPages = models.IntegerField(default=1, null=True)
translated_book_docx = models.CharField(
max_length=200, null=True, blank=True)
translated_book_pdf = models.CharField(
max_length=200, null=True, blank=True)
status = models.CharField(max_length=100, blank=True)
target_language = models.CharField(max_length=100, blank=True)
source_language = models.CharField(max_length=100, blank=True)
header_footer_present = models.BooleanField(default=False, null=True)
central_payment_id = models.CharField(default="", max_length=256)
payment_order_id = models.CharField(default="", max_length=256)