How to set the default value of date field to Null ones a table entry is created and update it when a book is returned?
<p>How can I set the <code>date_in</code> field to <code>null</code> at the time of entry and update the value to the date book is returned. </p>

<pre><code>class Book_Loans(models.Model):
    Loan_id = models.AutoField(primary_key=True)
    Isbn = models.ForeignKey('Books')
    Card_id = models.ForeignKey('Borrower')
    Date_out = models.DateField(auto_now_add = True, auto_now = False)
    Due_date = models.DateField(default = get_deadline())
    Date_in = models.DateField(null = True,auto_now_add = False, auto_now = True)
    def __unicode__(self):
        return str(self.Loan_id)
</code></pre>

<p>Set <code>auto_now = False</code> and the field will remain empty when creating or updating an instance that doesn't specify a value for Date_in.  You may also want to set <code>blank = True</code> if you need Date_in as an optional field on a form.  </p>

python django