Skip to content

Missing import in Notes for Get It Done! Part 2: Database Configuration #18

@joelhealy

Description

@joelhealy

In the Notes section for Get It Done! Part 2: Database Configuration the following code appears:

> from main import db
> db.create_all()

I think it should be changed to

>>> from main import db, Task
>>> db.create_all()

as in the video, otherwise the user is going to receive a NameError: when she executes the subsequent code:

>>> new_task = Task('finish ORM lesson 2')
>>> db.session.add(new_task)
>>> another_task = Task('post lesson video')
>>> db.session.add(another_task)
>>> db.session.commit()

Note that in addition to adding the Task import, I would suggest that the single > prompt indicators be changed to >>> for consistency with the other interactive Python code sections.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions