Commit bc9e16e0 authored by Gabriel G. Garrero's avatar Gabriel G. Garrero

Created forms.py and edited home.html to include links to add books and authors

parent 2de760fa
from django import forms
from .models import Books, Author
class BooksForm(forms.ModelForm):
class Meta:
model = Books
fields = "__all__"
class AuthorForm(forms.ModelForm):
class Meta:
model = Author
fields = "__all__"
\ No newline at end of file
......@@ -10,8 +10,13 @@
<p>I don't actually read books so I ended up just putting some of the most famous books and authors for my data.</p>
<div class = "links">
<a class = "flex-items" href='/bookshelf/books/'>Books</a>
<a class = "flex-items" href='/bookshelf/authors/'>Authors</a>
<a class = "flex-items" href = '/bookshelf/books/'>Books</a>
<a class = "flex-items" href = '/bookshelf/authors/'>Authors</a>
</div>
<div class = "add-links">
<a class = "flex-items" href = '/bookshelf/books/add'>Add Book</a>
<a class = "flex-items" href = '/bookshelf/authors/add'>Add Author</a>
</div>
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment