{{extend 'mylayout.html' if some_condition else None}}
{{include 'myview.html' if some_condition else None}}
{{if some_condition:}}
{{include 'myview.html'}}
{{pass}}
{{extend run_time_layout_selector()}}
{{extend 'layout.html' if not request.ajax else 'layout2.html'}}
Yes. this way conditional templates where never supported. They break compilation. I did not review Anthony's solution yet.
The compiler fails because request is not defined. In this case the whole application is not compiled at all.
I wondering if there is the possible to "catch" this compilation error and automatically wrap the entire code into a (lambda?) function (the run_time_layout_selector()) executed at runtime?
--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py-developers/GhvqakUaujA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py-develop...@googlegroups.com.
--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
<compile_with_failed_views.patch>
I have no objection on the technical side of this patch but is the purpose of compiling and skipping failing views if the app cannot be packed compiled? The only purpose of compilation is allow distribution in compiled form.
should this be documented?
Well done, I've just tested without any problem.
Attached is a patch that enables app compilation when some of the views are not compileable. It puts two compile options in the admin menu for each site: "Compile (skip failed views)" and "Compile (all or nothing)" (the latter yields the old behavior -- the entire app is not compiled if a single view fails to compile).If you choose the "skip failed views" option, the app will still compile, but the flash message will display a message listing the views that failed to compile and warn the user not to use the "Pack compiled" feature (that feature packs only the compiled files, so the non-compiled views won't be available in the packed app). For views that don't compile, the non-compiled view will be used (the order of precedence is compiled view > non-compiled view > compiled generic). Could use some testing.Anthony
On Tuesday, August 27, 2013 10:20:30 PM UTC-7, Anthony wrote:The compiler fails because request is not defined. In this case the whole application is not compiled at all.
I wondering if there is the possible to "catch" this compilation error and automatically wrap the entire code into a (lambda?) function (the run_time_layout_selector()) executed at runtime?Yes, maybe if a view fails to compile, rather than raising an exception and abandoning compilation of the entire app, it should just proceed without compiling that particular view (and possibly display a warning when compiling via admin).Anthony
--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-developers@googlegroups.com
unsubscribe: web2py-developers+unsubscribe@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py-developers/GhvqakUaujA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py-developers+unsubscribe@googlegroups.com.