Discussion:
problem importing validate
squarrel
2013-07-25 12:10:44 UTC
Permalink
Hi yall,

I'm trying to work with what seems to me as the most compact and painless
web framework I have stumbled on so far and I enjoy it.

Now here's my error:
I do: from bottle import route, run, template, error, static_file, get,
request, validate
I get: ImportError: cannot import name validate

I have no idea why is this so. I am using Bottle 0.12-dev. (Now I see this
is a development version)

squarrel
--
--
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/groups/opt_out.
squarrel
2013-07-25 13:57:07 UTC
Permalink
Apparently, I don't have that problem with stable version 0.11.6.
--
--
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/groups/opt_out.
Iuri
2013-07-25 14:10:01 UTC
Permalink
The validate decorator was removed.
https://github.com/defnull/bottle/commit/3982dc28f957482ced7165e78ed5727523b91899

It was deprecated since v0.10. Docs are outdated. :/
Post by squarrel
Apparently, I don't have that problem with stable version 0.11.6.
--
--
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/groups/opt_out.
--
--
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/groups/opt_out.
Iuri
2013-07-25 14:13:11 UTC
Permalink
It was removed because it is no longer needed. You can use route filters.
Post by Iuri
The validate decorator was removed.
https://github.com/defnull/bottle/commit/3982dc28f957482ced7165e78ed5727523b91899
It was deprecated since v0.10. Docs are outdated. :/
Post by squarrel
Apparently, I don't have that problem with stable version 0.11.6.
--
--
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/groups/opt_out.
--
--
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/groups/opt_out.
squarrel
2013-07-25 15:22:06 UTC
Permalink
thanks luri for explaining,

I cannot seem to get the hang of it though. I am trying the ToDo list
example, where I have @route('/edit/:no'), so I figured
@route('/edit/<no:int>'), right? It stops working, though, when I do that.
--
--
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/groups/opt_out.
Iuri
2013-07-25 17:54:52 UTC
Permalink
Can you show me the error message? It should work...

I will update this tutorial to remove deprecated features.
Post by squarrel
thanks luri for explaining,
I cannot seem to get the hang of it though. I am trying the ToDo list
@route('/edit/<no:int>'), right? It stops working, though, when I do that.
--
--
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/groups/opt_out.
--
--
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/groups/opt_out.
Iuri
2013-07-25 19:04:23 UTC
Permalink
You have to pass strings to c.execute, so you have to convert `no` to
string: str(no)
Post by Iuri
Can you show me the error message? It should work...
I will update this tutorial to remove deprecated features.
Post by squarrel
thanks luri for explaining,
I cannot seem to get the hang of it though. I am trying the ToDo list
@route('/edit/<no:int>'), right? It stops working, though, when I do that.
--
--
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/groups/opt_out.
--
--
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/groups/opt_out.
squarrel
2013-07-25 21:55:12 UTC
Permalink
Sorry Iuri,
my mistake. Everything is working fine, entering a non-integer returns
'page not found', which is ok.
--
--
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/groups/opt_out.
Ryan Bregier
2015-03-08 21:41:01 UTC
Permalink
Hey guys,

So (using the Bottle ToDo example) is this now the correct way to do
validation?

@route('/edit/:no', method='GET', *'/<no:int>'*)
def edit_item(no):

or is it

@route('/edit/:<no:int>', method='GET', *'/<no:int>'*)
def edit_item(no):

Thanks!
Post by squarrel
Hi yall,
I'm trying to work with what seems to me as the most compact and painless
web framework I have stumbled on so far and I enjoy it.
I do: from bottle import route, run, template, error, static_file, get,
request, validate
I get: ImportError: cannot import name validate
I have no idea why is this so. I am using Bottle 0.12-dev. (Now I see this
is a development version)
squarrel
--
--
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.
Avelino
2015-03-09 04:59:26 UTC
Permalink
Yep Ryan, send new PR[1] solution fix.

Thanks report bug...

[1] https://github.com/bottlepy/bottle/pull/729
Post by Ryan Bregier
Hey guys,
So (using the Bottle ToDo example) is this now the correct way to do
validation?
@route('/edit/:no', method='GET', *'/<no:int>'*)
or is it
@route('/edit/:<no:int>', method='GET', *'/<no:int>'*)
Thanks!
Post by squarrel
Hi yall,
I'm trying to work with what seems to me as the most compact and painless
web framework I have stumbled on so far and I enjoy it.
I do: from bottle import route, run, template, error, static_file, get,
request, validate
I get: ImportError: cannot import name validate
I have no idea why is this so. I am using Bottle 0.12-dev. (Now I see this
is a development version)
squarrel
--
--
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.
For more options, visit https://groups.google.com/d/optout.
--
Thiago Avelino - GPG Keys: 2E98180A
<***@avelino.xxx> (Mail/XMPP)
http://avelino.xxx
I love long mails! - http://email.is-not-s.ms/
--
--
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...