blob: 73c52e23be06ad1e4e8074812880194331a773d4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
from django.urls import reverse
from django.apps import apps
from builder.base import BuildNew
from itertools import chain
from django.conf import settings
from .models import PostType
class BuildSrc(BuildNew):
def get_model_queryset(self):
return self.model.objects.filter(post_type=PostType.SRC).filter(status__exact=1).order_by('-pub_date')
def build(self):
self.build_list_view(
base_path=reverse("src:list"),
paginate_by=50
)
self.build_detail_view()
def src_builder():
j = BuildSrc("posts", "post")
j.build()
class BuildGuide(BuildNew):
def get_model_queryset(self):
return self.model.objects.filter(post_type__in=[PostType.FIELD_TEST, PostType.REVIEW]).filter(status__exact=1).order_by('-pub_date')
def build(self):
self.build_list_view(
base_path=reverse("guides:guide-base"),
paginate_by=50
)
self.build_detail_view()
def guide_builder():
j = BuildGuide("posts", "post")
j.build()
class BuildFieldNotes(BuildNew):
def get_model_queryset(self):
return self.model.objects.filter(post_type=PostType.FIELD_NOTE).filter(status__exact=1).order_by('-pub_date')
def build(self):
self.build_detail_view()
self.build_list_view(
base_path=reverse("fieldnotes:list"),
paginate_by=24
)
self.build_year_view("fieldnotes:list_year")
self.build_month_view("fieldnotes:list_month")
def fieldnotes_builder():
j = BuildFieldNotes("posts", "post")
j.build()
|