Application is using hybrid of traversal and URL dispatch.
Here is the code:
https://github.com/SystematicD/pyramid_wikiz/blob/master/__init__.py#L33

currently application working fine, but using session to save and passing 
around 
the coming_from_url or next_url is problematic in browsing application in 
multi tabs.
here is the code that needs to be changed.
https://github.com/SystematicD/pyramid_wikiz/blob/master/templates/top_nav_bar.jinja2#L34

With appending the @@create to the end of full url, then traversed url 
always 
stay the same after clicking on create button and no need to save the url 
in session.

Checking document for generating hybrid:
https://docs.pylonsproject.org/projects/pyramid/en/latest/narr/hybrid.html#generating-hybrid-urls

it is not clear how to generate the current application full url.


Thanks


On Wednesday, 22 April 2020 06:39:46 UTC-5, Steve Piercy wrote:
>
> Are you using traversal or URL dispatch? 
>
> It seems that you don't want to pass in a `resource` as the 
> first argument to `resource_url`, so perhaps you want to use 
>
> https://docs.pylonsproject.org/projects/pyramid/en/latest/api/request.html#pyramid.request.Request.route_url
>  
> ? 
>
> --steve 
>
>
> On 4/22/20 at 2:18 AM, [email protected] <javascript:> (Sydo Luciani) 
> pronounced: 
>
> >root + path be the resource but passing request.url as resource 
> >throws error: 
> >href="{{ request.resource_url(request.url , '@@create') }}"> 
> > 
> >path = [loc.__name__ or '' for loc in lineage(resource)] 
> >AttributeError: 'str' object has no attribute '__name__' 
> > 
> > 
> >On Wednesday, 22 April 2020 04:11:00 UTC-5, Sydo Luciani wrote: 
> >> 
> >>tried href="{{ request.resource_url(request.url , '@@create') }}"> 
> >>but didn't work and got below error: 
> >>path = [loc.__name__ or '' for loc in lineage(resource)] 
> >>AttributeError: 'str' object has no attribute '__name__' 
> >> 
> >>Then tried href="{{ request.resource_url(request.root, 
> >>request.path , '@@create') }}"> 
> >>that I got double slash problem. 
> >> 
> >>Need to generate full URL and then append @@create. 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >>root, request.path , '@@create') }}"> 
> >>On Wednesday, 22 April 2020 02:42:44 UTC-5, Sydo Luciani wrote: 
> >>> 
> >>> This code: 
> >>>  href="{{ request.resource_url(request.root, request.path , 
> >>>'@@create')  }}"> 
> >>> 
> >>> Generates below URL: 
> >>>  https://domain_name.com:6543/%2FDir_1%2FDir_2/@@create  <
> https://systematicd.com:6543/%2Fwiki%2FDir_2/@@create> 
> >>> 
> >>>  After domain_name:port, there is a '/' and a '%2F' which 
> >>>represents  another '/'. 
> >>>  double slashes after domain name, causing problem in 
> >>>finding the right  view  and the result is "page not found". 
> >>> 
> >>> Is there a workaround this problem ? 
> >>> 
> >>> Thanks 
> >>> 
> >>> 
> >>> 
> > 
>
> ------------------------ 
> Steve Piercy, Eugene, OR 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/8903cc1f-51ec-40f7-ae4c-7c1b0c8086c9%40googlegroups.com.

Reply via email to