-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ce7682
commit 6de00f3
Showing
4 changed files
with
39 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
from django.conf.urls import patterns, include, url | ||
|
||
# Uncomment the next two lines to enable the admin: | ||
from django.contrib import admin | ||
|
||
admin.autodiscover() | ||
|
||
urlpatterns = patterns('', | ||
# Examples: | ||
# url(r'^$', 'log_parser.views.home', name='home'), | ||
# url(r'^log_parser/', include('log_parser.foo.urls')), | ||
|
||
# Uncomment the admin/doc line below to enable admin documentation: | ||
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')), | ||
url(r'^view/', include('parse.urls')), | ||
|
||
# Uncomment the next line to enable the admin: | ||
url(r'^admin/', include(admin.site.urls)), | ||
) |
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,23 @@ | ||
<html> | ||
<head> | ||
<title>Sessions</title> | ||
</head> | ||
<body> | ||
<table> | ||
<tr> | ||
<th>UID</th> | ||
<th>Start Time</th> | ||
<th>End Time</th> | ||
<th>Active?</th> | ||
</tr> | ||
{% for session in sessions %} | ||
<tr> | ||
<td>{{ session.uid }}</td> | ||
<td>{{ session.start_time }}</td> | ||
<td>{{ session.end_time }}</td> | ||
<td>{{ session.active }}</td> | ||
</tr> | ||
{% endfor %} | ||
</table> | ||
</body> | ||
</html> |
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,4 @@ | ||
from django.conf.urls import patterns, url | ||
urlpatterns = patterns('parse.views', | ||
url(r'^sessions/$', 'show_sessions', name='show-sessions'), | ||
) |
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 |
---|---|---|
@@ -1 +1,10 @@ | ||
# Create your views here. | ||
from parse.models import RelaySession, RelayEntry | ||
from django.shortcuts import get_object_or_404, render | ||
|
||
|
||
def show_sessions(request): | ||
active = True if request.GET.get('active') else False | ||
sessions = RelaySession.objects.filter(active=active) | ||
return render(request, 'sessions/show.html', { | ||
'sessions': sessions | ||
}) |