Closed alanjameschapman closed 8 months ago
Add PostList class to edblog/views:
class PostList(generic.ListView):
queryset = Post.objects.all()
template_name = "post_list.html"
Add basic template to edblog/templates/edblog/post_list.html (this will be developed further):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Views Part 1</title>
</head>
<body>
<h1>Posts list</h1>
{% for post in object_list %}
<h2>{{post.title}}</h2>
<p>{{post.excerpt}}</p>
<p>Author: {{post.author}}</p>
{% endfor %}
</body>
</html>
Add posts.json to edblog/fixtures to quickly check how a large dataset will be displayed.
Admin | Deployed |
---|---|
Add base and index.html templates with snippets, paginate, add boilerplate css.
Local | Deployed |
---|---|
Install Cloudinary and connect API.
Update Post model and index.html with DTL.
Result
Students can now see relevant posts, depending on their enrolment. Teachers can see only posts which they authored.
Enrolment | |
---|---|
Posts | |
Teacher 1 | |
Teacher 2 | |
Student 1 | |
Student 2 |
As a user I can view all posts summarized so that I can browse topics.
Acceptance Criteria
Tasks