Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
roomlist
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
roomlist
Commits
48c53e83
Commit
48c53e83
authored
Feb 01, 2016
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrected variable names, fixed set interactions on major page
parent
44ce62e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
roomlist/accounts/views.py
roomlist/accounts/views.py
+10
-5
No files found.
roomlist/accounts/views.py
View file @
48c53e83
...
...
@@ -553,12 +553,17 @@ class DetailMajor(LoginRequiredMixin, DetailView):
for
room
in
rooms
])),
key
=
attrgetter
(
'user.username'
))
# see what students are left over (aren't visible)
hidden
=
Student
.
objects
.
filter
(
major
=
self
.
get_object
()).
order_by
(
'user__username'
)
for
visible
in
neighbourhoods
.
values
():
hidden
-=
set
(
visible
)
# print(visible_by_neighbourhood)
for
neighbourhood
,
visible
in
neighbourhoods
.
items
():
# see what students are left over (aren't visible)
hidden
=
set
(
Student
.
objects
.
filter
(
major
=
self
.
get_object
()).
order_by
(
'user__username'
))
# print(hidden)
for
visible
in
visible_by_neighbourhood
.
values
():
# print('visible', visible)
hidden
=
hidden
.
difference
(
set
(
visible
))
# print(hidden)
for
neighbourhood
,
visible
in
visible_by_neighbourhood
.
iteritems
():
context
[
'%s_location_visible'
%
neighbourhood
]
=
visible
context
[
'location_hidden'
]
=
hidden
...
...
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