[web2py] Re: Verbatim Tag
Hi Massimo I've spent some time thinking about my own suggestion and I now believe that changing the delimiter in either Web2py or Angular is actually a better idea than mine. I'm happy to either withdraw my proposal or submit if you think it should be discussed further. cheers Dave -- 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: Verbatim Tag
I am glad you agree but if there is consensus in implementing your original request, I do not have a problem with it. On Sunday, 16 March 2014 03:17:22 UTC-5, David Simmons wrote: Hi Massimo I've spent some time thinking about my own suggestion and I now believe that changing the delimiter in either Web2py or Angular is actually a better idea than mine. I'm happy to either withdraw my proposal or submit if you think it should be discussed further. cheers Dave -- 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: Verbatim Tag
Please open a ticket. We will discuss on web2py-developers. On Friday, 14 March 2014 14:17:44 UTC-5, David Simmons wrote: Hi Leonel I think you are correct in that it might make it a little more difficult to parse. My problem with having to change either of the delimiters for Angular or Web2py is that I have to remember to change them for everything. For example if I change the web2py delimiters I then have to replace the delimiters in the layout.html and any other views I might extend. If I change them in Angular then I have to change them for any third party code I might use. I think you are correct that it is each to their own and a matter of personal taste. My request is that, if the code is acceptable, it be added to Web2py so that I can use it for more projects if I wish. cheers Dave -- 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: Verbatim Tag
{{data.message + world!}} should be {{= data.message + world!}} On Thursday, 13 March 2014 17:21:28 UTC-5, David Simmons wrote: Hi All (again). I did some digging around with the web2py source code and came up with this. https://gist.github.com/shortly-portly/9538005 The usage is pretty straight forward. You can use normal Web2py tags {{ and }}. When you want to drop down into Angular, surround your stuff with {{ verbatim }} and {{ endverbatim }}. For example {{ extend 'layout.html }} - translated by web2py as normal {{ verbatim }} div ng-app= input type=text ng-model=data.message h1{{data.message + world!}}/h1--- not touched by web2py /div {{ endverbatim }} Could someone who knows more about the web2py source code let me know if this looks like a valid change. I'd love to be able to submit it. cheers Dave -- 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: Verbatim Tag
Hi Massmo, On Friday, March 14, 2014 2:46:58 PM UTC+1, Massimo Di Pierro wrote: {{data.message + world!}} should be {{= data.message + world!}} No... this part is fictional AngularJS code, just meant as an example. I think you're missing the point of this thread, and that is whether web2py should have a special variable to temporarily disable the parsing of {{ }} and leave that to another parser, such as AngularJS. This would enable both web2py and AngularJS to keep using the same delimiters. I believe Django has this functionality. What I don't know is the reasoning for their inclusion and possible caveats... @David Simmons, do you perhaps know if there was a discussion there and what were the arguments? Have they had any issues with the implementation? Regards On Thursday, 13 March 2014 17:21:28 UTC-5, David Simmons wrote: Hi All (again). I did some digging around with the web2py source code and came up with this. https://gist.github.com/shortly-portly/9538005 The usage is pretty straight forward. You can use normal Web2py tags {{ and }}. When you want to drop down into Angular, surround your stuff with {{ verbatim }} and {{ endverbatim }}. For example {{ extend 'layout.html }} - translated by web2py as normal {{ verbatim }} div ng-app= input type=text ng-model=data.message h1{{data.message + world!}}/h1--- not touched by web2py /div {{ endverbatim }} Could someone who knows more about the web2py source code let me know if this looks like a valid change. I'd love to be able to submit it. cheers Dave -- 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: Verbatim Tag
That's not how we do it. You either tell web2py to use different delimiters: response.delimiters = ('%', '%') or you tell angular to do so: var myApp = angular.module('myApp', [], function($interpolateProvider) { $interpolateProvider.startSymbol('[['); $interpolateProvider.endSymbol(']]');}); http://stackoverflow.com/questions/12923521/angular-js-custom-delimiter On Friday, 14 March 2014 11:32:19 UTC-5, LightDot wrote: Hi Massimo, On Friday, March 14, 2014 2:46:58 PM UTC+1, Massimo Di Pierro wrote: {{data.message + world!}} should be {{= data.message + world!}} No... this part is fictional AngularJS code, just meant as an example. I think you're missing the point of this thread, and that is whether web2py should have a special variable to temporarily disable the parsing of {{ }} and leave that to another parser, such as AngularJS. This would enable both web2py and AngularJS to keep using the same delimiters. I believe Django has this functionality. What I don't know is the reasoning for their inclusion and possible caveats... @David Simmons, do you perhaps know if there was a discussion there and what were the arguments? Have they had any issues with the implementation? Regards On Thursday, 13 March 2014 17:21:28 UTC-5, David Simmons wrote: Hi All (again). I did some digging around with the web2py source code and came up with this. https://gist.github.com/shortly-portly/9538005 The usage is pretty straight forward. You can use normal Web2py tags {{ and }}. When you want to drop down into Angular, surround your stuff with {{ verbatim }} and {{ endverbatim }}. For example {{ extend 'layout.html }} - translated by web2py as normal {{ verbatim }} div ng-app= input type=text ng-model=data.message h1{{data.message + world!}}/h1--- not touched by web2py /div {{ endverbatim }} Could someone who knows more about the web2py source code let me know if this looks like a valid change. I'd love to be able to submit it. cheers Dave -- 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: Verbatim Tag
LightDot The implementation I put together was only done last night and I have done limited testing. I did it as I feel Web2py and Angular make a fantastic combination and want to explore the two working together more. I'm really keen to understand from Massimo and other Web2py guru's if my idea is stupid or not. cheers Dave -- 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: Verbatim Tag
Hi Massimo I appreciate you can change either Web2py or Angular delimiters but the small code change I have suggested allows you to have the best of both worlds. If you change one of the delimiters it means you need to be careful with anything that might rely on it. Is there any reason why we my code change could not be included in Web2py to allow for this? many thanks Dave -- 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: Verbatim Tag
David, I don't like that idea as I think it makes the views harder to parse. I need to remember that I'm inside a verbatim block to know if I'm reading python or not. I don't like the extra mental strain so I prefer the changing the delimiters strategy as I have a reminder of what I'm reading in each line. Reading code is all about saving valuable brain real estate for me, I need room to remember the rest of the project and the current task. To each it's own I guess, it's not like I would be forced to use it. You can also use {{=XML(your_angular_code, sanitize=False)}} which would be pretty ugly of course. -- 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: Verbatim Tag
Hi Leonel I think you are correct in that it might make it a little more difficult to parse. My problem with having to change either of the delimiters for Angular or Web2py is that I have to remember to change them for everything. For example if I change the web2py delimiters I then have to replace the delimiters in the layout.html and any other views I might extend. If I change them in Angular then I have to change them for any third party code I might use. I think you are correct that it is each to their own and a matter of personal taste. My request is that, if the code is acceptable, it be added to Web2py so that I can use it for more projects if I wish. cheers Dave -- 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: Verbatim Tag
You can change web2py delimiters. For instance if you put this in your model: response.delimiters = ('?','?') You can use php style delimiters. -- 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: Verbatim Tag
Hi Leonel. I know you can change the web2py delimters but that means views that uses extends has to be modified. If you simply switch of the interpretation of {{ for a block of html then you could mix and match angularjs and web2py. cheers Dave -- 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: Verbatim Tag
Hi All (again). I did some digging around with the web2py source code and came up with this. https://gist.github.com/shortly-portly/9538005 The usage is pretty straight forward. You can use normal Web2py tags {{ and }}. When you want to drop down into Angular, surround your stuff with {{ verbatim }} and {{ endverbatim }}. For example {{ extend 'layout.html }} - translated by web2py as normal {{ verbatim }} div ng-app= input type=text ng-model=data.message h1{{data.message + world!}}/h1--- not touched by web2py /div {{ endverbatim }} Could someone who knows more about the web2py source code let me know if this looks like a valid change. I'd love to be able to submit it. cheers Dave -- 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.