Create Object in the Database

Report a typo

You have a model Task with fields description, is_done, priority:

class Task(models.Model):
    description = models.CharField(max_length=256)
    is_done = models.BooleanField()
    priority = models.IntegerField()

Create a new Task with description "walk to the grocery"(without quotes) and priority 5. The task is not done yet.

Save it to the database.

Write a program in Python 3





___

Create a free account to access the full topic