Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
proto3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
protokollsystem
proto3
Commits
b2c65361
Commit
b2c65361
authored
8 years ago
by
Robin Sonnabend
Browse files
Options
Downloads
Patches
Plain Diff
Filter protocols by state
parent
2f5c086f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
server.py
+15
-2
15 additions, 2 deletions
server.py
views/forms.py
+3
-0
3 additions, 0 deletions
views/forms.py
with
18 additions
and
2 deletions
server.py
+
15
−
2
View file @
b2c65361
...
@@ -24,7 +24,7 @@ from shared import db, date_filter, datetime_filter, date_filter_long, date_filt
...
@@ -24,7 +24,7 @@ from shared import db, date_filter, datetime_filter, date_filter_long, date_filt
from
utils
import
is_past
,
mail_manager
,
url_manager
,
get_first_unused_int
,
set_etherpad_text
,
get_etherpad_text
,
split_terms
,
optional_int_arg
from
utils
import
is_past
,
mail_manager
,
url_manager
,
get_first_unused_int
,
set_etherpad_text
,
get_etherpad_text
,
split_terms
,
optional_int_arg
from
decorators
import
db_lookup
,
require_public_view_right
,
require_private_view_right
,
require_modify_right
,
require_admin_right
from
decorators
import
db_lookup
,
require_public_view_right
,
require_private_view_right
,
require_modify_right
,
require_admin_right
from
models.database
import
ProtocolType
,
Protocol
,
DefaultTOP
,
TOP
,
Document
,
Todo
,
Decision
,
MeetingReminder
,
Error
,
TodoMail
,
DecisionDocument
,
TodoState
,
Meta
,
DefaultMeta
,
DecisionCategory
from
models.database
import
ProtocolType
,
Protocol
,
DefaultTOP
,
TOP
,
Document
,
Todo
,
Decision
,
MeetingReminder
,
Error
,
TodoMail
,
DecisionDocument
,
TodoState
,
Meta
,
DefaultMeta
,
DecisionCategory
from
views.forms
import
LoginForm
,
ProtocolTypeForm
,
DefaultTopForm
,
MeetingReminderForm
,
NewProtocolForm
,
DocumentUploadForm
,
KnownProtocolSourceUploadForm
,
NewProtocolSourceUploadForm
,
ProtocolForm
,
TopForm
,
SearchForm
,
DecisionSearchForm
,
NewProtocolFileUploadForm
,
NewTodoForm
,
TodoForm
,
TodoMailForm
,
DefaultMetaForm
,
MetaForm
,
MergeTodosForm
,
DecisionCategoryForm
from
views.forms
import
LoginForm
,
ProtocolTypeForm
,
DefaultTopForm
,
MeetingReminderForm
,
NewProtocolForm
,
DocumentUploadForm
,
KnownProtocolSourceUploadForm
,
NewProtocolSourceUploadForm
,
ProtocolForm
,
TopForm
,
SearchForm
,
DecisionSearchForm
,
ProtocolSearchForm
,
NewProtocolFileUploadForm
,
NewTodoForm
,
TodoForm
,
TodoMailForm
,
DefaultMetaForm
,
MetaForm
,
MergeTodosForm
,
DecisionCategoryForm
from
views.tables
import
ProtocolsTable
,
ProtocolTypesTable
,
ProtocolTypeTable
,
DefaultTOPsTable
,
MeetingRemindersTable
,
ErrorsTable
,
TodosTable
,
DocumentsTable
,
DecisionsTable
,
TodoTable
,
ErrorTable
,
TodoMailsTable
,
DefaultMetasTable
,
DecisionCategoriesTable
from
views.tables
import
ProtocolsTable
,
ProtocolTypesTable
,
ProtocolTypeTable
,
DefaultTOPsTable
,
MeetingRemindersTable
,
ErrorsTable
,
TodosTable
,
DocumentsTable
,
DecisionsTable
,
TodoTable
,
ErrorTable
,
TodoMailsTable
,
DefaultMetasTable
,
DecisionCategoriesTable
from
legacy
import
import_old_todos
,
import_old_protocols
,
import_old_todomails
from
legacy
import
import_old_todos
,
import_old_protocols
,
import_old_todomails
...
@@ -351,12 +351,19 @@ def list_protocols():
...
@@ -351,12 +351,19 @@ def list_protocols():
protocoltype_id
=
int
(
request
.
args
.
get
(
"
protocoltype_id
"
))
protocoltype_id
=
int
(
request
.
args
.
get
(
"
protocoltype_id
"
))
except
(
ValueError
,
TypeError
):
except
(
ValueError
,
TypeError
):
pass
pass
open
=
-
1
try
:
open
=
int
(
request
.
args
.
get
(
"
open
"
))
except
(
ValueError
,
TypeError
):
pass
search_term
=
request
.
args
.
get
(
"
search
"
)
search_term
=
request
.
args
.
get
(
"
search
"
)
protocoltypes
=
ProtocolType
.
get_public_protocoltypes
(
user
)
protocoltypes
=
ProtocolType
.
get_public_protocoltypes
(
user
)
search_form
=
SearchForm
(
protocoltypes
)
search_form
=
Protocol
SearchForm
(
protocoltypes
)
if
protocoltype_id
is
not
None
:
if
protocoltype_id
is
not
None
:
search_form
.
protocoltype_id
.
data
=
protocoltype_id
search_form
.
protocoltype_id
.
data
=
protocoltype_id
protocoltype
=
ProtocolType
.
query
.
filter_by
(
id
=
protocoltype_id
).
first
()
protocoltype
=
ProtocolType
.
query
.
filter_by
(
id
=
protocoltype_id
).
first
()
if
open
is
not
None
:
search_form
.
open
.
data
=
open
if
search_term
is
not
None
:
if
search_term
is
not
None
:
search_form
.
search
.
data
=
search_term
search_form
.
search
.
data
=
search_term
protocol_query
=
Protocol
.
query
protocol_query
=
Protocol
.
query
...
@@ -391,6 +398,12 @@ def list_protocols():
...
@@ -391,6 +398,12 @@ def list_protocols():
protocol
for
protocol
in
protocols
protocol
for
protocol
in
protocols
if
protocol
.
protocoltype
.
id
==
protocoltype_id
if
protocol
.
protocoltype
.
id
==
protocoltype_id
]
]
if
open
is
not
None
and
open
!=
-
1
:
protocol_done
=
bool
(
open
)
protocols
=
[
protocol
for
protocol
in
protocols
if
protocol
.
is_done
()
==
protocol_done
]
if
shall_search
:
if
shall_search
:
protocols
=
[
protocols
=
[
protocol
for
protocol
in
protocols
protocol
for
protocol
in
protocols
...
...
This diff is collapsed.
Click to expand it.
views/forms.py
+
3
−
0
View file @
b2c65361
...
@@ -205,6 +205,9 @@ class DecisionSearchForm(SearchForm):
...
@@ -205,6 +205,9 @@ class DecisionSearchForm(SearchForm):
super
().
__init__
(
protocoltypes
=
protocoltypes
,
**
kwargs
)
super
().
__init__
(
protocoltypes
=
protocoltypes
,
**
kwargs
)
self
.
decisioncategory_id
.
choices
=
get_category_choices
(
categories
)
self
.
decisioncategory_id
.
choices
=
get_category_choices
(
categories
)
class
ProtocolSearchForm
(
SearchForm
):
open
=
SelectField
(
"
Offen
"
,
choices
=
[(
-
1
,
"
Alle
"
),
(
0
,
"
Geplant
"
),
(
1
,
"
Fertig
"
)],
coerce
=
int
)
class
NewTodoForm
(
FlaskForm
):
class
NewTodoForm
(
FlaskForm
):
protocoltype_id
=
SelectField
(
"
Typ
"
,
choices
=
[],
coerce
=
int
)
protocoltype_id
=
SelectField
(
"
Typ
"
,
choices
=
[],
coerce
=
int
)
who
=
StringField
(
"
Person
"
,
validators
=
[
InputRequired
(
"
Bitte gib an, wer das Todo erledigen soll.
"
)])
who
=
StringField
(
"
Person
"
,
validators
=
[
InputRequired
(
"
Bitte gib an, wer das Todo erledigen soll.
"
)])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment