Skip to main content

Summary

Experimental ORM Query object

The idea is to make RQL requests building simpler, and all with pythonic syntax.

It borrows a lot from the SQLAlchemy ORM.

Examples

Basic query with no filtering

::

CWUser = vreg[‘etypes’].etype_class(‘CWUser’) CWGroup = vreg[‘etypes’].etype_class(‘CWGroup’)

q = req.query(CWUser) assert q.torql(), (“Any X WHERE X is CWUser”, {})

q.all()

Same with attribute eagerloading:

q = req.query(CWUser).eagerload('login')

With filtering:

q = req.query(CWUser)
q = q.filter(CWUser.in_group.filter(CWGroup.name == u'managers'))

More complex filtering:

import datetime as dt

q = req.query(CWUser)
q = q.filter(
    (CWUser.creation_date >= dt.date.now() - dt.timedelta(30))
    & CWUser.in_group.filter(
        (CWGroup.name == u"users")))

Release files for rqlquery 0.4.0

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

Source distribution (sdist)

Source distribution for rqlquery 0.4.0
File Size Uploaded
rqlquery-0.4.0.tar.gz 8.1 kB Details

Release files / rqlquery-0.4.0.tar.gz

Download URL rqlquery-0.4.0.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d6818eb68edc99bce12a2236420aed79e80e3ad861ec147cb3584d1747ab4b7c
BLAKE2b-256 checksum
How to use checksums
10e3973737d1b582bc6816041bb4c3e00f29e60f834f4efc8cfc193c0d3fd0a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.4.0 This release

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

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