Metadata-Version: 1.1
Name: djextra
Version: 0.1
Summary: Additional Functions for Django
Home-page: https://github.com/hiroaki-yamamoto/djextra
Author: Hiroaki Yamamoto
Author-email: hiroaki@hysoftware.net
License: MIT
Description-Content-Type: UNKNOWN
Description: Additional code for Django
        ==========================
        
        |Travis CI Image| |Coveralls Image| |Code Climate Maintainability Check
        Image|
        
        What this?
        ----------
        
        This repository contains additional code for Django.
        
        Why I create this?
        ------------------
        
        Because I love Django, and usually using it. However, I found some
        essential code is lacked for modern web development. For example, you
        might want to send Ajax Payload like this:
        
        .. code:: JSON
        
            {
              "name": "John Doe",
              "age": 49,
              "email": "john@example.com",
              "email_aliases": [
                "john.due@example.com",
                "due_49@example.com",
                "john.1968@example.com"
              ]
            }
        
        In this case, you can validate name, age, and email field by using
        ``Form`` layer on Django. However, email\_aliases cannot be validated
        because it's a list and it should validate each value whether it is
        email-formatted or not.
        
        To support this case (and some other cases that Django can't handle), I
        wrote some code to support List validation.
        
        How To Use It
        -------------
        
        ListField
        ~~~~~~~~~
        
        ListField is used to handle a list of values like above example. To use
        ListField, you can write a form like this:
        
        ``forms.py``
        
        .. code:: python
        
            from django import forms
            from djextra import forms as exforms
        
        
            class ExampleForm(forms.Form):
              name = forms.CharField()
              age = forms.IntegerField()
              email = forms.EmailField()
              email_aliases = exforms.ListField(field=forms.EmailField())
        
        Then, Inputting the data as usual, the validation will start. If you
        don't specify ``field`` keyword argument, ``django.forms.CharField``
        object is specified.
        
        Contribution
        ------------
        
        Contribution of code is welcome, and the code is tested with tox. Before
        sending your pull request, please check you tested your code very well.
        
        License
        -------
        
        This repository is licensed under the terms of MIT License. Please check
        `LICENSE.md <LICENSE.md>`__ for the detail.
        
        .. |Travis CI Image| image:: https://travis-ci.org/hiroaki-yamamoto/djextra.svg?branch=master
           :target: https://travis-ci.org/hiroaki-yamamoto/djextra
        .. |Coveralls Image| image:: https://coveralls.io/repos/github/hiroaki-yamamoto/djextra/badge.svg?branch=master
           :target: https://coveralls.io/github/hiroaki-yamamoto/djextra?branch=master
        .. |Code Climate Maintainability Check Image| image:: https://api.codeclimate.com/v1/badges/1ed2f1c354e6357d711c/maintainability
           :target: https://codeclimate.com/github/hiroaki-yamamoto/djextra/maintainability
        
Keywords: Django
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.5
Classifier: Framework :: Django :: 2.0
Classifier: Framework :: Django :: 1.11
