renator's picture
updates
e2882d6
raw
history blame
845 Bytes
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class BaseModel(models.Model):
created_by = models.ForeignKey(
User, on_delete=models.CASCADE, related_name="%(class)s_created_by"
)
created_date = models.DateTimeField(auto_now_add=True)
class Meta:
abstract = True
ordering = ["-created_date"]
class TextToSpeech(BaseModel):
text = models.TextField(
default="In the quest for a sustainable future, renewable energy emerges as a beacon of hope"
)
speaker_wav = models.TextField()
output_wav = models.TextField()
language = models.CharField(
max_length=2, # Adjust the max length based on your language code requirements
default="en"
)
def __str__(self):
return f"TextToSpeech ID: {self.id}"