Esempio n. 1
0
    def get_package(package):
        q = Package.select().where(
            Package.lower_name == package.lower()
            or Package.lower_name == normalize_package_name(package)).limit(1)

        if not q.count():
            raise HTTPError(404)

        return q[0]
Esempio n. 2
0
    def get_package(package):
        q = Package.select().where(
            Package.lower_name == package.lower() or Package.lower_name == normalize_package_name(package)
        ).limit(1)

        if not q.count():
            raise HTTPError(404)

        return q[0]
Esempio n. 3
0
    def get_version(package, version):
        package = normalize_package_name(package)
        q = PackageVersion.select().join(Package).join(PackageFile).where(
            Package.lower_name == package,
            PackageVersion.version == version,
        ).limit(1)

        if not q.count():
            raise HTTPError(404)

        return q[0]
Esempio n. 4
0
    def get_version(package, version):
        package = normalize_package_name(package)
        q = PackageVersion.select().join(Package).join(PackageFile).where(
            Package.lower_name == package,
            PackageVersion.version == version,
        ).limit(1)

        if not q.count():
            raise HTTPError(404)

        return q[0]