You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ebermergen-td/srv/ebermergen/models/auto_id.py

15 lines
249 B
Python

class AutoID:
last_id = 0
def __init__(self):
self.increment_id()
self.id = self.last_id
@classmethod
def increment_id(cls):
cls.last_id += 1
@classmethod
def reset_id(cls):
cls.last_id = 0