Metadata-Version: 1.1
Name: django-base64field
Version: 0.9
Summary: A motherfucking django model field to bring base64 encoded key to models.
Home-page: https://github.com/Alir3z4/django-base64field
Author: Alireza Savand
Author-email: alireza.savand@gmail.com
License: Copyright (c) 2013 Alireza Savand
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the authors nor the
      names of its contributors may be used to endorse or promote products
      derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Description: ==================
        Django Base64Field
        ==================
        
        .. image:: https://travis-ci.org/Alir3z4/django-base64field.png
           :alt: travis-cli tests status for django-base64field
           :target: https://travis-ci.org/Alir3z4/django-base64field
        
        .. contents:: Table of contents
        
        Overview
        --------
        
        - A motherfucking django model field to bring ``base64`` encoded key to models.
        - It uses ``base64`` from ``django.utils.baseconv`` for encoding.
        - Tested on Python2.7, Python3.3 .
        
        How it works?
        --------------
        
        ``Base64Field`` is useful where you need a base64 encoded value from
        model's Primary Key a.k.a PK which is available on every django
        application model by default. Sine `base64` encoder works with
        `integer` value then PK should be also `integer`, Fortunately
        again `PK` field is `integer` by nature.
        
        When a model get saved, `post_save` signal will be emitted,
        This is where a base64 encoded key will be generated/encoded
        from model's `PK`, Then model will get **updated** not saved again.
        this operation happens just one the first time model get saved.
        In next time model get saved or updated `base64` won't get generated.
        
        You wanna know more about how ``django-base64field`` works? Then get da fuck
        out of ``README.rst`` and go look inside ``django_base64field.tests.py``.
        
        Usage
        -----
        
        Here is simple usage of ``Base64Field``
        ::
            >>> from django.db import models
            >>> from django_base64field.fields import Base64Field
            >>>
            >>> class MyModelianto(models.Model):
            >>>     ek = Base64Field()
            >>>
            >>> modelia = MyModelianto.objects.create(pk=314159265358979323)
            >>> modelia.ek
            >>> u''
            >>> refreshed_modelia = MyModelianto.objects.get(pk=modelia.pk)
            >>> modelia.ek
            >>> u'HS7Y_sdg3x'
        
        As You can see ``ek`` in not available on returned instance
        from ``MyModelianto.objects.create()``, It will be available after retrieving
        ``refreshed_modelia`` from database which is same record as ``modelia`` here.
        
        This behavior can be easily controlled with implementing a simple helper
        method on ``MyModelianto``. You can find out more about this solution on
        ``django_base64field.tests.py``, Which it doesn't require to retrieving 
        the instance from database after first creation just for getting ``ek` field.
        
        Installation
        ------------
        ``django-base64field`` is available on pypi
        
        http://pypi.python.org/pypi/django-base64field
        
        So easily install it by ``pip``
        ::
        
            $ pip install django-base64field
        
        Or by ``easy_install``
        ::
        
            $ easy_install django-base64field
        
        Another way is by cloning ``django-base64field``'s
        `git repo <https://github.com/Alir3z4/django-base64field>`_ ::
        
            $ git clone git://github.com/Alir3z4/django-base64field.git
        
        Then install it by running
        ::
        
            $ python setup.py install
        
        Or I don't know, Install it directly from git.
        ::
        
            pip install git+https://github.com/Alir3z4/django-base64field.git#egg=django-base64field
        
        
        Some pkg have no installation method, This is awefuckingsome that
        ``django-base64field`` gives you many ways for installation.
        
Keywords: django,base64,field
Platform: OS Independent
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python
Classifier: Framework :: Django
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Software Development
