Skip to content

Commit

Permalink
Set ForeignKey on_delete (required in django 4)
Browse files Browse the repository at this point in the history
  • Loading branch information
RonShub committed Mar 26, 2023
1 parent f6a7b9a commit eac8b39
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions currencies/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ def save(self, **kwargs):


class DailyCurrencyExchangeRate(models.Model):

currency = models.ForeignKey(Currency, db_index=True)
currency = models.ForeignKey(Currency, db_index=True, on_delete=models.SET_NULL)
factor = models.DecimalField(_('factor'), max_digits=30, decimal_places=10, default=1.0,
help_text=_('Specifies the difference of the currency to default one.'))
date = models.DateField(db_index=True)
Expand Down

0 comments on commit eac8b39

Please sign in to comment.