[web2py] Re: how to use gluon Expose

2014-06-26 Thread Jim Karsten
I was experimenting with Expose this week and I came across similar 
problems. For example, if I click on a subfolder link, the page refreshes 
but still displays the contents of the base folder.

After some digging, I think I found the problem. The code in Expose uses 
request.raw_args to determine the subfolder or link clicked. If routers is 
set in routes.py, request.raw_args is never set, so the args is always an 
empty list. If Expose used request.args, it would work.

I created a bug report here: 
http://code.google.com/p/web2py/issues/detail?id=1947


On Monday, April 21, 2014 10:14:57 AM UTC-4, Louis Amon wrote:

 It gets me the same result : broken links  images

 On Monday, April 21, 2014 3:28:00 PM UTC+2, Massimo Di Pierro wrote:

 Can you try:

 Expose(os.path.join(request.folder,'static','presse'))

 On Monday, 21 April 2014 06:01:42 UTC-5, Louis Amon wrote:

 Hi,

 I'm trying to expose a folder in my application, so I tried to use the 
 Expose function as described here 
 http://web2py.com/books/default/chapter/29/14/other-recipes#Publishing-a-folder

 My controller looks like :

 from gluon.tools import Expose
 def presse():
 files=Expose(request.folder+'static/presse')
 return dict(files=files)


 When I reach the correct URL, I see links for every file in that folder, 
 but they point to nothing.

 Same goes for image previews : they are broken.


 I checked one of the broken previews, and it points to : 
 /presse/logo.png, when it should point to /static/presse/logo.png.


 What did I do wrong ?



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to use gluon Expose

2014-04-21 Thread Massimo Di Pierro
Can you try:

Expose(os.path.join(request.folder,'static','presse'))

On Monday, 21 April 2014 06:01:42 UTC-5, Louis Amon wrote:

 Hi,

 I'm trying to expose a folder in my application, so I tried to use the 
 Expose function as described 
 herehttp://web2py.com/books/default/chapter/29/14/other-recipes#Publishing-a-folder

 My controller looks like :

 from gluon.tools import Expose
 def presse():
 files=Expose(request.folder+'static/presse')
 return dict(files=files)


 When I reach the correct URL, I see links for every file in that folder, 
 but they point to nothing.

 Same goes for image previews : they are broken.


 I checked one of the broken previews, and it points to : 
 /presse/logo.png, when it should point to /static/presse/logo.png.


 What did I do wrong ?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: how to use gluon Expose

2014-04-21 Thread Louis Amon
It gets me the same result : broken links  images

On Monday, April 21, 2014 3:28:00 PM UTC+2, Massimo Di Pierro wrote:

 Can you try:

 Expose(os.path.join(request.folder,'static','presse'))

 On Monday, 21 April 2014 06:01:42 UTC-5, Louis Amon wrote:

 Hi,

 I'm trying to expose a folder in my application, so I tried to use the 
 Expose function as described 
 herehttp://web2py.com/books/default/chapter/29/14/other-recipes#Publishing-a-folder

 My controller looks like :

 from gluon.tools import Expose
 def presse():
 files=Expose(request.folder+'static/presse')
 return dict(files=files)


 When I reach the correct URL, I see links for every file in that folder, 
 but they point to nothing.

 Same goes for image previews : they are broken.


 I checked one of the broken previews, and it points to : 
 /presse/logo.png, when it should point to /static/presse/logo.png.


 What did I do wrong ?



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.