Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Schindler committed Jul 17, 2019
0 parents commit e661e74
Show file tree
Hide file tree
Showing 23 changed files with 962 additions and 0 deletions.
124 changes: 124 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
14 changes: 14 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2

sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

python:
version: 3.7
install:
- requirements: docs/requirements.txt
- method: pip
path: .
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: python
dist: xenial

cache:
directories:
- "$HOME/.cache/pip"

python:
- "3.7"

install:
- pip install 'tox-travis >= 0.12'

script: tox

jobs:
include:
- { env: [TOXENV=docs], stage: Docs and linting }
- { env: [TOXENV=lint] }
- { env: [TOXENV=tests-django22], stage: Unit tests }
- { env: [TOXENV=tests-django21] }
- { env: [TOXENV=tests-django20] }
- { env: [TOXENV=coverage-report], stage: Test coverage }
28 changes: 28 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
django-flexquery
================

.. image:: https://travis-ci.org/efficiosoft/django-flexquery.svg?branch=master
:alt: Build Status
:target: https://travis-ci.org/efficiosoft/django-flexquery
.. image:: https://coveralls.io/repos/github/efficiosoft/django-flexquery/badge.svg?branch=master
:alt: Test Coverage
:target: https://coveralls.io/github/efficiosoft/django-flexquery?branch=master
.. image:: https://readthedocs.org/projects/django-flexquery/badge/?version=latest
:alt: Documentation
:target: https://django-flexquery.readthedocs.io/en/latest/

This library aims to provide a new way of declaring reusable QuerySet filtering
logic in your Django project, incorporating the DRY principle and maximizing user
experience and performance by allowing you to decide between sub-queries and JOINs.

Its strengths are, among others:

* Easy to learn in minutes
* Cleanly integrates with Django's ORM
* Small code footprint, less bugs - ~150 lines of code (LoC)
* 100% test coverage
* Fully documented code, formatted using the excellent `Black Code Formatter
<https://github.com/python/black>`_.

See the `documentation at Read The Docs <https://django-flexquery.readthedocs.org>`_
to convince yourself.
15 changes: 15 additions & 0 deletions django_flexquery/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Reusable QuerySet filtering logic for Django.
"""

try:
from .flexquery import Manager, FlexQuery, QuerySet
from .q import Q
except ImportError: # pragma: no cover
# Django is missing, just provide version
__all__ = []
else:
__all__ = ["FlexQuery", "Manager", "Q", "QuerySet"]


__version__ = "1.0.0"

0 comments on commit e661e74

Please sign in to comment.