pad.ma urls
This commit is contained in:
parent
4650cf9c13
commit
1249c72d12
3 changed files with 16 additions and 5 deletions
|
|
@ -1,12 +1,21 @@
|
|||
# Create your views here.
|
||||
from django.shortcuts import get_object_or_404, redirect
|
||||
|
||||
import models
|
||||
|
||||
def padma_video(request, hid, view=''):
|
||||
def padma_video(request, url):
|
||||
url = url.split('/')
|
||||
hid = url[0]
|
||||
if len(url) > 1:
|
||||
view = url[1]
|
||||
else:
|
||||
view = None
|
||||
alias = get_object_or_404(models.IDAlias, old=hid)
|
||||
url = '/%s' % alias.new
|
||||
if view:
|
||||
url += '/' + {
|
||||
'editor': 'timeline',
|
||||
}.get(view, view)
|
||||
#FIXME: reqire layer urls, reqrite timerange urls
|
||||
raise redirect(url)
|
||||
return redirect(url)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue