Skip to main content

Date formatted object numbering system

Project description

🚀 Simpel Numerators

Simpel Numerators track autonumber style inner_id for model record This repository contains a Numerator model utils to create nice formatted Inner ID.

Installation

pip install simpel-numerators

Usage

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

pip install django-polymorphic

Using Parent Model doc_prefix

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

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

class Inventory(Product):
    doc_prefix = 'INV'

class Asset(Product)
    doc_prefix = 'AST'

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simpel-numerators-0.1.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

simpel_numerators-0.1-py3-none-any.whl (8.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page