@python_2_unicode_compatible
class ContactRelation(CopyMixin, TimeStampedModel):
project = models.ForeignKey('pekama.Project', related_name='contact_relations', null=True, blank=True)
sub_matter = models.ForeignKey('legal.SubMatter', null=True)
event = models.ForeignKey('legal.Event', null=True, blank=True, on_delete=models.SET_NULL)
is_public = models.BooleanField(default=False)
contact = models.ForeignKey('Contact')
relation = models.ForeignKey('Relation')
ownership_percentage = models.IntegerField(null=True, blank=True, validators=[MinValueValidator(0),
MaxValueValidator(100)])
class Meta:
unique_together = ('project', 'contact', 'relation')
def __str__(self):
return str(self.contact)