# Path: arch/models.py
# class PackageArchitecture(Architecture):
# 
#     class Meta(Architecture.Meta):
#         verbose_name = 'Package Architecture'
# 
# class MachineArchitecture(Architecture):
# 
#     class Meta(Architecture.Meta):
#         verbose_name = 'Machine Architecture'
# 
# Path: packages/managers.py
# class PackageManager(models.Manager):
#     def get_queryset(self):
#         return super(PackageManager, self).get_queryset().select_related()


from django.db import models
from django.urls import reverse
    from version_utils.rpm import labelCompare
    from rpm import labelCompare
from debian.debian_support import Version, version_compare
from arch.models import PackageArchitecture, MachineArchitecture
from packages.managers import PackageManager
        from repos.models import Repository
    from operatingsystems.models import OSGroup

    def get_absolute_url(self):
        return self.name.get_absolute_url()

    def __key(self):
        return (self.name, self.epoch, self.version, self.release, self.arch,
                self.packagetype)

    def __eq__(self, other):
        return self.__key() == other.__key()

    def __ne__(self, other):
        return not self.__eq__(other)

    def __hash__(self):
        if not self:
            return 0
        return hash(self.__key())

    def _version_string_rpm(self):
        return (str(self.epoch), str(self.version), str(self.release))

    def _version_string_deb_arch(self):
        epoch = ''
        version = ''
        release = ''
        if self.epoch != '':
            epoch = str(self.epoch) + ':'
        if self.version != '':
            version = str(self.version)

# Path: arch/models.py
# class PackageArchitecture(Architecture):
# 
#     class Meta(Architecture.Meta):
#         verbose_name = 'Package Architecture'
# 
# class MachineArchitecture(Architecture):
# 
#     class Meta(Architecture.Meta):
#         verbose_name = 'Machine Architecture'
# 
# Path: packages/managers.py
# class PackageManager(models.Manager):
#     def get_queryset(self):
#         return super(PackageManager, self).get_queryset().select_related()


# Path: packages/models.py
from django.db import models
from django.urls import reverse
    from version_utils.rpm import labelCompare
    from rpm import labelCompare
from debian.debian_support import Version, version_compare
from arch.models import PackageArchitecture, MachineArchitecture
from packages.managers import PackageManager
        from repos.models import Repository
    from operatingsystems.models import OSGroup


    def get_absolute_url(self):
        return self.name.get_absolute_url()

    def __key(self):
        return (self.name, self.epoch, self.version, self.release, self.arch,
                self.packagetype)

    def __eq__(self, other):
        return self.__key() == other.__key()

    def __ne__(self, other):
        return not self.__eq__(other)

    def __hash__(self):
        if not self:
            return 0
        return hash(self.__key())

    def _version_string_rpm(self):
        return (str(self.epoch), str(self.version), str(self.release))

    def _version_string_deb_arch(self):
        epoch = ''
        version = ''
        release = ''
        if self.epoch != '':
            epoch = str(self.epoch) + ':'
        if self.version != '':
            version = str(self.version)

        if self.release != '':