|
|
|
|
@ -55,20 +55,20 @@ class ContractorFinancialInfo(models.Model): |
|
|
|
|
('legal_entity', 'ИП и юридическое лицо'), |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
fio = models.CharField(max_length=255) |
|
|
|
|
credit_card_number = models.CharField(max_length=50) |
|
|
|
|
date_of_birth = models.DateTimeField() |
|
|
|
|
phone = models.CharField(max_length=30) |
|
|
|
|
residency = models.CharField(max_length=50, choices=RESIDENCIES) |
|
|
|
|
fio = models.CharField(max_length=255) |
|
|
|
|
inn = models.CharField(max_length=100) |
|
|
|
|
legal_status = models.CharField(max_length=30, choices=LEGAL_STATUSES) |
|
|
|
|
passport_series = models.CharField(max_length=6) |
|
|
|
|
passport_issue_date = models.DateTimeField() |
|
|
|
|
passport_issued_by = models.CharField(max_length=255) |
|
|
|
|
passport_number = models.CharField(max_length=10) |
|
|
|
|
passport_scan = models.ImageField(upload_to='users/contractors/') |
|
|
|
|
passport_series = models.CharField(max_length=6) |
|
|
|
|
phone = models.CharField(max_length=30) |
|
|
|
|
residency = models.CharField(max_length=50, choices=RESIDENCIES) |
|
|
|
|
subdivision_code = models.CharField(max_length=10) |
|
|
|
|
passport_issued_by = models.CharField(max_length=255) |
|
|
|
|
passport_issue_date = models.DateTimeField() |
|
|
|
|
inn = models.CharField(max_length=100) |
|
|
|
|
yandex_money = models.CharField(max_length=50) |
|
|
|
|
credit_card_number = models.CharField(max_length=50) |
|
|
|
|
passport_scan = models.ImageField(upload_to='users/contractors/') |
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
return self.fio |
|
|
|
|
@ -78,8 +78,8 @@ class ContractorFinancialInfo(models.Model): |
|
|
|
|
verbose_name_plural = 'Финансовая информация' |
|
|
|
|
|
|
|
|
|
class ContractorResume(models.Model): |
|
|
|
|
text = models.TextField() |
|
|
|
|
resume_file = models.FileField(upload_to='users/resume/files/') |
|
|
|
|
text = models.TextField() |
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
return self.text |
|
|
|
|
@ -96,11 +96,11 @@ RESUME_TYPE_FILES = ( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ContractorResumeFiles(models.Model): |
|
|
|
|
description = models.TextField(blank=True) |
|
|
|
|
img = models.ImageField(upload_to='users/resume/images/') |
|
|
|
|
resume = models.ForeignKey(ContractorResume, related_name='resume_files') |
|
|
|
|
title = models.CharField(max_length=255) |
|
|
|
|
description = models.TextField(blank=True) |
|
|
|
|
type = models.CharField(max_length=50, choices=RESUME_TYPE_FILES) |
|
|
|
|
resume = models.ForeignKey(ContractorResume, related_name='resume_files') |
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
return self.title |
|
|
|
|
@ -116,27 +116,27 @@ class User(AbstractBaseUser, PermissionsMixin): |
|
|
|
|
('busy', 'Занят'), |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
username = models.CharField(max_length=50, unique=True) |
|
|
|
|
first_name = models.CharField(max_length=255, blank=True) |
|
|
|
|
last_name = models.CharField(max_length=255, blank=True) |
|
|
|
|
patronym = models.CharField(max_length=255, blank=True) |
|
|
|
|
email = models.EmailField(max_length=255, unique=True, db_index=True) |
|
|
|
|
is_active = models.BooleanField(default=True) |
|
|
|
|
avatar = models.ImageField(upload_to='users/avatars/', blank=True) |
|
|
|
|
contractor_financial_info = models.OneToOneField(ContractorFinancialInfo, related_name='contractor', blank=True, null=True) |
|
|
|
|
contractor_resume = models.OneToOneField(ContractorResume, related_name='contractor', blank=True, null=True) |
|
|
|
|
contractor_specializations = TreeManyToManyField(Specialization, related_name='contractors', blank=True) |
|
|
|
|
contractor_status = models.CharField(default='free', max_length=20, choices=STATUSES) |
|
|
|
|
created = models.DateTimeField(default=timezone.now) |
|
|
|
|
cro = models.BooleanField(default=False) |
|
|
|
|
date_joined = models.DateTimeField(default=timezone.now) |
|
|
|
|
date_of_birth = models.DateTimeField(null=True, blank=True) |
|
|
|
|
email = models.EmailField(max_length=255, unique=True, db_index=True) |
|
|
|
|
first_name = models.CharField(max_length=255, blank=True) |
|
|
|
|
gender = models.CharField(max_length=30, choices=GENDERS, blank=True) |
|
|
|
|
is_active = models.BooleanField(default=True) |
|
|
|
|
last_name = models.CharField(max_length=255, blank=True) |
|
|
|
|
last_time_visit = models.DateTimeField(default=timezone.now) |
|
|
|
|
contractor_specializations = TreeManyToManyField(Specialization, related_name='contractors', blank=True) |
|
|
|
|
contractor_status = models.CharField(default='free', max_length=20, choices=STATUSES) |
|
|
|
|
contractor_financial_info = models.OneToOneField(ContractorFinancialInfo, related_name='contractor',blank=True, null=True) |
|
|
|
|
contractor_resume = models.OneToOneField(ContractorResume, related_name='contractor', blank=True, null=True) |
|
|
|
|
location = TreeForeignKey('common.Location', related_name='users', null=True, blank=True) |
|
|
|
|
patronym = models.CharField(max_length=255, blank=True) |
|
|
|
|
phone = models.CharField(max_length=30, blank=True, null=True) |
|
|
|
|
skype = models.CharField(max_length=100, blank=True) |
|
|
|
|
gender = models.CharField(max_length=30, choices=GENDERS, blank=True) |
|
|
|
|
cro = models.BooleanField(default=False) |
|
|
|
|
username = models.CharField(max_length=50, unique=True) |
|
|
|
|
website = models.CharField(max_length=255, blank=True) |
|
|
|
|
date_of_birth = models.DateTimeField(null=True,blank=True) |
|
|
|
|
avatar = models.ImageField(upload_to='users/avatars/', blank=True) |
|
|
|
|
phone = models.CharField(max_length=30, blank=True, null=True) |
|
|
|
|
|
|
|
|
|
@property |
|
|
|
|
def is_staff(self): |
|
|
|
|
@ -180,8 +180,8 @@ class User(AbstractBaseUser, PermissionsMixin): |
|
|
|
|
|
|
|
|
|
class Team(models.Model): |
|
|
|
|
name = models.CharField(max_length=255) |
|
|
|
|
users = models.ManyToManyField(User, related_name ='teams', blank=True) |
|
|
|
|
owner = models.OneToOneField(User, related_name='team', blank=True, null=True) |
|
|
|
|
users = models.ManyToManyField(User, related_name ='teams', blank=True) |
|
|
|
|
# groups = models.ManyToManyField(Group, related_name='teams', blank=True) |
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
|