Skip to main content

sqlalchemy-django-query

tests black

A module that implements a more Django like interface for SQLAlchemy (currently < 1.4) query objects. It's still API compatible with the regular one but extends it with Djangoisms.

Example

class Base(object):
    @declared_attr
    def __tablename__(cls):
        return cls.__name__.lower()

    id = Column(Integer, primary_key=True)

Base = declarative_base(cls=Base)

class Blog(Base):
    name = Column(String)
    entries = relationship('Entry', backref='blog')

class Entry(Base):
    blog_id = Column(Integer, ForeignKey('blog.id'))
    pub_date = Column(Date)
    headline = Column(String)
    body = Column(String)


engine = create_engine('sqlite://')
Base.metadata.create_all(engine)

# session with our class
session = Session(engine, query_cls=DjangoQuery)
session.query(Blog).filter_by(name__exact='blog1').one()
session.query(Blog).filter_by(name__contains='blog').all()
session.query(Entry).filter_by(pub_date__year=2011).one()
session.query(Blog).filter_by(entries__headline__exact='b2 headline 2').one()

Metadata

Release files for sqlalchemy-django-query 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlalchemy-django-query 0.2.2
File Size Uploaded Provenance
sqlalchemy-django-query-0.2.2.tar.gz 4.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlalchemy-django-query 0.2.2
File Interpreter ABI Platform
sqlalchemy_django_query-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / sqlalchemy-django-query-0.2.2.tar.gz

Download URL sqlalchemy-django-query-0.2.2.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
23a4b1e0c472dd6e4d3fae1ef68c7a6dd8d0c8ed3aede2207f297763c84dcc30
BLAKE2b-256 checksum
How to use checksums
7086917aa33b8365e54ae2aab746955300e93a61030c33e3ba7c98ea44bbbb61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.23.0

Release files / sqlalchemy_django_query-0.2.2-py3-none-any.whl

Download URL sqlalchemy_django_query-0.2.2-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48e7782a411fdc00ce46c8b9f12dceccb1f17fa4cb4bd57150fe5dc7ef09a2f8
BLAKE2b-256 checksum
How to use checksums
d56f4c41d3978c0cdbe2b3f73fb79cc279b31d0ae01b605ab740e6ad487a5951
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.23.0

Security for sqlalchemy-django-query 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page