Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jelle van der Waa
Archweb
Commits
bb9bd32a
Commit
bb9bd32a
authored
Aug 02, 2018
by
Jelle van der Waa
🚧
Browse files
todolists: Remove unused ModelManager
parent
5d6401ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
todolists/models.py
View file @
bb9bd32a
from
django.contrib.auth.models
import
User
from
django.contrib.sites.models
import
Site
from
django.db
import
models
from
django.db.models
import
Q
from
django.db.models.signals
import
pre_save
from
main.models
import
Arch
,
Repo
,
Package
from
main.utils
import
set_created_field
class
TodolistManager
(
models
.
Manager
):
def
incomplete
(
self
):
not_done
=
((
Q
(
todolistpackage__status
=
TodolistPackage
.
INCOMPLETE
)
|
Q
(
todolistpackage__status
=
TodolistPackage
.
IN_PROGRESS
))
&
Q
(
todolistpackage__removed__isnull
=
True
))
return
self
.
order_by
().
filter
(
not_done
).
distinct
()
class
Todolist
(
models
.
Model
):
slug
=
models
.
SlugField
(
max_length
=
255
,
unique
=
True
)
old_id
=
models
.
IntegerField
(
null
=
True
,
unique
=
True
)
...
...
@@ -27,8 +18,6 @@ class Todolist(models.Model):
last_modified
=
models
.
DateTimeField
(
editable
=
False
)
raw
=
models
.
TextField
(
blank
=
True
)
objects
=
TodolistManager
()
class
Meta
:
get_latest_by
=
'created'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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