<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save(self, *args, **kwargs):
 """ custom save method to update counts """

        # the following lines determines if the comment is being created or not
        # in case the comment exists the pk attribute is an int
        created = type(self.pk) is not int

        super(UpdateCountsMixin, self).save(*args, **kwargs)

        # this operation must be performed after the parent save
        if created:
            self.update_count()