def canonical(request, uploaded_at, file_id):
 filer_file = get_object_or_404(File, pk=file_id, is_public=True)
 if ((not filer_file.file) or (int(uploaded_at) != filer_file.canonical_time)):
  raise Http404((u'No %s matches the given query.' % File._meta.object_name))
 return redirect(filer_file.url)

def canonical ( request , uploaded_at , file_id ) : filer_file = get_object_or_404 ( File , pk = file_id , is_public = True ) if ( ( not filer_file . file ) or ( int ( uploaded_at ) != filer_file . canonical_time ) ) : raise Http404 ( ( u'No %s matches the given query.' % File . _meta . object_name ) ) return redirect ( filer_file . url )
redirect to the current url of a public file .