class CompanyDetails(BaseModel): company = models.OneToOneField('product.Company', on_delete=models.CASCADE) fact_file = models.TextField(null=True, blank=True) joint_venture = models.TextField(null=True, blank=True) formation_year = models.CharField(max_length=4, null=True, blank=True) market_share = models.TextField(null=True, blank=True) additional_info = models.TextField(null=True, blank=True)
class AccountDetail(BaseModel): account = models.OneToOneField('users.Account', on_delete=models.CASCADE) agent_code = models.CharField(max_length=16, null=True, blank=True) branch_code = models.CharField(max_length=16, null=True, blank=True) designation = models.CharField(max_length=16, null=True, blank=True) channel = models.CharField(max_length=16, null=True, blank=True) status = models.CharField(max_length=32, null=True, blank=True) languages = ArrayField( models.CharField(max_length=16), default=list, blank=True, null=True) certifications = ArrayField( models.CharField(max_length=64), default=list, blank=True, null=True) qualifications = ArrayField( models.CharField(max_length=128), default=list, blank=True, null=True) short_description = models.TextField(null=True, blank=True) long_description = models.TextField(null=True, blank=True)
class Collateral(BaseModel): name = models.CharField(max_length=256) thumbnail = models.URLField(null=True, blank=True) category = models.ForeignKey('product.Category', null=True, blank=True, on_delete=models.PROTECT) url = models.URLField() collateral_type = models.CharField(max_length=16, choices=get_choices( Constants.COLLATERALS_TYPE)) collateral_file_type = models.CharField(max_length=32, choices=get_choices( Constants.COLLATERALS_CHOICES)) promocode = models.ForeignKey('users.PromoCode', on_delete=models.PROTECT) short_descripton = models.CharField(max_length=256, null=True, blank=True) long_descripton = models.TextField(null=True, blank=True) order = models.IntegerField(default=0) def __str__(self): return '%s | %s: %s' % (self.name, self.collateral_type, self.collateral_file_type) class Meta: ordering = ('order', )
class ContactUs(BaseModel): full_name = models.CharField(max_length=512) phone_no = models.CharField(max_length=10) email = models.EmailField(max_length=50) message = models.TextField(null=True, blank=True) def __str__(self): return "{} - {}".format(self.phone_no, self.full_name)
class Note(BaseModel): lead = models.ForeignKey('crm.Lead', on_delete=models.PROTECT) title = models.CharField(max_length=128) text = models.TextField() read = models.BooleanField(default=False) ignore = models.BooleanField(default=False) def __str__(self): return self.title
class Faq(BaseModel): category = models.ForeignKey('product.Category', on_delete=models.CASCADE) question = models.CharField(max_length=264) answer = models.TextField() def __str__(self): return '%s: %s' % (self.category.name, self.question) class Meta: ordering = ('id', )
class ProductVariant(BaseModel): company_category = models.ForeignKey('product.CompanyCategory', null=True, blank=True, on_delete=models.CASCADE) parent = models.ForeignKey('self', null=True, blank=True, on_delete=models.CASCADE) name = models.CharField(max_length=256, default="", verbose_name="Product Name") parent_product = models.CharField(max_length=128, null=True, blank=True, default='GoPlannr') feature_variant = models.CharField(max_length=256, default='base') short_description = models.CharField(max_length=128, null=True, blank=True) long_description = models.TextField(null=True, blank=True) online_process = models.BooleanField(default=False) is_active = models.BooleanField(default=True) chronic = models.BooleanField(default=True) def get_product_details(self): return { 'name': self.product_short_name, 'company': self.company_category.company.name, 'logo': self.logo, 'variant_name': self.product_short_name } @cached_property def logo(self): from goplannr.settings import DEBUG return (Constants.DEBUG_HOST if DEBUG else '') + self.company_category.company.logo.url @cached_property def product_short_name(self): return self.name def get_basic_details(self): return dict(toll_free_number=', '.join( self.company_category.company.toll_free_number), brochure=self.get_help_file('sales_brochure'), claim_form=self.get_help_file('claim_form')) def get_help_file(self, file_type): from content.models import HelpFile helpfile = HelpFile.objects.filter(product_variant_id=self.id, file_type=file_type).first() return helpfile.file.url if helpfile else '-' def __str__(self): return self.product_short_name
class Appointment(BaseModel): user = models.ForeignKey('users.User', on_delete=models.CASCADE) category = models.ForeignKey('product.Category', on_delete=models.CASCADE) lead = models.ForeignKey('crm.Lead', on_delete=models.CASCADE, null=True, blank=True) name = models.CharField(max_length=128) phone_no = models.CharField(max_length=10) address = models.TextField() date = models.DateField()
class Category(BaseModel): name = models.CharField(max_length=128, db_index=True) description = models.TextField(null=True, blank=True) logo = models.ImageField(upload_to=Constants.CATEGORY_UPLOAD_PATH, default=Constants.DEFAULT_LOGO) hexa_code = models.CharField(max_length=8, default=Constants.DEFAULT_HEXA_CODE) is_active = models.BooleanField(default=False) commission = models.FloatField(default=Constants.DEFAULT_COMMISSION) def __str__(self): return self.name
class Company(BaseModel): name = models.CharField(max_length=128, db_index=True, verbose_name="Company Name") short_name = models.CharField(max_length=128) categories = models.ManyToManyField('product.Category') logo = models.ImageField(upload_to=Constants.COMPANY_UPLOAD_PATH, default=Constants.DEFAULT_LOGO) hexa_code = models.CharField(max_length=8, default=Constants.DEFAULT_HEXA_CODE) website = models.URLField(null=True, blank=True) spoc = models.TextField(null=True, blank=True) toll_free_number = ArrayField(models.CharField(max_length=32), default=list, blank=True, null=True) long_description = models.TextField(null=True, blank=True) small_description = models.TextField(null=True, blank=True) commission = models.FloatField(default=0.0) is_active = models.BooleanField(default=False) def __str__(self): return self.name
class Question(BaseModel): category = models.ForeignKey('product.Category', on_delete=models.CASCADE) title = models.CharField(max_length=32) question_type = models.CharField(max_length=10, choices=get_choices( constants.QUESTION_COICES), default="single") question = models.TextField() order = models.IntegerField(default=0) ignore = models.BooleanField(default=False) class Meta: ordering = ('order', ) def __str__(self): return self.title
class NetworkHospital(BaseModel): name = models.CharField(blank=True, max_length=256, db_index=True) company = models.ForeignKey('product.Company', null=True, on_delete=models.CASCADE, blank=True) pincode = models.ForeignKey('users.Pincode', on_delete=models.CASCADE, blank=True) address = models.TextField() contact_number = models.CharField(blank=True, max_length=100, db_index=True) def get_full_address(self): return '%s, %s, %s (%s)' % (self.address, self.pincode.city, self.pincode.state, self.pincode.pincode)
class FeatureMaster(BaseModel): category = models.ForeignKey('product.Category', null=True, blank=True, on_delete=models.CASCADE) name = models.CharField(max_length=127, default="") order = models.IntegerField(default=1) feature_type = models.CharField(max_length=32, default='Others', choices=get_choices( Constants.FEATURE_TYPES)) short_description = models.CharField(max_length=128, null=True, blank=True) long_description = models.TextField(null=True, blank=True) def __str__(self): return "%s - %s" % (self.name, self.category.name) class Meta: ordering = ('order', )
class HelpLine(BaseModel): company = models.ForeignKey('product.Company', on_delete=models.CASCADE) description = models.TextField(blank=True) number = models.CharField(blank=True, max_length=32)
class Coverages(BaseModel): company_category = models.ForeignKey('product.CompanyCategory', on_delete=models.CASCADE) name = models.CharField(max_length=64) description = models.TextField()