this is my model class UserProfile(models.Model): user = models.ForeignKey(User,…
- User
this is my model class User_Profile(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) phone_number = models.IntegerField(null=True, blank=True) full_name = models.CharField(max_length=50, null=True, blank=True) project_number = models.CharField(max_length=20, null=True, blank=True) project_name = models.CharField(max_length=100, null=True, blank=True) sector_name = models.CharField(max_length=100, null=True, blank=True) contract_ordering = models.IntegerField(null=True, blank=True) objects = models.Manager() # default manager non_null_contract_ordering = User_Profile_Manager() # custom manager
codedef __str__(self): return str(self.project_name) class Meta: verbose_name="profile" ordering = ['contract_ordering', 'project_name']class User_ContractPermission(models.Model):
codechoice = [ ('Yes', 'Yes'), ('No', 'No'), ] user = models.OneToOneField(User_Profile, on_delete=models.CASCADE) contract_app = models.CharField(max_length=250, choices=choice, null=True, blank=True) add_new_contract = models.CharField(max_length=250, choices=choice, null=True, blank=True) Sector_manager_action_2 = models.CharField(max_length=250, choices=choice, null=True, blank=True) Check_data_action_3 = models.CharField(max_length=250, choices=choice, null=True, blank=True) Cost_estimation_action_4 = models.CharField(max_length=250, choices=choice, null=True, blank=True) Financial_action_5 = models.CharField(max_length=250, choices=choice, null=True, blank=True) Copy_contract_action_6 = models.CharField(max_length=250, choices=choice, null=True, blank=True) Check_contract_action_7 = models.CharField(max_length=250, choices=choice, null=True, blank=True) TCTA_action_8 = models.CharField(max_length=250, choices=choice, null=True, blank=True) EVP_action_9 = models.CharField(max_length=250, choices=choice, null=True, blank=True) CEO_action_10 = models.CharField(max_length=250, choices=choice, null=True, blank=True) AssignAttach2_action_11 = models.CharField(max_length=250, choices=choice, null=True, blank=True) AssignAttach1_action_12 = models.CharField(max_length=250, choices=choice, null=True, blank=True) project_index = models.CharField(max_length=250, choices=choice, null=True, blank=True) sector_index = models.CharField(max_length=250, choices=choice, null=True, blank=True) main_index = models.CharField(max_length=250, choices=choice, null=True, blank=True) def __str__(self): return str(self.user) class Meta: verbose_name="User_ContractPermission" - Assistant
- Assistant