Discussion:
[bottlepy] Bottle template, Is there a way to early exit?
Larry Owens
2016-07-04 16:18:33 UTC
Permalink
Is there a way to early exit a bottle template?
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Larry Owens
2016-07-12 01:19:28 UTC
Permalink
Post by Larry Owens
Is there a way to early exit a bottle template?
Answering myself. The way to early exit is to use if else. For example, if
error in the template, include a return template on the error bypassing the
rest of the code which is executed in the else statement.
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Iuri
2016-07-12 10:04:18 UTC
Permalink
If you have a if/else to serve two different contents, you can use two
templates and do the if/else in your view.
Post by Larry Owens
Post by Larry Owens
Is there a way to early exit a bottle template?
Answering myself. The way to early exit is to use if else. For example,
if error in the template, include a return template on the error bypassing
the rest of the code which is executed in the else statement.
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.

---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...