def save(self, *args, **kwargs):
        self.license = normalize_license(self.license)

        # reset the latest_version cache on the package
        cache_name = self.package.cache_namer(self.package.last_released)
        cache.delete(cache_name)
        get_version(self.package)

        # reset the pypi_version cache on the package
        cache_name = self.package.cache_namer(self.package.pypi_version)
        cache.delete(cache_name)
        get_pypi_version(self.package)

        super(Version, self).save(*args, **kwargs)
    def save(self, *args, **kwargs):
        self.license = normalize_license(self.license)

        # reset the latest_version cache on the package
        cache_name = self.package.cache_namer(self.package.last_released)
        cache.delete(cache_name)
        get_version(self.package)

        # reset the pypi_version cache on the package
        cache_name = self.package.cache_namer(self.package.pypi_version)
        cache.delete(cache_name)
        get_pypi_version(self.package)

        super(Version, self).save(*args, **kwargs)
 def last_released(self):
     cache_name = self.cache_namer(self.last_released)
     version = cache.get(cache_name)
     if version is not None:
         return version
     version = get_version(self)
     cache.set(cache_name, version)
     return version
 def last_released(self):
     cache_name = self.cache_namer(self.last_released)
     version = cache.get(cache_name)
     if version is not None:
         return version
     version = get_version(self)
     cache.set(cache_name, version)
     return version