(self, *args, **kwargs)
| 56 | title = models.CharField(max_length=50) |
| 57 | |
| 58 | def save(self, *args, **kwargs): |
| 59 | while not self.rand_pk: |
| 60 | test_pk = random.randint(1, 99999) |
| 61 | if not NonAutoPKBook.objects.filter(rand_pk=test_pk).exists(): |
| 62 | self.rand_pk = test_pk |
| 63 | super().save(*args, **kwargs) |
| 64 | |
| 65 | |
| 66 | class NonAutoPKBookChild(NonAutoPKBook): |