[문제 현황]
[해결 방법]
[변경 후 코드]
class Job(models.Model):
main_category = models.ForeignKey(MainCategory, on_delete=models.SET_NULL, null=True)
sub_category = models.ForeignKey(SubCategory, on_delete=models.SET_NULL, null=True)
company = models.ForeignKey(Company, on_delete=models.SET_NULL, null=True)
name = models.CharField(max_length=200)
article = models.TextField(null=True)
deadline = models.CharField(max_length=200, null=True)
reward_amount = models.DecimalField(max_digits=10, decimal_places=2, null=True)
created_at = models.DateTimeField(auto_now_add=True)
likes = models.ManyToManyField('account.Account', related_name='like_jobs', through='Like')
bookmarks = models.ManyToManyField('account.Account', related_name='bookmark_jobs', through='Bookmark')
applies = models.ManyToManyField('account.Account', related_name='apply_jobs', through='Apply')
shares = models.ManyToManyField('account.Account', related_name='share_jobs', through='Share')
[문제현황]
[문제 해결]
[변경 후 코드]
class Profile(models.Model):
main_category = models.ForeignKey('job.MainCategory', on_delete=models.SET_NULL, null=True)
sub_category = models.ForeignKey('job.SubCategory', on_delete=models.SET_NULL, null=True)
career = models.OneToOneField('Career', on_delete=models.SET_NULL, null=True)
class Meta:
db_table = 'profiles'
[문제현황]
[문제해결]