Conversion_Kitchen_Code/kitchen_counter/mnfapp/models.py

477 lines
24 KiB
Python
Raw Normal View History

2024-04-27 09:33:09 +00:00
from django.db import models
from django.contrib.auth.models import User
import uuid
from users.models import ReferUser
import json
# Create your models here.
class centralDatabase(models.Model):
uuid = models.UUIDField(max_length=36, primary_key=True,
default=uuid.uuid4, editable=False)
user_id = models.ForeignKey(User, on_delete=models.CASCADE)
firstName = models.CharField(max_length=100, blank=True) # 1
middleName = models.CharField(max_length=100, blank=True) # 1
lastName = models.CharField(max_length=100, blank=True) # 1
email = models.CharField(default="", max_length=100) # 1
gender = models.CharField(max_length=20, blank=True) # 1
city = models.CharField(max_length=100, blank=True, null=True) # 2
state = models.CharField(max_length=100, blank=True, null=True) # 2
country = models.CharField(max_length=100, blank=True, null=True) # 2
countryCode = models.IntegerField(default=0, blank=True) # 2
contact = models.CharField(max_length=20, blank=True) # 2
language = models.CharField(max_length=100, blank=True) # 3
language_of_screenplay = models.CharField(max_length=100, blank=True)
interests = models.CharField(max_length=100, blank=True) # 4
skills = models.CharField(max_length=100, blank=True) # 4
linkedin = models.CharField(max_length=100, blank=True) # 5
portfolio_url = models.CharField(max_length=100, blank=True) # 5
about = models.CharField(max_length=100, blank=True) # 4
project_title = models.CharField(max_length=100, blank=True)
project_type = models.CharField(max_length=100, blank=True)
project_status = models.CharField(max_length=100, blank=True)
genre = models.CharField(max_length=100, blank=True)
subgenre = models.CharField(max_length=100, blank=True)
set_in_time = models.CharField(max_length=100, blank=True)
set_in_geography = models.CharField(max_length=100, blank=True)
logline = models.CharField(max_length=100, blank=True)
budget_currency = models.CharField(max_length=100, blank=True)
awarded_by = models.CharField(max_length=100, blank=True) # 6
degree = models.CharField(max_length=100, blank=True) # 6
budget_amount = models.IntegerField(default=0, blank=True)
project_duration = models.IntegerField(default=0, blank=True)
profile_photo = models.FileField(upload_to='user_profile/',max_length=100,null=True,blank=True)
education_certificate = models.FileField(max_length=100, blank=True,null=True) # 6
# boolean field
viewersLounge = models.BooleanField(default=False) # 7
lpp = models.BooleanField(default=False) # 7
priviledgedMember = models.BooleanField(default=False) # 7
ideamall = models.BooleanField(default=False) # 7
rm = models.BooleanField(default=False) # 7
harkat = models.BooleanField(default=False) # 7
# for personal preference
isWhatsappJoined = models.BooleanField(default=False)
isTelegramJoined = models.BooleanField(default=False)
isNewsLetterSubscribed = models.BooleanField(default = False)
#for rhm and memberprofile
dob = models.DateField(null=True, blank=True)
motherTongue = models.CharField(max_length=245, null=True, blank=True)
secondaryLanguage = models.CharField(max_length=245, null=True, blank=True)
highest_qualification = models.CharField(max_length=245, null=True, blank=True)
address = models.CharField(max_length=245, null=True, blank=True)
location_link = models.CharField(max_length=245, null=True, blank=True)
imdb_link = models.CharField(max_length=245, null=True, blank=True)
linkedin_link = models.CharField(max_length=245, null=True, blank=True)
twitter_link = models.CharField(max_length=245, null=True, blank=True)
facebook_link = models.CharField(max_length=245, null=True, blank=True)
instagram_link = models.CharField(max_length=245, null=True, blank=True)
youtube_link = models.CharField(max_length=245, null=True, blank=True)
website_link = models.CharField(max_length=245, null=True, blank=True)
personal_blog_link = models.CharField(max_length=245, null=True, blank=True)
privacy_status_profile = models.CharField(max_length=20, null=True, blank=True)
privacy_status_message = models.CharField(max_length=20, null=True, blank=True)
privacy_status_activity = models.CharField(max_length=20, null=True, blank=True)
# privacy_status_number = models.IntegerField(max_length=20, null=True, blank=True)
video_introduction = models.CharField(max_length=200, null=True, blank=True)
reel = models.CharField(max_length=200, null=True, blank=True)
# Location details
latitude = models.FloatField(default=0)
longitude = models.FloatField(default=0)
base_latitude = models.FloatField(default=0)
base_longitude = models.FloatField(default=0)
# class Meta:
# indexes = [
# models.Index(fields=['user_id']),
# ]
class NonAuthenticatedRefer(models.Model):
id = models.CharField(primary_key=True, default=uuid.uuid4, editable=False,max_length=36)
email = models.CharField(max_length=100, blank=True, null=True)
phone = models.CharField(max_length=100, blank=True, null=True)
name = models.CharField(max_length=100, blank=True, null=True)
# reffer_emails = models.ManyToManyField(ReferUser,blank=True, null=True)
class Refer(models.Model):
id = models.CharField(primary_key=True, default=uuid.uuid4, editable=False,max_length=36)
Refer_id = models.CharField(default=uuid.uuid4, editable=False,max_length=36, null=True)
refer_user = models.ForeignKey(User, on_delete=models.CASCADE,blank=True, null=True, related_name='mnfapp_refers')
non_auth_refer = models.ForeignKey(NonAuthenticatedRefer, on_delete=models.CASCADE,blank=True, null=True)
refer_name1 = models.CharField(max_length=100, blank=True, null=True)
refer_email1 = models.CharField(max_length=100, blank=True, null=True)
SERVICE_CHOICES = [
("Membership-Monthly", "Membership-Monthly"),
("Membership-Annual", "Membership-Annual"),
("Membership- Life", "Membership- Life"),
("Conversion", "Conversion"),
("Narration-LineBYLine", "Narration-LineBYLine"),
("Narration-Subtitling", "Narration-Subtitling"),
("Gift", "Gift"),
("auction-full-rights", "auction-full-rights"),
("auction-limited-rights", "auction-limited-rights"),
("commissioning", "commissioning"),
("subtitling", "subtitling"),
]
PAYMENT_METHOD = [
("card", "card"),
("UPI", "UPI"),
("netbanking", "netbanking"),
("wallet", "wallet"),
]
PAYMENT_RESULT = [("pass", "pass"), ("fail", "fail")]
GATEWAY = [("razorPay", "razorPay"), ("Stripe", "Stripe")]
class PaymentData(models.Model):
uuid = models.UUIDField(max_length=36, primary_key=True, default=uuid.uuid4, editable=False)
stage = models.CharField(null=True, max_length=64)
date = models.DateTimeField(auto_now=True)
payment_id = models.CharField(max_length=64)
user_id = models.ForeignKey(User, on_delete=models.CASCADE)
services_used = models.CharField(null=True, blank=True, choices=SERVICE_CHOICES, max_length=30)
# script_info = models.ForeignKey(MNFScriptDatabase, on_delete=models.CASCADE, null=True)
# subtitle_info = models.ForeignKey(Subtitle_payment, on_delete=models.CASCADE, null=True)
number_of_pages = models.IntegerField(null=True, blank=True)
total_amount = models.FloatField(null=True, blank=True)
discount = models.FloatField(null=True, blank=True)
amount_charged = models.FloatField(null=True, blank=True)
gateway_fee = models.FloatField(null=True, blank=True)
currency = models.CharField(default="INR", max_length=30)
pay_method = models.CharField(null=True, blank=True, choices=PAYMENT_METHOD, max_length=12)
payment_status = models.CharField(null=True, blank=True, choices=PAYMENT_RESULT, max_length=5)
payment_gateway = models.CharField(null=True, blank=True, choices=GATEWAY, max_length=10)
def __str__(self):
return str(self.payment_id)
class SampleScript(models.Model):
sample_id = models.UUIDField(default=uuid.uuid4, primary_key=True)
user_id = models.ForeignKey(
User, on_delete=models.CASCADE, blank=True, null=True)
date_at = models.DateTimeField(auto_now_add=True)
date_updated = models.DateTimeField(auto_now=True)
script_title = models.CharField(max_length=100, blank=True)
author_name = models.CharField(max_length=100, blank=True)
script_file_path = models.FileField(upload_to="scripts/")
script_file_path_pdf = models.CharField(
default="", max_length=100, blank=True)
dial_src_language = models.CharField(max_length=100, blank=True)
dial_src_script = models.CharField(max_length=100, blank=True)
nondial_src_script = models.CharField(max_length=100, blank=True)
nondial_src_language = models.CharField(max_length=100, blank=True)
languages = models.CharField(max_length=100, blank=True, default="")
type_of_script = models.CharField(max_length=100, blank=True, default="")
approved = models.BooleanField(default=False)
accepted_on = models.DateTimeField(null=True, blank=True)
audit_id = models.CharField(max_length=220, null=True, blank=True, default="")
def __str__(self):
return str(self.script_title)
class Name(models.Model):
name = models.CharField(max_length=100)
class MNFScriptDatabase(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
user_id = models.ForeignKey(User, on_delete=models.CASCADE)
date_at = models.DateTimeField(auto_now_add=True)
script_id = models.CharField(max_length=100, blank=True)
sample_id = models.ForeignKey("SampleScript", on_delete=models.CASCADE, blank=True, null=True)
audit_id = models.CharField(max_length=220, null=True, blank=True, default="")
language_audit_id = models.CharField(max_length=220, null=True, blank=True, default="")
script_title = models.CharField(max_length=200, blank=True)
author_name = models.CharField(max_length=100, blank=True)
script = models.FileField(upload_to="scripts/")
dial_src_language = models.CharField(max_length=100, blank=True)
nondial_src_script = models.CharField(max_length=100, blank=True)
dial_src_script = models.CharField(max_length=100, blank=True)
numPages = models.IntegerField(default=1)
is_juggernaut_used = models.BooleanField(default=False)
languages_juggernaut = models.CharField(default="", max_length=300, blank=True)
sample_script = models.BooleanField(default=False)
selected_characters = models.CharField(max_length=200, blank=True)
video_json_path = models.CharField(default="", max_length=100)
video_audio_path = models.CharField(default="", max_length=100)
pitchdeck_item = models.CharField(default="", max_length=100)
scene_vector = models.CharField(default="", max_length=100)
character_vector = models.CharField(default="", max_length=100)
dialogues_vector = models.CharField(default="", max_length=100)
script_vector = models.CharField(default="", max_length=100)
Location_Vector = models.CharField(default="", max_length=100)
Global_Vector = models.CharField(default="", max_length=100)
narration_video_path = models.CharField(default="", max_length=100)
character_intro_video_path = models.CharField(
default="", max_length=100) # manoj
line_by_line_narration_video_path = models.CharField(
default="", max_length=100
) # rohit edited on 26th December #1 #manoj
linebyline = models.CharField(default="", max_length=100)
character_intro = models.CharField(default="", max_length=100) # 2
screenplay_analysis = models.CharField(default="", max_length=100) # 3
elevator_pitch = models.CharField(default="", max_length=100) # 4
onepager = models.CharField(default="", max_length=100) # 5
characterwise_narration = models.CharField(
default="", max_length=100) # 6 -----
nondial_src_language = models.CharField(max_length=100, blank=True)
screenplay_analysis_video_path = models.CharField(
default="", max_length=100) # manoj
elevator_pitch_video_path = models.CharField(
default="", max_length=100) # manoj
onepager_pdf_path = models.CharField(default="", max_length=100) # manoj
# characterwise_videopath=ArrayField(models.CharField(max_length=100),blank=True)
# Commented line number 54 on 16/06/22 18:30 PM Ritwick Jha. Getting database error
def set_selected_characters(self, x):
self.selected_characters = json.dumps(x)
def get_selected_characters(self):
return str(json.loads(self.selected_characters))
characterwise_video_path = models.CharField(max_length=100, blank=True)
# charwise = models.ManyToManyField(Characterwise, related_name="charwise", null=True, default="")
# charwise= models.ManyToManyField
def set_characterwise_video_path(self, x):
self.characterwise_video_path = json.dumps(x)
def get_characterwise_video_path(self):
return str(json.loads(self.characterwise_video_path))
char_video_path = []
def __str__(self):
return str(self.script_title)
class ScriptTranslations(models.Model):
user_id = models.ForeignKey(User, on_delete=models.CASCADE, default=10)
translation_id = models.UUIDField(
primary_key=True, default=uuid.uuid4, editable=False)
script_link_id = models.ForeignKey(MNFScriptDatabase, on_delete=models.CASCADE)
date_translated = models.DateTimeField(auto_now_add=True)
date_latest_iteration = models.DateTimeField(auto_now=True)
nondial_dest_language = models.CharField(max_length=100, blank=True)
nondial_dest_script = models.CharField(max_length=100, blank=True)
dial_dest_language = models.CharField(max_length=100, blank=True)
dial_dest_script = models.CharField(max_length=100, blank=True)
translated_script_path = models.CharField(default="", max_length=500)
translated_script_pdf = models.CharField(default="", max_length=500)
central_payment_id = models.CharField(default="", max_length=256)
payment_order_id = models.CharField(default="", max_length=256)
full_dialogue_option_choices = models.CharField(max_length=800, blank=True, null=True)
sentence_dialogue_option_choices = models.CharField(max_length=800, blank=True, null=True)
other_option_choices = models.CharField(max_length=800, blank=True, null=True)
exp_rate = models.IntegerField(default=0)
content_accuracy_rate = models.IntegerField(default=0)
translation_accuracy_rate = models.IntegerField(default=0)
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)
converted_audit_id = models.CharField(max_length=220, null=True, blank=True, default="")
lpp = models.BooleanField(default=False)
dual_dial_script = models.BooleanField(default=False)
left_dual_dial_lang = models.CharField(max_length=220, null=True, blank=True)
left_dual_dial_script = models.CharField(max_length=220, null=True, blank=True)
free_output = models.BooleanField(default=False)
status = models.CharField(max_length=220, null=True, blank=True)
2024-05-02 07:48:38 +00:00
blockchain_txhash = models.CharField(max_length=220, null=True, blank=True)
2024-04-27 09:33:09 +00:00
error_desc = models.CharField(max_length=2000, null=True, blank=True)
class Author(models.Model):
uuid = models.UUIDField(max_length=36, primary_key=True,
default=uuid.uuid4, editable=False)
name = models.CharField(max_length=100, blank=True)
author_profile = models.FileField(
upload_to="profile_pic/", blank=True, null=True)
author_about = models.CharField(max_length=100, blank=True)
author_email = models.CharField(default="", max_length=100)
phonenumber = models.CharField(default="", max_length=100)
author_link = models.CharField(default="", max_length=100)
class PitchVector(models.Model):
choosescript = models.FileField(
upload_to="scripts/", blank=True, null=True)
# character_list = ArrayField(models.CharField(max_length=100),blank=True)
# character_path = ArrayField(models.CharField(max_length=100),blank=True)
# charnar_checked=models.BooleanField(default=False)
# pitchdeck = models.CharField(max_length=100, blank=True)
scriptDetails = models.ForeignKey(
MNFScriptDatabase, on_delete=models.CASCADE)
script_id = models.CharField(max_length=100, blank=True)
scriptname = models.CharField(max_length=100, blank=True)
genre = models.CharField(max_length=100, blank=True)
subGenre = models.CharField(max_length=100, blank=True)
projecttype = models.CharField(max_length=100, blank=True)
noepisodes = models.CharField(max_length=100, blank=True)
eachepisodes = models.CharField(max_length=100, blank=True)
other = models.CharField(max_length=100, blank=True)
language = models.CharField(max_length=100, blank=True)
dialect_language = models.CharField(max_length=100, blank=True)
platformproposed = models.CharField(max_length=100, blank=True)
country = models.CharField(max_length=100, blank=True)
countryCode = models.IntegerField(max_length=100, blank=True)
state = models.CharField(max_length=100, blank=True)
city = models.CharField(max_length=100, blank=True)
languagebelt = models.CharField(max_length=100, blank=True)
target_audience = models.CharField(max_length=100, blank=True)
target_field = models.CharField(max_length=100, blank=True)
timeperiod = models.CharField(max_length=100, blank=True)
other_timeperiod = models.CharField(
max_length=100, blank=True) # --------neha 18/03/23
geography = models.CharField(max_length=100, blank=True)
dialogue_reference = models.CharField(max_length=100, blank=True)
premise = models.CharField(max_length=100, blank=True)
logline = models.CharField(max_length=100, blank=True)
# Character Wise narration
selected_characters = models.CharField(max_length=200, blank=True)
"""
set using set_selected_characters(self, x):
get using get_selected_characters()
"""
# Author details
# author_details = ArrayField(ArrayField(models.CharField(max_length=20, null=True, blank=True),size=5, default=list),size=5, default=list)
# auth_details = jsonfield.JSONField()
author_details = models.ManyToManyField(
Author,
related_name="author_details",
default="",
null=True,
blank=True,
)
author = models.BooleanField(default=False)
author1 = models.CharField(max_length=100, blank=True)
name = models.CharField(max_length=100, blank=True)
author_profile = models.FileField(
upload_to="profile_pic/", blank=True, null=True)
author_about = models.CharField(max_length=100, blank=True)
author_email = models.CharField(default="", max_length=100)
phonenumber = models.CharField(default="", max_length=100)
author_link = models.CharField(default="", max_length=100)
# Plot and story flow
plot_story_flow = models.BooleanField(default=False)
protagonist = models.CharField(max_length=100, blank=True)
barrier = models.CharField(max_length=100, blank=True)
midpoint = models.CharField(max_length=100, blank=True)
climax = models.CharField(max_length=100, blank=True)
conflictresolved = models.CharField(max_length=100, blank=True)
minute_protogonist = models.CharField(max_length=100, blank=True)
conflict_reaches_climax = models.CharField(max_length=100, blank=True)
# About shooting
shooting = models.BooleanField(default=False)
# pre_production = models.CharField(max_length=100, blank=True)
# post_production = models.CharField(
# max_length=100, blank=True) # ---------ne
special_preperation = models.CharField(max_length=100, blank=True)
days_shoot_required = models.CharField(max_length=100, blank=True)
percentage_location = models.CharField(max_length=100, blank=True)
percentage_scene = models.CharField(max_length=100, blank=True)
major_prosthetic = models.CharField(max_length=100, blank=True)
during_production = models.CharField(max_length=100, blank=True)
# Dream cast $ locations
dream_cast_locations = models.BooleanField(default=False)
leadcharacter = models.CharField(max_length=100, blank=True)
proposedactor1 = models.CharField(max_length=100, blank=True)
upload_image1 = models.FileField(
upload_to="profile_pic/", blank=True, null=True)
secondleadcharacter = models.CharField(max_length=100, blank=True)
proposedactor2 = models.CharField(max_length=100, blank=True)
upload_image2 = models.FileField(
upload_to="profile_pic/", blank=True, null=True)
mainvillan = models.CharField(max_length=100, blank=True)
proposedactor3 = models.CharField(max_length=100, blank=True)
upload_image3 = models.FileField(
upload_to="profile_pic/", blank=True, null=True)
associatecharacter = models.CharField(max_length=100, blank=True)
proposedactor4 = models.CharField(max_length=100, blank=True)
upload_image4 = models.FileField(
upload_to="profile_pic/", blank=True, null=True)
associatevillan = models.CharField(max_length=100, blank=True)
proposedactor5 = models.CharField(max_length=100, blank=True)
upload_image5 = models.FileField(
upload_to="profile_pic/", blank=True, null=True)
firstlocation = models.CharField(max_length=100, blank=True)
proposedactor6 = models.CharField(max_length=100, blank=True)
upload_image6 = models.FileField(
upload_to="profile_pic/", blank=True, null=True)
secondlocation = models.CharField(max_length=100, blank=True)
proposedactor7 = models.CharField(max_length=100, blank=True)
upload_image7 = models.FileField(
upload_to="profile_pic/", blank=True, null=True)
thirdlocation = models.CharField(max_length=100, blank=True)
proposedactor8 = models.CharField(max_length=100, blank=True)
upload_image8 = models.FileField(
upload_to="profile_pic/", blank=True, null=True)
# About Film budget
film_budget = models.BooleanField(default=False)
making_expenses = models.CharField(max_length=100, blank=True)
making_expenses_currency = models.CharField(
max_length=100, blank=True) # ------neha 18/03/23
percentage_scenes_required = models.CharField(max_length=100, blank=True)
vfx_expenses = models.CharField(max_length=100, blank=True)
vfx_expenses_currency = models.CharField(
max_length=100, blank=True) # ------neha 18/03/23
approx_budget_required = models.CharField(max_length=100, blank=True)
approx_budget_currency = models.CharField(
max_length=100, blank=True) # ------neha 18/03/23
# Strengths & Expectations
strengths_and_expectation = models.BooleanField(default=False)
script_succed = models.CharField(max_length=100, blank=True)
produced_now = models.CharField(max_length=100, blank=True)
monetary_non_monetary_expectation = models.CharField(
max_length=100, blank=True)
#for payment use
transaction_id = models.CharField(max_length=1000, blank=True, null=True)
country = models.CharField(max_length=1000, blank=True, null=True)
charges = models.FloatField(default=0, blank=True, null=True)
discount = models.FloatField(default=0, blank=True, null=True)
order_id = models.CharField(max_length=1000, blank=True, null=True)
cp_id = models.CharField(max_length=1000, blank=True, null=True)
isPaid = models.BooleanField(default=False)
central_payment_id = models.CharField(default="", max_length=256)
payment_order_id = models.CharField(default="", max_length=256)
# Multiple Author Yameen | Neha Kumari
names = models.ManyToManyField(Name)
def set_selected_characters(self, x):
self.selected_characters = json.dumps(x)
def get_selected_characters(self):
return str(json.loads(self.selected_characters))