You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

simpel-numerators

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simpel-numerators

Date formatted object numbering system


Maintainers
1

Readme

🚀 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'

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc