RE: DJANGO MODELS
expense = models.IntegerField(null=False, blank=False)
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.
On Sat, Feb 3, 2024 at 9:00 PM Kevin Tuo <tuokevin1@gmail.com> wrote:
--Good idea, Thanks!Envoyé à partir de Outlook pour Android
From: django-users@googlegroups.com <django-users@googlegroups.com> on behalf of Obam Olohu <olohuobam@gmail.com>
Sent: Saturday, February 3, 2024 4:15:02 PM
To: django-users@googlegroups.com <django-users@googlegroups.com>
Subject: Re: Bookwhy don't you learn directly from a tutor?
--On Thu, Feb 1, 2024 at 3:14 AM Kevin Tuo <tuokevin1@gmail.com> wrote:
--Hello, Please can I get a book for building a portfolio website with django?
Envoyé à partir de Outlook pour Android
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/AS4PR09MB55764DA8881C3AB572B7468AFA7C2%40AS4PR09MB5576.eurprd09.prod.outlook.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMc8uwNeDWk8QRicjFHg_Ph6%3DrN7ARRgGxAQBzxVM7ASFupL9g%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/VI1PR07MB511726EE0F530FF06C424722FA412%40VI1PR07MB5117.eurprd07.prod.outlook.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAA_zVTGp-HouU4Fe4KVWyTuzGTN_C%2BOXPfiDGg6AKxHHuYMgcw%40mail.gmail.com.
No comments:
Post a Comment