Skip to main content

Core library for Nexus django projects

Project description

https://badge.fury.io/py/django-genomix.svg https://travis-ci.org/chopdgd/django-genomix.svg?branch=develop https://codecov.io/gh/chopdgd/django-genomix/branch/develop/graph/badge.svg Updates 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:

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

Features

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

from genomix.fields import DisplayChoiceField
from rest_framework import serializers

from . import choices


class ExampleSerializer(serializers.ModelSerializer):

    status = DisplayChoiceField(choices=choices.STATUS_OPTIONS)
  1. UserRelatedField - display username for a REST API with a user relation.:

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())
  1. ContentRelatedField - display ContentType model for a REST API using a generic relation.:

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())
  1. DisplayChoiceFilter - Filter by representation values in a REST API.:

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:

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)

0.2.0 Changelog

  • 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)

0.3.0 Changelog

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

0.4.0 (2018-01-05)

0.4.0 Changelog

  • Improved docs

  • Beta release

0.4.1 (2018-01-09)

0.4.1 Changelog

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

0.5.0 (2018-02-09)

0.5.0 Changelog

  • Updated requirements to the latest.

0.6.0 (2018-04-07)

0.6.0 Changelog

  • 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)

0.6.1 Changelog

  • Upgraded 3rd party libs

0.6.2 (2018-05-16)

0.6.2 Changelog

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

0.6.3 (2018-08-13)

0.6.3 Changelog

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

0.6.4 (2018-10-29)

0.6.4 Changelog

  • Updated deps and adjusted for new flake8 reqs

0.6.5 (2019-02-07)

0.6.5 Changelog

  • Updated deps

0.6.6 (2019-04-10)

0.6.6 Changelog

  • Updated deps

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

0.6.7 (2019-05-30)

0.6.7 Changelog

  • Updated deps

0.6.8 (2019-07-26)

0.6.8 Changelog

  • Updated deps

0.6.9 (2019-08-09)

0.6.9 Changelog

  • Updated deps

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.9.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

django_genomix-0.6.9-py2.py3-none-any.whl (8.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for django-genomix-0.6.9.tar.gz
Algorithm Hash digest
SHA256 d6220a14c61a7fd7b7910636c6edb35b97af827c78ea82b57e836801b45a310e
MD5 ccec4f729e7b40cfecfc3259e94a493c
BLAKE2b-256 8f937dc94ad201b8cd39aeecf4cf010cbee4516559ad106c3356937ca220bfce

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for django_genomix-0.6.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2172cc1c2f5d9681a2e67c3849a3ac4ae30c4c7d94d86dce29addc771f5ee49b
MD5 1ef0ea69478ff8356f0308afe435363c
BLAKE2b-256 619cb96507131faba6c11853c27ed2388cffe311096a5c1a8188b1d1fc5ae175

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