I'm writing a django website with a sqlite database, I have a model in my website like this :
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question_text
def was_published_recently(self):
return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
Suppose I create Question object "What's up" and delete it and now create another Question object "HI" then "Hi" will get the id 2 not 1.But I want it to be 1 only.Is this possible? I m using django 1.8.7 and can't change the version as whole database is written in django 1.8.7.
>> f = Question(question_text="What's up",pub_date=timezone.now())
>> f.id
1
>> f.delete()
>> g = Question(question_text="Hi",pub_date=timezone.now())
>> g.id
2
Any help will be appreciated.Thanks in advance