I\'m trying to implement (what I think is) a pretty simple data model for a counter:
class VisitorDayTypeCounter(models.Model):
visitType = models.CharFi
Your should use database transactions to avoid this kind of race condition. A transaction lets you perform the whole operation of creating, reading, incrementing and saving the counter on an "all or nothing" base. If anything goes wrong it will roll back the whole thing and you can try again.
Check out the Django docs. There is a transaction middle ware, or you can use decorators around views or methods to create transactions.