Re: [web2py] Re: auth.wiki how to format all fields
db.auth_wiki(slug=slug).title ? On Sunday, 27 January 2013 11:46:47 UTC-6, Paolo valleri wrote: The problem is that with the current approach i set the title field but i have not found yer the possibility to render it :-( Looking to the code a very dirty but working workaround is to unset the current.request.extension. get the wiki and set extension as before. In this way i get all fields see gluon/tools.py:5090-5107. I think that we just need to change a little bit the current read. Paolo Il giorno 27/gen/2013 18:30, Massimo Di Pierro massimo@gmail.comjavascript: ha scritto: I agree that is what it does and that is what is suposed to do. Paolo tells us it should work differently. I think that would be best done with a different API. Massimo def wiki(): return auth.wiki() # no render argument The output is: {'content': gluon.html.XML object at 0xa79902c} I guess this is the normal behavior for all .wiki calls (just the content). -- -- --- 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/groups/opt_out.
Re: [web2py] Re: auth.wiki how to format all fields
Hi Massimo, I would avoid to write explicit code, please find attached a potential patch. what about that? Paolo 2013/1/30 Massimo Di Pierro massimo.dipie...@gmail.com db.auth_wiki(slug=slug).title ? On Sunday, 27 January 2013 11:46:47 UTC-6, Paolo valleri wrote: The problem is that with the current approach i set the title field but i have not found yer the possibility to render it :-( Looking to the code a very dirty but working workaround is to unset the current.request.extension. get the wiki and set extension as before. In this way i get all fields see gluon/tools.py:5090-5107. I think that we just need to change a little bit the current read. Paolo Il giorno 27/gen/2013 18:30, Massimo Di Pierro massimo@gmail.com ha scritto: I agree that is what it does and that is what is suposed to do. Paolo tells us it should work differently. I think that would be best done with a different API. Massimo def wiki(): return auth.wiki() # no render argument The output is: {'content': gluon.html.XML object at 0xa79902c} I guess this is the normal behavior for all .wiki calls (just the content). -- -- --- 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/groups/opt_out. -- --- 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/groups/opt_out. tools.py.patch Description: Binary data
Re: [web2py] Re: auth.wiki how to format all fields
I have applied the patch. I am uneasy with the fact that only one field is wrapped around XML and the others are not. Perhaps none of them should. This will break wiki but not a big deal since it experimental. Users can then put the XML(content) in the views. What do you think? On Wednesday, January 30, 2013 10:08:12 AM UTC-6, Paolo valleri wrote: Hi Massimo, I would avoid to write explicit code, please find attached a potential patch. what about that? Paolo 2013/1/30 Massimo Di Pierro massimo@gmail.com javascript: db.auth_wiki(slug=slug).title ? On Sunday, 27 January 2013 11:46:47 UTC-6, Paolo valleri wrote: The problem is that with the current approach i set the title field but i have not found yer the possibility to render it :-( Looking to the code a very dirty but working workaround is to unset the current.request.extension. get the wiki and set extension as before. In this way i get all fields see gluon/tools.py:5090-5107. I think that we just need to change a little bit the current read. Paolo Il giorno 27/gen/2013 18:30, Massimo Di Pierro massimo@gmail.com ha scritto: I agree that is what it does and that is what is suposed to do. Paolo tells us it should work differently. I think that would be best done with a different API. Massimo def wiki(): return auth.wiki() # no render argument The output is: {'content': gluon.html.XML object at 0xa79902c} I guess this is the normal behavior for all .wiki calls (just the content). -- -- --- 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+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- --- 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/groups/opt_out.
Re: [web2py] Re: auth.wiki how to format all fields
I have applied the patch. I am uneasy with the fact that only one field is wrapped around XML and the others are not. Agree. I would make any change necessary to have a more clean api while it is an experimental feature. -- --- 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/groups/opt_out.
Re: [web2py] Re: auth.wiki how to format all fields
I agree too in breaking the backward compatibility as soon as is marked experimental, however I don't see any other field that can be wrapped around XML. Paolo 2013/1/30 Alan Etkin spame...@gmail.com I have applied the patch. I am uneasy with the fact that only one field is wrapped around XML and the others are not. Agree. I would make any change necessary to have a more clean api while it is an experimental feature. -- --- 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/groups/opt_out. -- --- 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/groups/opt_out.
Re: [web2py] Re: auth.wiki how to format all fields
I am suggesting the opposite. Not wrapping any field in XML. On Wednesday, January 30, 2013 1:50:40 PM UTC-6, Paolo valleri wrote: I agree too in breaking the backward compatibility as soon as is marked experimental, however I don't see any other field that can be wrapped around XML. Paolo 2013/1/30 Alan Etkin spam...@gmail.com javascript: I have applied the patch. I am uneasy with the fact that only one field is wrapped around XML and the others are not. Agree. I would make any change necessary to have a more clean api while it is an experimental feature. -- --- 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+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- --- 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/groups/opt_out.
Re: [web2py] Re: auth.wiki how to format all fields
for me is ok too. Paolo 2013/1/30 Massimo Di Pierro massimo.dipie...@gmail.com I am suggesting the opposite. Not wrapping any field in XML. On Wednesday, January 30, 2013 1:50:40 PM UTC-6, Paolo valleri wrote: I agree too in breaking the backward compatibility as soon as is marked experimental, however I don't see any other field that can be wrapped around XML. Paolo 2013/1/30 Alan Etkin spam...@gmail.com I have applied the patch. I am uneasy with the fact that only one field is wrapped around XML and the others are not. Agree. I would make any change necessary to have a more clean api while it is an experimental feature. -- --- 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+un...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- --- 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/groups/opt_out. -- --- 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/groups/opt_out.
[web2py] Re: auth.wiki how to format all fields
to keep track of that, I have opened an issue http://code.google.com/p/web2py/issues/detail?id=1303 On Friday, January 25, 2013 3:32:55 PM UTC+1, Paolo valleri wrote: Dear all, I've just came across the fact that with the following code: def wiki(): return auth.wiki(render='html') and visiting something like app/controller/wiki/about in the view I will get only the 'content' field without any other useful wiki's field such as Title, modified_on just to name a few. Checking the code, I figured out that the problem is due to the test: extension==html (see tools.py:5090) Could we return the other fields too? Paolo --
[web2py] Re: auth.wiki how to format all fields
I do not fully understand the issue. Can you post more code as an example? On Friday, 25 January 2013 08:32:55 UTC-6, Paolo valleri wrote: Dear all, I've just came across the fact that with the following code: def wiki(): return auth.wiki(render='html') and visiting something like app/controller/wiki/about in the view I will get only the 'content' field without any other useful wiki's field such as Title, modified_on just to name a few. Checking the code, I figured out that the problem is due to the test: extension==html (see tools.py:5090) Could we return the other fields too? Paolo --
[web2py] Re: auth.wiki how to format all fields
Hi Massimo, the point is that, if I define the following code in a controller: def wiki(): return auth.wiki(render='html') In the corresponding view I will have only the 'content' field. As a result I will be able to format the wiki page by its content only no other fields can be retrieved; in order to 'format' better the wiki page, it would be nice to have at least information such as the fields title and modified_on. paolo On Sunday, January 27, 2013 4:56:51 PM UTC+1, Massimo Di Pierro wrote: I do not fully understand the issue. Can you post more code as an example? On Friday, 25 January 2013 08:32:55 UTC-6, Paolo valleri wrote: Dear all, I've just came across the fact that with the following code: def wiki(): return auth.wiki(render='html') and visiting something like app/controller/wiki/about in the view I will get only the 'content' field without any other useful wiki's field such as Title, modified_on just to name a few. Checking the code, I figured out that the problem is due to the test: extension==html (see tools.py:5090) Could we return the other fields too? Paolo --
[web2py] Re: auth.wiki how to format all fields
Hi Massimo, the point is that, if I define the following code in a controller: I just tested an old welcome app with: def wiki(): return auth.wiki() # no render argument The output is: {'content': gluon.html.XML object at 0xa79902c} I guess this is the normal behavior for all .wiki calls (just the content). --
[web2py] Re: auth.wiki how to format all fields
I agree that is what it does and that is what is suposed to do. Paolo tells us it should work differently. I think that would be best done with a different API. Massimo def wiki(): return auth.wiki() # no render argument The output is: {'content': gluon.html.XML object at 0xa79902c} I guess this is the normal behavior for all .wiki calls (just the content). --
Re: [web2py] Re: auth.wiki how to format all fields
The problem is that with the current approach i set the title field but i have not found yer the possibility to render it :-( Looking to the code a very dirty but working workaround is to unset the current.request.extension. get the wiki and set extension as before. In this way i get all fields see gluon/tools.py:5090-5107. I think that we just need to change a little bit the current read. Paolo Il giorno 27/gen/2013 18:30, Massimo Di Pierro massimo.dipie...@gmail.com ha scritto: I agree that is what it does and that is what is suposed to do. Paolo tells us it should work differently. I think that would be best done with a different API. Massimo def wiki(): return auth.wiki() # no render argument The output is: {'content': gluon.html.XML object at 0xa79902c} I guess this is the normal behavior for all .wiki calls (just the content). -- --
[web2py] Re: auth.wiki how to format all fields
Dear all, I've just came across the fact that with the following code: A workaround: (in the model) auth.wiki(resolve=False) page = db(db.wiki_page.slug==request.function).select().first() (in the view) {{=page.title}} --