Commit 0129c98c authored by luxcem's avatar luxcem

adds article list view

parent dd7a373f
......@@ -22,3 +22,6 @@ class Article(UnDVotedMixin):
class Meta:
verbose_name = _("Article")
verbose_name_plural = _("Articles")
def __str__(self):
return self.title
{% extends "base.html" %}
{% block content %}
{% for article in object_list %}
{% endfor %}
{% endblock %}
from django.conf.urls import url
from rp.views import upvote, downvote
from rp.views.votes import upvote, downvote
from rp.views.articles import ArticleList
urlpatterns = [
url(
r"^article/list",
ArticleList.as_view(),
name="article-list"
),
url(
r"^votes/upvote/(?P<content_type>\d+)/(?P<object_id>\d+)$",
upvote,
......
from .votes import upvote, downvote, UDList # noqa
from rp.models import Article
from .votes import UDList
class ArticleList(UDList):
model = Article
......@@ -38,7 +38,7 @@ ROOT_URLCONF = "project.urls"
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"DIRS": ["templates"],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
......
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>LQDN RP</title>
</head>
<body>
{% block content %}
{% endblock %}
</body>
</html>
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