Skip to main content

Core library for Nexus django projects

Project description

=============================
Django GenomiX
=============================

.. image:: https://badge.fury.io/py/django-genomix.svg
:target: https://badge.fury.io/py/django-genomix

.. image:: https://travis-ci.org/chopdgd/django-genomix.svg?branch=develop
:target: https://travis-ci.org/chopdgd/django-genomix

.. image:: https://codecov.io/gh/chopdgd/django-genomix/branch/develop/graph/badge.svg
:target: https://codecov.io/gh/chopdgd/django-genomix

.. image:: https://pyup.io/repos/github/chopdgd/django-genomix/shield.svg
:target: https://pyup.io/repos/github/chopdgd/django-genomix/
:alt: Updates

.. image:: https://pyup.io/repos/github/chopdgd/django-genomix/python-3-shield.svg
:target: https://pyup.io/repos/github/chopdgd/django-genomix/
:alt: Python 3

Core library for Nexus django projects

Documentation
-------------

The full documentation is at https://django-genomix.readthedocs.io.

Quickstart
----------

Install Django GenomiX::

pip install django-genomix

Add it to your `INSTALLED_APPS`:

.. code-block:: python

INSTALLED_APPS = (
...
'genomix',
...
)


Features
--------

1. DisplayChoiceField - display representation values for choice fields in REST APIs.::

.. code-block:: python

from genomix.fields import DisplayChoiceField
from rest_framework import serializers

from . import choices


class ExampleSerializer(serializers.ModelSerializer):

status = DisplayChoiceField(choices=choices.STATUS_OPTIONS)

2. UserRelatedField - display username for a REST API with a user relation.::

.. code-block:: python
from django.contrib.auth import get_user_model

from genomix.fields import UserRelatedField
from rest_framework import serializers


class ExampleSerializer(serializers.ModelSerializer):

user = UserRelatedField(queryset=get_user_model().objects.all())


3. ContentRelatedField - display ContentType model for a REST API using a generic relation.::

.. code-block:: python
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType

from genomix.fields import ContentRelatedField
from rest_framework import serializers


class ExampleSerializer(serializers.ModelSerializer):

content_type = ContentRelatedField(queryset=ContentType.objects.all())

4. DisplayChoiceFilter - Filter by representation values in a REST API.::

.. code-block:: python

import django_filters
from genomix.filters import DisplayChoiceFilter

from . import choices


class ExampleFilter(django_filters.rest_framework.FilterSet):

source = DisplayChoiceFilter(choices=choices.SOURCES)

Running Tests
-------------

Does the code actually work?

::

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits
-------

Tools used in rendering this package:

* Cookiecutter_
* `cookiecutter-djangopackage`_

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage




History
-------

0.1.0 (2017-12-02)
++++++++++++++++++

* First release on PyPI.
* TimeStampedLabelModel abstract model class
* UserRelatedField for use in DRF serializers
* DisplayChoiceField for use in DRF serializers
* ContentRelatedField for use in DRF serializers
* DefaultRouter that allows you to extend other routers
* ModelMixinTestCase that allows you to test abstract model classes

0.2.0 (2017-12-31)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.1.0...v0.2.0>`_

* Added utils function to retrieve data from a URL
* Added utils function to retrieve compressed data from a URL

0.3.0 (2018-01-04)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.2.0...v0.3.0>`_

* DisplayChoiceFilter for use in django_filters. Filter by diplay fields for a choice field in a REST API

0.4.0 (2018-01-05)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.3.0...v0.4.0>`_

* Improved docs
* Beta release

0.4.1 (2018-01-09)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.4.0...v0.4.1>`_

* DisplayChoiceFilter fixed coerce method to handle Choices with different display values.

0.5.0 (2018-02-09)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.4.1...v0.5.0>`_

* Updated requirements to the latest.

0.6.0 (2018-04-07)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.5.0...v0.6.0>`_

* Added support for Django 2.0 and Python3.6
* Dropped support for Django <1.11 and Python 2.7, 3.3, 3.4

0.6.1 (2018-04-18)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.6.0...v0.6.1>`_

* Upgraded 3rd party libs

0.6.2 (2018-05-16)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.6.1...v0.6.2>`_

* Updated setup.py to read install_requires from requirements.txt

0.6.3 (2018-08-13)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.6.2...v0.6.3>`_

* Updated 3rd party requirements. Some requirements had changed so it was causing failures

0.6.4 (2018-10-29)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.6.3...v0.6.4>`_

* Updated deps and adjusted for new flake8 reqs

0.6.5 (2019-02-07)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.6.4...v0.6.5>`_

* Updated deps

0.6.6 (2019-04-10)
++++++++++++++++++

`Full Changelog <https://github.com/chopdgd/django-genomix/compare/v0.6.5...v0.6.6>`_

* Updated deps
* Updated travis to use xenial distribution. Django 2.1 dropped support for SQLite < 3.8.3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-genomix-0.6.6.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

django_genomix-0.6.6-py2.py3-none-any.whl (8.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-genomix-0.6.6.tar.gz.

File metadata

  • Download URL: django-genomix-0.6.6.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.6

File hashes

Hashes for django-genomix-0.6.6.tar.gz
Algorithm Hash digest
SHA256 1793061a32dcfe670df57b793e0278934ffca0524868b81e0dbb6db3b048444d
MD5 79e3cd8e2f409c24683b54de6e4748b1
BLAKE2b-256 b96657e05a6224582565ae4f4e1a2aa5a072cc38a654e73bfbe9b572a12fdec2

See more details on using hashes here.

Provenance

File details

Details for the file django_genomix-0.6.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_genomix-0.6.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 00d8c6b8503eac838d765c5e5999f7505cede260b32face40516ba40a7c86751
MD5 c1178d3d67692f2ee4d48705bb30bfd6
BLAKE2b-256 43b70fd9c7626488c41af4520936363e5e89326c0d42ee4b07dbcbc5de602437

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page