There are 2 models, customer model and ticket creation for a customer
class cust_M(models.Model): customer = models.TextField(max_length=8)
class TKT(models.Model): tkt_unique_id = models.ForeignKey(customer) + autoincremented
when ever we create a instance for the TKT i want to increment the number for the customer. eg: customer1 - 1 customer1 - 2 customer1 - 3
customer2 - 1 customer2 - 2 customer2 - 3 ... ...
Use this statement me in models.py and it will autoincrement
from django.db import models class Order(models.Model): auto_increment = models.AutoField(primary_key=True)
1.4m articles
1.4m replys
5 comments
57.0k users