Metadata-Version: 2.1
Name: simpel-numerators
Version: 0.1
Summary: Date formatted object numbering system
Home-page: https://gitlab.com/simpel-projects/simpel-numerators
Author: Rizki Sasri Dwitama
Author-email: sasri.works@gmail.com
License: MIT
Project-URL: Documentation, https://gitlab.com/simpel-projects/simpel-numerators/-/wikis/
Project-URL: Source, https://gitlab.com/simpel-projects/simpel-numerators
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# 🚀 Simpel Numerators

Simpel Numerators track autonumber style inner_id for model record
This repository contains a [Numerator](https://gitlab.com/simpel-projects/simpel-numerators) model utils to create nice formatted Inner ID.

## Installation

```shell
pip install simpel-numerators

```

## Usage

```python

from django.db import models
from simpel_numerators.models import NumeratorMixin

class Product(NumeratorMixin):
    doc_prefix = 'PD'
    name = models.CharField(max_length=100)

```

## Usage with Polymorphic

install django-polymorphic

```shell

pip install django-polymorphic

```

### Using Parent Model doc_prefix

```python
from django.db import models
from polymorphic.models import PolymorphicModel
from simpel_numerators.models import NumeratorMixin, NumeratorReset

class Product(NumeratorMixin):
    doc_prefix = 'PD'
    parent_prefix = True
    parent_model = 'Parent2'
    name = models.CharField(max_length=100)

class Inventory(Product):
    pass

class Asset(Product)
    pass
```

### Using Child Model doc prefix

```python

class Product(NumeratorMixin):
    name = models.CharField(max_length=100)

class Inventory(Product):
    doc_prefix = 'INV'

class Asset(Product)
    doc_prefix = 'AST'

```


