Metadata-Version: 2.0
Name: django-mongo-coupons
Version: 0.0.1.dev2
Summary: Django-coupons with mongoengine
Home-page: https://github.com/ShipraShalini/django_mongo_coupons.git
Author: shiprashalini
Author-email: code.shipra@gmail.com
License: UNKNOWN
Keywords: django mongo coupons
Platform: UNKNOWN
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4

# django-mongo-coupons

<!--![build status](https://travis-ci.org/byteweaver/django-coupons.png)-->


A mongoengine implementaion of [django-coupons](https://github.com/byteweaver/django-coupons "Django-coupons"), A reuseable Django application for coupon gereration and handling.



## Setup instructions

1. Install `django-mongo-coupons` via pip:
   ```
   $ pip install django-mongo-coupons
   ```

2. Add `'mongo_coupons'` to `INSTALLED_APPS` in `settings.py`.


    ```Python
    INSTALLED_APPS = [
        ...
        'mongoengine'
        'rest_framework_mongoengine',
        'mongo_coupons'
        ...
    ]
    ```

## Dependencies
* mongoengine
* django-mongoengine (unstable release)
* django-rest-framework
* django-rest-framework-mongoengine

## Supported use cases of coupons

Supports all coupons supported by  [django-coupons](https://github.com/byteweaver/django-coupons "Django-coupons") and few more:

 * single time (default): coupon can be used one time without being bound to an user.
 * user limited: coupon can be used one time but only by a specific user.
 * limit number: coupon can be used a limited number of times, by any user once.
 * users list: coupon can be used by a defined list of users, each once.
 * unlimited: coupon can be used unlimited times, but only once by the same user.
 * usage limited: type of coupon can be any of the above but can be used only n times


## Example

$ curl -H 'Accept: application/json; indent=4' 'http://localhost:8000/coupons/' -X POST -d '{
    "value": 50,
    "code": "",
    "type": "percentage",
    "user_limit": 3,
    "campaign": "5249afavhe55c75703521a5b783",
    "max_discount": "500"
}'
<sup>* campain: _id of the campain</sup>

