Commit 2aa70d74 authored by Albert Gagalac's avatar Albert Gagalac

added forms.py + .html for new pages

parent 82c8e42c
from django import forms
from .models import Author
class AuthorForm(forms.Form):
first_name = forms.CharField(label="First Name", max_length=100)
last_name = forms.CharField(label="Last Name", max_length=100)
age = forms.IntegerField(label="Age",min_value=1)
nationality = forms.CharField(label="Nationality", max_length=100)
bio = forms.CharField(label="Bio", max_length = 700)
class BookForm(forms.Form):
title = forms.CharField(label="Title", max_length=100)
author = forms.ModelChoiceField(queryset=Author.objects.all())
publisher = forms.CharField(label="Publisher", max_length=100)
ISBN = forms.IntegerField(label="ISBN")
blurb = forms.CharField(label="Blurb", max_length = 700)
\ No newline at end of file
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
Sci-Fi and Mythology type novels. In more recent times,<br> Sci-Fi and Mythology type novels. In more recent times,<br>
I have come to love more manga that deal with <br> I have come to love more manga that deal with <br>
down-to-earth and realistic themes. <br> <br> down-to-earth and realistic themes. <br> <br>
tl;dr: I now weeb <br> <br> <br> tl;dr: I em now weeb <br> <br>
<a href="/books/ ">Books</a> | <a href="/authors/">Authors</a><br> <a href="/books/ ">Books</a> | <a href="/authors/">Authors</a><br>
<a href="/books/add/ ">Add Books</a> | <a href="/authors/add/">Add Authors</a><br>
<h4>dsg ftw</h4> <h4>dsg ftw</h4>
{% endblock %} {% endblock %}
...@@ -3,7 +3,25 @@ ...@@ -3,7 +3,25 @@
<head> <head>
<style> <style>
.itemDiv{ .content{
white-space: normal;
max-width: 500px;
overflow: hidden;
text-overflow: ellipsis;
margin: auto;
text-align: center;
font-family: 'Arial', sans-serif;
}
a:link{
color:teal;
}
a:visited{
color:darkslategrey;
}
a:hover{
color:slateblue;
}
.forms{
white-space: normal; white-space: normal;
max-width: 500px; max-width: 500px;
overflow: hidden; overflow: hidden;
...@@ -31,8 +49,11 @@ ...@@ -31,8 +49,11 @@
<h1 style= "font-family:'Comic Sans MS',cursive; <h1 style= "font-family:'Comic Sans MS',cursive;
text-align: center;">{% block heading %}{% endblock %} text-align: center;">{% block heading %}{% endblock %}
</h1> </h1>
<div class = "itemDiv"> <div class = "content">
<p>{% block content %}{% endblock %}</p> <p>{% block content %}{% endblock %}</p>
</div> </div>
<div class = "forms">
<p>{% block forms %}{% endblock %}</p>
</div>
</body> </body>
</html> </html>
\ 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