django-fractions


Namedjango-fractions JSON
Version 5.0.0 PyPI version JSON
download
home_pagehttps://github.com/jmichalicek/django-fractions
SummaryFraction display and form fields for Django
upload_time2023-01-09 01:14:33
maintainer
docs_urlNone
authorJustin Michalicek
requires_python
licenseBSD
keywords django-fractions
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =============================
django-fractions
=============================

.. image:: https://badge.fury.io/py/django-fractions.png
    :target: https://badge.fury.io/py/django-fractions

.. image:: https://github.com/jmichalicek/django-fractions/workflows/Python%20package/badge.svg
    :target: https://github.com/jmichalicek/django-fractions/actions?query=workflow%3A%22Python+package%22


Fraction display and form fields for Django

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

The full documentation is at https://django-fractions.readthedocs.org.

Quickstart
----------

Install django-fractions::

    pip install django-fractions

Add ``djfractions`` to ``settings.INSTALLED_APPS``


Then use it in a project::

    import djfractions

In templates::

    {% load fractions %}
    {% display_fraction 1.25 %}

In Forms::

    from djfractions.forms import DecimalFractionField
    from django import forms

    class MyForm(forms.Form):
        a_fraction = DecimalFractionField()


Features
--------

* Template tag for displaying float and Decimal values as fractions including mixed numbers
* DecimalFractionField form field which handles input such as "1/4", "1 1/2", "1 and 1/2", and converts to a
  decimal.Decimal instance


TODO
-----

* Add unicode_fraction template tag to display the unicode fraction entity if available
* forms.FloatDecimalField to return a float rather than Decimal
* forms.SplitFractionWidget for having separate numerator and denominator form fields
* forms.SplitMixedFractionWidget for handling mixed number fractions with separate fields
* models.DecimalBackedFractionField() to store a Decimal value but return/accept it as a fraction
* models.FloatBackedFractionField() to store a Decimal value but return/accept it as a fraction


Cookiecutter Tools Used in Making This Package
----------------------------------------------

*  cookiecutter
*  cookiecutter-djangopackage

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jmichalicek/django-fractions",
    "name": "django-fractions",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "django-fractions",
    "author": "Justin Michalicek",
    "author_email": "jmichalicek@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2f/4b/61dc357447fafa4c7596c2ee22516c83700e67ae9a4ce0a9b6a55062041d/django-fractions-5.0.0.tar.gz",
    "platform": null,
    "description": "=============================\ndjango-fractions\n=============================\n\n.. image:: https://badge.fury.io/py/django-fractions.png\n    :target: https://badge.fury.io/py/django-fractions\n\n.. image:: https://github.com/jmichalicek/django-fractions/workflows/Python%20package/badge.svg\n    :target: https://github.com/jmichalicek/django-fractions/actions?query=workflow%3A%22Python+package%22\n\n\nFraction display and form fields for Django\n\nDocumentation\n-------------\n\nThe full documentation is at https://django-fractions.readthedocs.org.\n\nQuickstart\n----------\n\nInstall django-fractions::\n\n    pip install django-fractions\n\nAdd ``djfractions`` to ``settings.INSTALLED_APPS``\n\n\nThen use it in a project::\n\n    import djfractions\n\nIn templates::\n\n    {% load fractions %}\n    {% display_fraction 1.25 %}\n\nIn Forms::\n\n    from djfractions.forms import DecimalFractionField\n    from django import forms\n\n    class MyForm(forms.Form):\n        a_fraction = DecimalFractionField()\n\n\nFeatures\n--------\n\n* Template tag for displaying float and Decimal values as fractions including mixed numbers\n* DecimalFractionField form field which handles input such as \"1/4\", \"1 1/2\", \"1 and 1/2\", and converts to a\n  decimal.Decimal instance\n\n\nTODO\n-----\n\n* Add unicode_fraction template tag to display the unicode fraction entity if available\n* forms.FloatDecimalField to return a float rather than Decimal\n* forms.SplitFractionWidget for having separate numerator and denominator form fields\n* forms.SplitMixedFractionWidget for handling mixed number fractions with separate fields\n* models.DecimalBackedFractionField() to store a Decimal value but return/accept it as a fraction\n* models.FloatBackedFractionField() to store a Decimal value but return/accept it as a fraction\n\n\nCookiecutter Tools Used in Making This Package\n----------------------------------------------\n\n*  cookiecutter\n*  cookiecutter-djangopackage\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Fraction display and form fields for Django",
    "version": "5.0.0",
    "split_keywords": [
        "django-fractions"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "084f543ab24f3d93d82a3c3e45e6b6094d11960804fdb5a1f3635fea2af7bfde",
                "md5": "4a9882072740f93daa25298c2d150f75",
                "sha256": "5403c413d3b0c98a5989fd6acce2700312bf6969b29ac18f750316da10d95c69"
            },
            "downloads": -1,
            "filename": "django_fractions-5.0.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4a9882072740f93daa25298c2d150f75",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 15324,
            "upload_time": "2023-01-09T01:14:31",
            "upload_time_iso_8601": "2023-01-09T01:14:31.551700Z",
            "url": "https://files.pythonhosted.org/packages/08/4f/543ab24f3d93d82a3c3e45e6b6094d11960804fdb5a1f3635fea2af7bfde/django_fractions-5.0.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2f4b61dc357447fafa4c7596c2ee22516c83700e67ae9a4ce0a9b6a55062041d",
                "md5": "e21d224564441c8b23f0a25571fccd12",
                "sha256": "888f1ac97d6d42c07eafa99d121f2a651ae2b558428a1f28246711e48a0dde5e"
            },
            "downloads": -1,
            "filename": "django-fractions-5.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e21d224564441c8b23f0a25571fccd12",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16699,
            "upload_time": "2023-01-09T01:14:33",
            "upload_time_iso_8601": "2023-01-09T01:14:33.444201Z",
            "url": "https://files.pythonhosted.org/packages/2f/4b/61dc357447fafa4c7596c2ee22516c83700e67ae9a4ce0a9b6a55062041d/django-fractions-5.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-09 01:14:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "jmichalicek",
    "github_project": "django-fractions",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "django-fractions"
}
        
Elapsed time: 0.03091s