RE: DJANGO MODELS
i have created an application called expense in django which has two fields in the models.py file which looks like class Transactions(models.Model):
income = models.IntegerField(null=False, blank=False)
expense = models.IntegerField(null=False, blank=False)
I want my application to allow users to enter their expense and income themselves and these fields must be provided, it should not be empty. But when i run the command python manage.py makemigrations i get the this: It is impossible to add a non-nullable field 'expense' to transactions without specifying a default. This is because the database needs something to populate existing rows.
Please select a fix:
1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
2) Quit and manually define a default value in models.py.
Select an option:
Please select a valid option:
Please select a valid option:
i have chosen option 2 but still got the same prompt. how do solve this.