forked from simeonf/pybay
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interlink speaker and schedule pages (#140)
- Loading branch information
Showing
4 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from django.template import Library | ||
from django.conf import settings | ||
|
||
from symposion.schedule.models import Presentation, Slot | ||
|
||
import logging | ||
|
||
|
||
register = Library() | ||
log = logging.getLogger(__name__) | ||
|
||
|
||
@register.simple_tag | ||
def slot_desc(talk): | ||
try: | ||
slot = talk.presentation.slot | ||
except (Presentation.DoesNotExist, Slot.DoesNotExist): | ||
log.error("Talk %s does not have a slot", talk.name) | ||
slot = None | ||
|
||
if slot is None: | ||
return None | ||
|
||
return "{} | {}-{} | {}".format( | ||
slot.day.date.strftime("%-m/%-d/%Y"), slot.start.strftime("%-I:%M %p"), | ||
slot.end.strftime("%-I:%M %p"), slot.rooms[0], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters