Skip to content

Commit

Permalink
Update data_preparation.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
InanisV authored Jun 8, 2020
1 parent d5cb220 commit 18a7caa
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions data_preparation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -387,28 +387,7 @@
}
],
"source": [
"gutenberg_db = PostgresqlDatabase('gutenberg', user='postgres', password='112358',\n",
" host='47.96.146.55', port=5432)\n",
"\n",
"class BaseModel(Model):\n",
" \"\"\"A base model that will use our Postgresql database\"\"\"\n",
" class Meta:\n",
" database = gutenberg_db\n",
"\n",
"class Book(BaseModel):\n",
" author = CharField()\n",
" title = TextField()\n",
" \n",
" class Meta:\n",
" database = gutenberg_db\n",
"\n",
"\n",
"gutenberg_db.connect()\n",
"Book.create_table()\n",
"book = Book(author=\"me\", title='Peewee is cool')\n",
"book.save()\n",
"for book in Book.filter(author=\"me\"):\n",
" print(book.title)"

]
},
{
Expand Down

0 comments on commit 18a7caa

Please sign in to comment.