Hi kenkennie!
I think the problem lies in the algorithm, not the technology platform, language or framework.
You can use .zfill(n) to add n-1 zeros in front of the string. Then add INV in front
eg:
# get last item
item = Invoice.objects.filter(invoice_number__istartswith='INV').order_by('-create_date')[0]
# last index
index = int(item['invoice_number'][-3:]) # = int('003') = 3
res = 'INV-' + str(x+1).zfill(3)
# res = 'INV-004'
Sorry to ask. This should be in models.py or views.py? if you could write the function i would really appreciate
i am new to django building my first project