Skip to main content

Inclusive Django Range Fields

Inclusive

The default bound of Django range fields is [). This package follows default bounds as [].

How to use?

pip install inclusive-django-range-fields

Django

# models.py

from django.db import models
from inclusive_django_range_fields import InclusiveIntegerRangeField

class AdCampaign(models.Model):
    age_target = InclusiveIntegerRangeField()
>> AdCampaign.objects.first().age_target
NumericRange(18, 30, '[]')

Django Rest Framework

# serializers.py

from rest_framework import serializers
from inclusive_django_range_fields.drf import InclusiveIntegerRangeField

class AdCampaignSerializer(serializers.ModelSerializer):
    age_target = InclusiveIntegerRangeField()

    class Meta:
        model = AdCampaign
        fields = (
            "id",
            "age_target",
        )
{
  "id": 1993,
  "age_target": {
    "lower": 18,
    "upper": 30
  }
}

Reference

Model Fields

  • inclusive_django_range_fields.InclusiveIntegerRangeField
  • inclusive_django_range_fields.InclusiveBigIntegerRangeField
  • inclusive_django_range_fields.InclusiveDateRangeField

Ranges

  • inclusive_django_range_fields.InclusiveNumericRange
  • inclusive_django_range_fields.InclusiveDateRange
  • inclusive_django_range_fields.InclusiveDateTimeTZRange

Django Rest Framework Serializers

  • inclusive_django_range_fields.drf.InclusiveIntegerRangeField
  • inclusive_django_range_fields.drf.InclusiveDateRangeField

Form Fields

  • inclusive_django_range_fields.InclusiveIntegerRangeFormField
  • inclusive_django_range_fields.InclusiveDateRangeFormField

PyPI

https://pypi.org/project/inclusive-django-range-fields/

Release files for inclusive-django-range-fields 0.2.3

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

Source distribution (sdist)

Source distribution for inclusive-django-range-fields 0.2.3
File Size Uploaded
inclusive_django_range_fields-0.2.3.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for inclusive-django-range-fields 0.2.3
File Interpreter ABI Platform
inclusive_django_range_fields-0.2.3-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 10.1 kB

Release files / inclusive_django_range_fields-0.2.3.tar.gz

Download URL inclusive_django_range_fields-0.2.3.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1d8254f532aa53d675d41a3c03826081c69ab2df6cccf6caadca4ffb46f883e1
BLAKE2b-256 checksum
How to use checksums
25d145e6df7fc1aa453e193cbc050e0bad4eb1881edd2182527dfa6d604d659c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/2.7.15 Darwin/18.2.0

Release files / inclusive_django_range_fields-0.2.3-py2.py3-none-any.whl

Download URL inclusive_django_range_fields-0.2.3-py2.py3-none-any.whl
Size 6.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1bb7b5b59ed664af858781379d985fa298c78aecf6cb76bbb471aaed923707fc
BLAKE2b-256 checksum
How to use checksums
33597dda13af8fedf848a3de5ea2394e1da230cf7a6b38c34f635f978e1e40b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/2.7.15 Darwin/18.2.0

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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