リモートデータとローカルデータを区別したいので、ローカルデータの主キーを次のようにしたいと思います:local_1、local_2 ...など。
私のモデルは次のとおりです。
class coupon(models.Model):
success = models.IntegerField() # Count of the number of times people have made it work
failure = models.IntegerField() # Count of the number of times this has failed
couponDescription = models.TextField() # Coupon Description
active = models.BooleanField(default=True)
couponCode = models.CharField(max_length=30)
couponStore = models.CharField(max_length=30) # Store Name
featured = models.BooleanField(default=False)
couponTitle = models.CharField(max_length=100) # Coupon Title
updatedAt = models.DateTimeField(auto_now=True)
createdAt = models.DateTimeField(auto_now=True)
lastTested = models.DateField(auto_now_add=True) # When was the coupon last tested
localCouponId = models.CharField(max_length=30,primary_key=True)
では、 1、2、3、4などの整数と連結されlocalCouponId
た文字列で自動インクリメントを行うにはどうすればよいですか。local_