Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
Coursework_64
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Volkov Gherman
Coursework_64
Commits
e15d7152
Commit
e15d7152
authored
Nov 04, 2021
by
Volkov Gherman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Дозаввершил проект курсовой работы News
parent
98151318
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
db.sqlite3
source/db.sqlite3
+0
-0
views.cpython-38.pyc
source/webapp/__pycache__/views.cpython-38.pyc
+0
-0
views.py
source/webapp/views.py
+3
-5
No files found.
source/db.sqlite3
View file @
e15d7152
No preview for this file type
source/webapp/__pycache__/views.cpython-38.pyc
View file @
e15d7152
No preview for this file type
source/webapp/views.py
View file @
e15d7152
...
...
@@ -17,9 +17,10 @@ class PostListView(ListView):
paginate_by
=
10
def
get_queryset
(
self
):
if
self
.
request
.
user
.
is_superuser
:
if
not
self
.
request
.
user
.
is_superuser
:
queryset
=
super
()
.
get_queryset
()
.
filter
(
is_active
=
True
)
return
queryset
else
:
return
super
()
.
get_queryset
()
...
...
@@ -125,9 +126,6 @@ class SearchView(ListView):
query
=
Q
(
title__icontains
=
self
.
search_value
)
|
Q
(
text__icontains
=
self
.
search_value
)
query_set
=
query_set
.
filter
(
query
)
return
query_set
else
:
return
query_set
def
get_search_form
(
self
):
return
SearchForm
(
self
.
request
.
GET
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment