Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
bookshare
Commits
e84aa90e
Commit
e84aa90e
authored
Apr 04, 2015
by
Daniel W Bond
Browse files
lookouts reflect new booleans
parent
27980cb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
bookshare/lookouts/models.py
View file @
e84aa90e
...
...
@@ -16,7 +16,8 @@ class Lookout(TimeStampedModel):
#course = models.ForeignKey(Course)
slug
=
RandomSlugField
(
length
=
6
)
def
get_listings
(
self
):
isbn_listings
=
models
.
Q
(
isbn
=
self
.
isbn
,
active
=
True
)
# may be reason to resurrect active as an actual field, possibly can call function?
isbn_listings
=
models
.
Q
(
isbn
=
self
.
isbn
,
sold
=
False
,
cancelled
=
False
)
return
Listing
.
objects
.
filter
(
isbn_listings
)
# needs get_absolute_url
...
...
bookshare/templates/index.html
View file @
e84aa90e
...
...
@@ -28,9 +28,11 @@ SRCT Bookshare • Homepage
<legend><i
class=
"fa fa-book"
></i>
<a
href=
"{{ lookout.get_absolute_url }}"
>
{{ lookout.isbn|isbn_name }}
</a></legend>
<div
class=
"row"
>
{% for listing in lookout.get_listings %}
{% if not listing.cancelled or listing.sold %}
<div
class=
"col-md-6"
>
{% include 'listing_preview_panel.html' %}
</div>
{% endif %}
{% endfor %}
</div>
{% endfor %}
...
...
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