I have a model and I want to get the method variable "row_count and column" count to put the value into the templates.
class Data(models.Model):
    """ Model of Data"""
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    document = models.FileField(upload_to='documents/%Y/%m/%d')
    uploaded_at = models.DateTimeField(auto_now_add=True)
    amount = models.DecimalField(default=0, max_digits=6, decimal_places=2,
                                 blank=True, null=True)
    def calculate_amount(self):
        # wb = xlrd.open_workbook('media/' + self.document.name)
        wb = xlrd.open_workbook(os.path.join(settings.MEDIA_ROOT,
                                             self.document.name))
        worksheet = wb.sheet_by_index(0)
        # Show this value into templates
        row_count = worksheet.nrows
        column_count = worksheet.ncols
 
    