Hi,

On Fri, 29 Aug 2014, Andrew Starr-Bochicchio wrote:
> > It should probably be a method of PackageName so that we get the short
> > description for free in any other context... for example in the mail
> > bot when we confirm the subscription or something like that.
> 
> Makes sense. I think I've addressed all the other issues as well.

Hum, not really, it still makes direct queries instead of relying on
attributes of the (Source|Binary)PackageName object:

> +    def short_description(self):

So in theory this function should in fact be implemented twice:

- once in SourcePackageName where it will iterate over
  self.main_version.binarypackage_set.all() to find the binary package of
  same name, something along those lines:
  desc = None
  for binpkg in self.main_version.binarypackage_set.all():
      if desc is None:
          desc = binpkg.short_description
      if binpkg.binary_package_name.name = self.name
          desc = binpkg.short_description
          break

- once in BinaryPackageName where it will iterate over
  self.binary_package_versions.all() to grab the description
  from the package with the highest version

But for your specific need, you can just do it in SourcePackageName.

Sorry if this wasn't clear enough in my previous mail.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/


-- 
To UNSUBSCRIBE, email to debian-qa-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140830122947.ga3...@x230-buxy.home.ouaza.com

Reply via email to