diff options
author | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2008-08-16 15:46:09 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2008-08-16 15:46:09 +0530 |
commit | 87d1d3c62b8a934142a5943c25a83e998bc06f5e (patch) | |
tree | 1bb5ded34a217244977f719d1bd613af76da3e09 /master/autotua/views.py | |
parent | Initial autotua-master import. (diff) | |
download | autotua-87d1d3c62b8a934142a5943c25a83e998bc06f5e.tar.gz autotua-87d1d3c62b8a934142a5943c25a83e998bc06f5e.tar.bz2 autotua-87d1d3c62b8a934142a5943c25a83e998bc06f5e.zip |
- Add ~username/jobs/ page
- Random fixes to make things work
- Fix typos
- Change some indentation
- content.html -> userpage.html
Diffstat (limited to 'master/autotua/views.py')
-rw-r--r-- | master/autotua/views.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/master/autotua/views.py b/master/autotua/views.py index 5b86b16..b295a3d 100644 --- a/master/autotua/views.py +++ b/master/autotua/views.py @@ -7,13 +7,23 @@ # from django.http import HttpResponse -from django.shortcuts import get_object_or_404, render_to_response -from master.models import User +from django.shortcuts import * +from master.models import User, Job from django.conf import settings +import process def user_page(request, username): user = get_object_or_404(User, username=username) details = {'media_prefix': settings.MEDIA_PREFIX} for i in ('first_name', 'last_name', 'email',): details[i] = getattr(user, i) - return render_to_response('content.html', details) + return render_to_response('userpage.html', details) + +def jobs_page(request, username): + user = get_object_or_404(User, username=username) + jobs = get_list_or_404(Job, maintainer=user) + for job in jobs: + job.stage_url = process.generate_stage_url(job) + details = { 'media_prefix': settings.MEDIA_PREFIX, + 'jobs': jobs } + return render_to_response('jobs.html', details) |