python_2_unicode_com patible class ContactRelation CopyMixin TimeStamp

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
@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)