added content for edit-book.html and edit-author.html, lab done

parent 069d993a
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<ul><ul>{{object.age}}</ul></ul> <ul><ul>{{object.age}}</ul></ul>
<ul><ul>{{object.nationality}}</ul></ul> <ul><ul>{{object.nationality}}</ul></ul>
<ul><ul>{{object.bio}}</ul></ul> <ul><ul>{{object.bio}}</ul></ul>
<ul><button onclick="document.location='{{object.get_edit_url}}'">Edit Book</button></ul> <ul><button onclick="document.location='{{object.get_edit_url}}'">Edit Author</button></ul>
{%endblock%} {%endblock%}
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<ul>{{object.year_published}}</ul> <ul>{{object.year_published}}</ul>
<ul>{{object.ISBN}}</ul> <ul>{{object.ISBN}}</ul>
<ul>{{object.blurb}}</ul> <ul>{{object.blurb}}</ul>
<ul><button onclick="document.location='{{object.get_edit_url}}'">Edit Author</button></ul> <ul><button onclick="document.location='{{object.get_edit_url}}'">Edit Book</button></ul>
{% endblock %} {% endblock %}
{%block hyperlinks%} {%block hyperlinks%}
......
{% extends 'base.html' %}
{% block title %}Edit Author{% endblock %}
{% block heading %}
{% endblock %}
{% block text %}
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Save">
</form>
{% endblock %}
{%block hyperlinks%}
<ul>
{% for object in object_list %}
<li><a href="{{object.get_absolute_url}}">{{object.title}}</a></li>
{% endfor %}
<br></br>
<a href="/home">Home</a>
<a href="/authors">Authors</a>
</ul>
{%endblock%}
\ No newline at end of file
{% extends 'base.html' %}
{% block title %}Edit Book{% endblock %}
{% block heading %}
{% endblock %}
{% block text %}
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Save">
</form>
{% endblock %}
{%block hyperlinks%}
<ul>
{% for object in object_list %}
<li><a href="{{object.get_absolute_url}}">{{object.title}}</a></li>
{% endfor %}
<br></br>
<a href="/home">Home</a>
<a href="/authors">Authors</a>
</ul>
{%endblock%}
\ No newline at end of file
...@@ -50,7 +50,7 @@ class EditBookView(UpdateView): ...@@ -50,7 +50,7 @@ class EditBookView(UpdateView):
fields = '__all__' fields = '__all__'
template_name = 'bookshelf/edit-book.html' template_name = 'bookshelf/edit-book.html'
class EditAuthorView(CreateView): class EditAuthorView(UpdateView):
model = Author model = Author
fields = '__all__' fields = '__all__'
template_name = 'bookshelf/edit-author.html' template_name = 'bookshelf/edit-author.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