@login_required
def edit_alias(request, project_slug, alias_id=None):
 proj = get_object_or_404(Project.objects.for_admin_user(request.user), slug=project_slug)
 if alias_id:
  alias = proj.aliases.get(pk=alias_id)
  form = AliasForm(instance=alias, data=(request.POST or None))
 else:
  form = AliasForm((request.POST or None))
 if ((request.method == 'POST') and form.is_valid()):
  alias = form.save()
  return HttpResponseRedirect(alias.project.get_absolute_url())
 return render_to_response('projects/alias_edit.html', {'form': form}, context_instance=RequestContext(request))

@ login_required def edit_alias ( request , project_slug , alias_id = None ) : proj = get_object_or_404 ( Project . objects . for_admin_user ( request . user ) , slug = project_slug ) if alias_id : alias = proj . aliases . get ( pk = alias_id ) form = AliasForm ( instance = alias , data = ( request . POST or None ) ) else : form = AliasForm ( ( request . POST or None ) ) if ( ( request . method == 'POST' ) and form . is_valid ( ) ) : alias = form . save ( ) return HttpResponseRedirect ( alias . project . get_absolute_url ( ) ) return render_to_response ( 'projects/alias_edit.html' , { 'form' : form } , context_instance = RequestContext ( request ) )
edit project alias form view .