Let's say you have a model to upload static files
db.define_table('album',SQLField('image','upload'))
and Auth and Crud enabled.
from tools import *
auth=Auth(globals(),db)
auth.define_tables()
crud=Crud(globals(),db)
In controller you have
@auth.requires_login()
d
I was about to include google open id signin in Auth but I discovered
this:
https://rpxnow.com/docs#token_url
It seems a better way to go because it avoids reinventing the wheel.
It is documented well enough that it should be easy to include.
Yet I am not familar with rpx. Are there any cons
hey, thanks. That's a great idea. I may try that.
Best regards
On Apr 30, 4:56 am, Wes James wrote:
> On Wed, Apr 29, 2009 at 9:17 PM, blackthorne wrote:
>
> > hi
>
> > I wanted to be able to fully configure SQLFORM generated forms with
> > CSS. Being table based seems to restrict my possibili
web2py has nothing to do with this. jquery allows you to for example:
function youraction() { alert("do something"); return true; }
$(document).ready() { $('a').click(youraction()); }
The exact expression depends on details.
On 29 Apr, 23:41, waTR wrote:
> I have a form with a submit button.
I have a form with a submit button. However, I need web2py to read the
form and perform an action not only when the person clicks on the
submit button, I also need it to perform the action when the user
clicks on any other link on the page.
How can I do this with web2py?
--~--~-~--~~-
I need to run a datetime through JSON and it doesn't work. I found
Timothy Farrell's workaround here:
https://mdp.cti.depaul.edu/web2py_wiki/default/wiki/JSONdatetime
but for some reason, it doesn't work for me. I tried:
# timothy's code goes up here
def test():
return dumps(datetime.datet
Ignore my email. This would be a big mistake.
Massimo
On 29 Apr, 22:50, mdipierro wrote:
> try this
>
> def tab2div(form):
> if not hasattr(form,'components'): return
> for item in form.components:
> try:
> if item.tag in ['table','tr','td']: item.tag='div'
>
On 4月29日, 下午9时10分, mdipierro wrote:
> if you run from shell you must also call
>
> db.commit()
>
> actions in https are automatically wrapped in transactions and
> committed automatically.
>
Thanks very much. It works now.
> On Apr 29, 4:40 am, YangHong wrote:
>
> > Hi all
>
> > I added a cr
On Wed, Apr 29, 2009 at 9:17 PM, blackthorne wrote:
>
> hi
>
> I wanted to be able to fully configure SQLFORM generated forms with
> CSS. Being table based seems to restrict my possibilities in CSS. Is
> there any tip, snippet on how may I easily give some personal style
> into my SQLFORM's ?
Y
try this
def tab2div(form):
if not hasattr(form,'components'): return
for item in form.components:
try:
if item.tag in ['table','tr','td']: item.tag='div'
tab2div(item)
except: pass
tab2div(form)
On 29 Apr, 22:17, blackthorne wrote:
> hi
hi
I wanted to be able to fully configure SQLFORM generated forms with
CSS. Being table based seems to restrict my possibilities in CSS. Is
there any tip, snippet on how may I easily give some personal style
into my SQLFORM's ?
Thanks
--~--~-~--~~~---~--~~
You rec
On a second (or third) thought.
By default in trunk
auth.settings.block_registration=False
auth.settings.gmail_login=True
you can also allow only gmail logins
auth.settings.block_registration=True
auth.settings.gmail_login=True
or block them all
auth.settings.block_registration=True
auth.set
Worked fine here (on localhost).
What security risks are involved with enabling this feature?
On Thu, Apr 30, 2009 at 3:46 AM, mdipierro wrote:
>
> for security I made
>
> auth.settings.gmail_login=False # by default
>
> change it to true to try this out.
>
> On 29 Apr, 13:19, Alexei Vinidiktov
look into gluon/sqlhtml.py for the select widget.
It should be trivial to make a radio button widget and replace the
default one.
db.table.field.widget=yourcustomwidget
On 29 Apr, 21:50, JohnMc wrote:
> With Web2py it is so easy to do a dropdown with the IS_IN_ SET or DB
> does anybody use rad
With Web2py it is so easy to do a dropdown with the IS_IN_ SET or DB
does anybody use radio buttons in their form layouts?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this
check webfaction.com and slicehost.com
On Apr 30, 2:59 am, greenpoise wrote:
> Thanks! I will take a look..wont get tired of saying, what a great
> work!
>
> dan
>
> On Apr 29, 5:27 pm, mdipierro wrote:
>
> > You can find some info on this wiki created by users:
>
> >https://mdp.cti.depaul.edu/
Thanks! I will take a look..wont get tired of saying, what a great
work!
dan
On Apr 29, 5:27 pm, mdipierro wrote:
> You can find some info on this wiki created by users:
>
> https://mdp.cti.depaul.edu/web2py_wiki/default/wiki/hosting
>
> In general every host is different but web2py works wit
Just reading through the docs ... here's where I found the
registration link:
http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto.html
Dave
On Apr 29, 1:51 pm, mdipierro wrote:
> I am trying to allow Auth to access google open id. This is a test.
>
> 1) register your domain with
Ok I think I see the answer. It uses Jython, so I'm guessing that's a
no.
Mike
On Apr 29, 3:00 pm, mikech wrote:
> Hi: I'm still in the learning process with Web2py and Python for that
> matter. And while its really too soon for me to consider the ui
> design aspect of my projects I've been l
> ProgrammingError: (2014, "Commands out of sync; you can't run this
> command now")
In the interest of being complete:
_cursor.nextset() solves this, but you have to call fetchall() (or
whatever...) and collect info from _cursor.description before calling
nextset().
I did this by overriding ex
> customize form markup. It has already been suggested that form can be
> used for validation and its values can be used in a view with helpers
> to create custom markup.
Yes, that would be "addressing form list elements from python". Mighty
ugly IMHO when you take into account all you need to do
So the limitation was my capability to write a SQL 2003 compliant
select statement ;-)
On Apr 29, 11:59 pm, Hans
wrote:
> Yarko,
>
> deep down in the reference manual of mysql 5.1 I've found the reason
> for the issue,http://dev.mysql.com/doc/refman/5.1/en/join.html.
>
> Basically as of mysql ve
Hi: I'm still in the learning process with Web2py and Python for that
matter. And while its really too soon for me to consider the ui
design aspect of my projects I've been looking around at what's
available. YUI, pyjamas and others all look interesting but I'm
really impressed with the appearan
Yarko,
deep down in the reference manual of mysql 5.1 I've found the reason
for the issue, http://dev.mysql.com/doc/refman/5.1/en/join.html.
Basically as of mysql version 5.0.12 there where some changes
introduced which are not backward compatible (on older mysql versions
the select/joins work o
You can find some info on this wiki created by users:
https://mdp.cti.depaul.edu/web2py_wiki/default/wiki/hosting
In general every host is different but web2py works with most of them
as long as they provide python 2.5 (web2py trunk works with 2.4 and
2.6 but 2.5 is the official version) and sup
I was skimming through the web2py book. Trying to put my ideas
together, I went directly to the deployment recipes and I have some
doubts/questions. Do I need special hosting? I see shared hosting in
the posts of this group. A dedicated server? Will a regular hosting
account cut it?
Leads appreci
good catch. fixed it.
On 29 Apr, 15:51, Wes James wrote:
> Massmo,
>
> I downloaded latest trunk. Created an app. Created a view, then
> edited it. I then clicked on the design link and it takes me to the
> admin design area, not the design area for the app I'm in.
>
> -wj
--~--~-~--~
Massmo,
I downloaded latest trunk. Created an app. Created a view, then
edited it. I then clicked on the design link and it takes me to the
admin design area, not the design area for the app I'm in.
-wj
--~--~-~--~~~---~--~~
You received this message because y
I am trying to allow Auth to access google open id. This is a test.
1) register your domain with google open id
http://code.google.com/intl/it/apis/account/docs/RegistrationForWebAppsAuto.html
2) add the following method to gluon/tools.py Auth class
def gopenid(self):
return_to="http://you
On Apr 29, 8:08 pm, Iceberg wrote:
> Sorry but I have to say the {{if response.flash.xml()[1:4] == 'div':}}
> looks ugly.
Yup, I know ;)
> I guess:
> isinstance(response.flash, str)
> or:
> isinstance(response.flash,DIV)
> would do same thing and is more elegant.
Nice :)
F
--~--~-
for security I made
auth.settings.gmail_login=False # by default
change it to true to try this out.
On 29 Apr, 13:19, Alexei Vinidiktov
wrote:
> Thanks, this time I could successfully login. Haven't tried it on GAE
> yet though.
>
> I think it's a very useful feature, and google openid support
There is a new variable in applications/admin/models/0.py called
GAE_APPCFG
Make it point to your Google App Engine appcfg..py file.
You will see a new [deply] button in the administrative interface and
you can deploy directly from web2py.
Please check it out and let me know.
Massimo
--~--~--
I do not think any change in T broke your app. It should now change
the behaviour of DIV.
notice that
DIV('').tag == 'div'
On 29 Apr, 13:58, Fran wrote:
> In order to use the newly-suggested differential flash classes (), I
> have this in my layout.html:
> {{if response.flash:}}
>
Sorry but I have to say the {{if response.flash.xml()[1:4] == 'div':}}
looks ugly. I guess:
isinstance(response.flash, str)
or:
isinstance(response.flash,DIV)
would do same thing and is more elegant.
On Apr30, 2:58am, Fran wrote:
> In order to use the newly-suggested differential flash class
In order to use the newly-suggested differential flash classes (), I
have this in my layout.html:
{{if response.flash:}}
{{if response.flash.xml()[1:4] == 'div':}}
{{=response.flash}}
{{else:}}
{{=response.flash}}
{{pass}}
{{pass}}
This allows me to use a straig
Thanks, this time I could successfully login. Haven't tried it on GAE
yet though.
I think it's a very useful feature, and google openid support you are
working on is also something I'm looking forward to.
On Thu, Apr 30, 2009 at 2:04 AM, mdipierro wrote:
>
> please try again. I fixed it. sorry.
please try again. I fixed it. sorry.
On 29 Apr, 12:48, Alexei Vinidiktov
wrote:
> When I tried to login (from localhost) with my gmail.com credentials
> I got this ticket:
>
> Error traceback
>
> Traceback (most recent call last):
> File "C:\Users\Alexei\Documents\web2py-read-only\gluon\restr
When I tried to login (from localhost) with my gmail.com credentials
I got this ticket:
Error traceback
Traceback (most recent call last):
File "C:\Users\Alexei\Documents\web2py-read-only\gluon\restricted.py",
line 102, in restricted
exec ccode in environment
File
"C:/Users/Alexei/Docu
I was using an approach similar to Joe's, but the issue was the need
to specify the url each time a redirect occurs from different
controllers... I can understand the issue massimo has raised... will
try to tinker with practices elsewhere and update the forum if I can
find anything good..
Thanks
The #1 item (upload a file) can be handled by using the "form factory"
to create a form with an upload field, even with no matching database
table. This is covered in Massimo's book on page 177.
-- Joe B.
On Apr 29, 1:26 am, Timmie wrote:
> Hello,
> how does web2py handle temporary files?
>
>
Session vars won't (always) work as they can't take into account
multiple open tabs/windows, and ajax can play a trick or two on you,
too
On Apr 29, 4:24 pm, Wes James wrote:
> If Massimo doesn't indicate a straight forward way for this, you can
> stuff the value in to your own session variable.
How strange to find this conversation when I was dealing with this
problem just last night. I often find I need to let my user click on
a link to a new page in my app (e.g. to add a new item to a database)
and then come back to the previous page (e.g. to use that new item in
some way).
I've been
sort of a form elements decorator... this has already been discussed
here, I'm sure Massimo wouldn't mind to include a nice solution to
this issue if someone has it. I too think there should be a way to
customize form markup. It has already been suggested that form can be
used for validation and i
no because web2py does not know what the full url is from the
prospective of the client. For example there may be one of multiple
proxies in between. This is a major problem. This is what causes some
problems to CAS users.
Massimo
On 29 Apr, 11:21, vihang wrote:
> Agreed, but can we have a sess
There is a new feature in trunk. When you try to login using Auth and
you do not have an account but use credentials from a valid gmail.com
account, the system will automatically register you and let you in.
I do not know if it works on GAE too. Could somebody try it?
I am also trying to add sup
Agreed, but can we have a session variable with the path updated
automatically every time redirect() is called ?... that would be very
useful
On Apr 29, 7:16 pm, mdipierro wrote:
> There is no straight forward way because I do not trust the browser to
> handle this properly
>
> On 29 Apr, 09:24,
For me the most annoying things are:
- in mysql the text field has a max size (mysql does not really
provide arbitrary length text fields)
- each "alter table" must be done in its own transaction that means I
was forced to break migrations in multiple transactions.
It seems everything in mysql h
There is no straight forward way because I do not trust the browser to
handle this properly
On 29 Apr, 09:24, Wes James wrote:
> If Massimo doesn't indicate a straight forward way for this, you can
> stuff the value in to your own session variable.
>
> -wj
>
> On Wed, Apr 29, 2009 at 5:49 AM, vi
It is safe
On 29 Apr, 09:10, ae wrote:
> Is it safe to use the MySQLdb module directly?
>
> The documentation indicates that each thread needs it's own connection
> object.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gr
2009/4/29 ae
>
> I'm struggling with how to handle a database that already exists.
> I've written model code for many of the tables and I can access them,
> but many others don't have 'id' fields. One table has a field that is
> an enum().
>
> If I must resort to using db.executesql(), how shoul
I'd be interested to hear a little more about what the mysql issue is...
(I don't use, but am/will be forced to on one work server, so want to hear
what others are going thru)
Thanks,
- Yarko
2009/4/29 mdipierro
>
> there lots of mysql issues unfortunately.
>
>
> On Apr 29, 7:08 am, Hans
> wro
If Massimo doesn't indicate a straight forward way for this, you can
stuff the value in to your own session variable.
-wj
On Wed, Apr 29, 2009 at 5:49 AM, vihang wrote:
>
> Hi,
>
> Is there any way to know which the current page was redirected from?
> Esp, when one calls redirect(), I would lik
Is it safe to use the MySQLdb module directly?
The documentation indicates that each thread needs it's own connection
object.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to
Also, when I try to call a stored procedure, I get this:
db.executesql("call my_proc('junk')")
Traceback (most recent call last):
File "/ita/installs/bliss/web2py/gluon/main.py", line 334, in
wsgibase
SQLDB.close_all_instances(SQLDB.commit)
File "/ita/installs/bliss/web2py/gluon/sql.py",
Hi,
After tracking my website at GAE that using Web2Py, i see it takes
about 650 cpu_ms to serve every request.
241ms 721cpu_ms 537api_cpu_ms 2kb
Is there any way to reduce loading time of web2py?
P/S: The first time, it takes > 2000ms to load.
Thanks
Nguyen
--~--~-~--~~-
Good enough. We do not ask to exclusive. We just ask that if people
need web2py support know who to call.
Massimo
On Apr 29, 7:43 am, Benigno wrote:
> Hello Massimo,
>
> Athttp://www.albendas.com, we do consulting and web developement
> when necessary. We currently have two projects working
if you run from shell you must also call
db.commit()
actions in https are automatically wrapped in transactions and
committed automatically.
On Apr 29, 4:40 am, YangHong wrote:
> Hi all
>
> I added a cron task like this:
>
> web2py$ cat applications/everule/cron/crontab
> */2 * *
Hello Massimo,
At http://www.albendas.com, we do consulting and web developement
when necessary. We currently have two projects working on Web2py one
is an internal tool to have some Zendesk reporting customized to our
needs to report to our clients, and the other is a little project for
a gol
Hi all
I added a cron task like this:
web2py$ cat applications/everule/cron/crontab
*/2 * * * * root *everulecron/
download_upstream
The function:
def download_upstream():
query = (db.upstreamse.status == 'pending')
rows = db(query).select(db.upstreamse.ALL
there lots of mysql issues unfortunately.
On Apr 29, 7:08 am, Hans
wrote:
> Update: I've found that its a mysql issue not a web2py one.
>
> On Apr 28, 4:52 pm, Hans
> wrote:
>
> > I'm experiencing a strange behavior within the code below. I tried to
> > split the problem in the smallest pieces
actually I had not looked into this. I will.
On Apr 29, 5:16 am, AchipA wrote:
> What I'd like to consider upfront WHAT EXACTLY do you want to use the
> versioning system for. If you want to cover all usage scenarios, you
> will end up writing a web front-end for versioning systems (that just
>
cleaning it
On Apr 29, 1:26 am, Bernd das Brot wrote:
> Hmm
> does not work correctly in the distributed pages (welcome, admin,..).
> After a bit of looking around I found code like:
>
> default/site.html:
> === snip ===
> Installed applications
> ...
> {{for a in apps:}} {{if a==reques
I'm struggling with how to handle a database that already exists.
I've written model code for many of the tables and I can access them,
but many others don't have 'id' fields. One table has a field that is
an enum().
If I must resort to using db.executesql(), how should I organize the
code so th
Sorry for being so long winded.
I've been trying to implement a custom html form using the crud
applications as explained above, but I'm having difficulty using
custom html. Here is the test MVC that I've created for the purpose
of understanding the concepts:
Model
try:
from gluon.c
Update: I've found that its a mysql issue not a web2py one.
On Apr 28, 4:52 pm, Hans
wrote:
> I'm experiencing a strange behavior within the code below. I tried to
> split the problem in the smallest pieces which I'm able to debug. My
> interpretation of the findings is that most likely I run in
Hi,
Is there any way to know which the current page was redirected from?
Esp, when one calls redirect(), I would like to know the previous page
from the redirected page. I was hoping that info would be there in
request.env.http_referer, but thats not case. Any thoughts?
Thanks
--~--~-~-
I've been customizing some forms that needed to be editable by a
designer - we ended up having something I would call 'formify', at
least for the time of the development cycle. What's the idea here you
ask ? Imagine the following:
form=FORM(SELECT(...), INPUT(..), INPUT(...))
Now, this all nice
http://docs.python.org/library/tempfile.html might be of help
On Apr 29, 10:26 am, Timmie wrote:
> Hello,
> how does web2py handle temporary files?
>
> I would like to create some functionality for users like
>
> 1) uplaod a file (not into database)
> 2) perform actions (e.g. format conversion,
What I'd like to consider upfront WHAT EXACTLY do you want to use the
versioning system for. If you want to cover all usage scenarios, you
will end up writing a web front-end for versioning systems (that just
happens to be used for a web2py application), which might be not what
youre shooting for
Hi Timmie
I m using matplotlib and instead of show() just use savefig
('filepath', dpi=dpi)
I make filepath inside static dir, something like /static/myfiles/
tmp0123
This of course requires periodic cleaning by some cron script, e.g.
delete all files older than 4 days. Or try to use python's tmp
Hello,
I would like to create images on the fly using PIL or matplotlib.
How can I embedd the image in a webpage?
Normally, I would save such images to file.
Has anyone done such things?
Thanks in advance,
Timmie
### example code for image generation:
from matplotlib.pyplot import figure, s
Hello,
how does web2py handle temporary files?
I would like to create some functionality for users like
1) uplaod a file (not into database)
2) perform actions (e.g. format conversion, calculations)
3) retrieve results
For 2) I would need to store the file temporaily in order that other
scripts
On Wed, Apr 29, 2009 at 2:39 AM, Timmie wrote:
>
> I have not tested this, but begin to like this from reading.
As of tonight, there are 2 bugs (simple) and a few usage / boundary issues,
but this will go on it's way quickly I think.
> ated.
>
> > *.pyc
> please add the tickets and teporary st
We have talked about move to mercurial on and off for a year;
Last year I started mirroring to bitbucket.org (where, among other things,
sphinx is hosted).
This year after PyCon, the Python project announced also moving to
mercurial.
Meanwhile (at work) I was part of watching a move to git, and
I have not tested this, but begin to like this from reading.
2 notes:
> Until tonight, I believed you could not have any repository WITHIN a
> repository (maybe this is just bzr? maybe this is my faulty memory?) ---
> thankfully, I've tested this and things are looking good!
>
> This is REALLY
So this is already decided?
Sorry, I do not have any experience with google code hosting other
than pulling files from there.
That colaboration this is what they seem to care for at launchpad,
though.
On 29 Apr., 00:12, mdipierro wrote:
> Considering that we are moving to google mercurial soon.
76 matches
Mail list logo