I'm developing a hospital project!
People can apply online appointment for a specific doctor and the people will get a serial number once done the process of online appointment.
Here is my model:
class Appointment(models.Model):
doctor = models.ForeignKey(
DoctApp, on_delete=models.CASCADE, related_name="appointments")
fee = models.IntegerField(default=1000, validators=[
MaxValueValidator(2000)])
name = models.CharField(max_length=220)
phone = models.CharField(max_length=12, default="01700000000")
age = models.IntegerField(validators=[MaxValueValidator(200)])
gender = models.CharField(max_length=10, choices=gen_choises)
address = models.TextField(blank=True)
created_at = models.DateTimeField(auto_now_add=True)
pat_pic_date = models.DateField()
serial_number = models.IntegerField()
def __str__(self) -> str:
return f"""ID: {self.doctor.id} - {self.doctor.name} - Pat Name: {self.name}"""
Can you consider to share the auto-increment fields system to get serial the number fields?