But why bother? web2py's SQLFORM in controller contains built-in
server-side validation and other goodies. Besides it sets up correct
form key for you, of course. And you can always customize the view to
whatever you want to. So why insist to do things in opposite
direction, which drown you in unn
Mmm, perhaps Massimo forgot to introduce it in SVN. It is just not
there. But fine, I can wait. :-)
http://code.google.com/p/web2py/source/detail?r=1232
http://code.google.com/p/web2py/source/browse/#svn/trunk/gluon
On Sep19, 2:51pm, Yarko Tymciurak wrote:
> It seems to be in the tree:
>
>
Does Field(...,uploadfolder="...") make it possible to let every user
have his own upload folder by assigning a variable to uploadfolder
like: in the table definition in my model: Field
(...,uploadfolder=variable) and in the controller: variable="myfolder"
Kind regards,
Annet.
--~--~-~--
I think I have reached the limit of my python knowledge and need help.
I have a table that holds "solutions" and the "issues" they solve.
To find out what solutions is viable in difference cases I need to do a
complicated set of checks. I have placed these checks in a set of
methods.
Is there a w
I have a table which contains news items. In the view I would like to
display the first 6 items in full and limit the display of the next 18
items to their title. So something like:
{{for item in news:}}
{{=db.nieuws.publicatie_datum.formatter(item.publicatie_datum)}}
{{=item.titel}}
{{if
Hmm...
Is this what you where thinking?
On Sat, 2009-09-19 at 00:27 -0700, annet wrote:
> I have a table which contains news items. In the view I would like to
> display the first 6 items in full and limit the display of the next 18
> items to their title. So something like:
>
{{count = 0}}
> {
Hi,
I have a standard role and user setup. Lets have a have 1000 user
id's. And I have three roles 1) client 2) admin1 and 3) admin 2.
Admin 1 can have access to 1-500 if the id's and role two can have
access for id's of 501-1000.
What is the best way to this? Do I need to create a lookup tab
Jason,
I'll give it a try, if it works, it's exactly what I was looking for.
Kind regards,
Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web2py@g
In python, it is easy.
>>> def foobar(): print 'hello world'
...
>>> exec('foobar'+'()')
hello world
>>>
However, the exec() might be considered dangerous if you are not sure
what function name string would be inside DB. So if I were you, I
would still use a translation system, but a more elegan
Here is a better version:
http://web2py.com/examples/static/sneaky.py
and woila' a Python 3.0 version:
http://web2py.com/examples/static/sneaky3.py
Massimo
On Sep 19, 2:06 am, Iceberg wrote:
> Mmm, perhaps Massimo forgot to introduce it in SVN. It is just not
> there. But fine, I ca
The first 3 lines of your code snippet can be changed into:
{{for count, item in enumerate(news):}}
That is more pythonic. Using counter variable is the bad taste from C
era.
On Sep19, 3:32pm, Jason Brower wrote:
> Hmm...
> Is this what you where thinking?
>
> On Sat, 2009-09-19 at 00:27 -0
On Sep 19, 8:14 am, annet wrote:
> Does Field(...,uploadfolder="...") make it possible to let every user
> have his own upload folder by assigning a variable to uploadfolder
> like: in the table definition in my model: Field
> (...,uploadfolder=variable) and in the controller: variable="myfolder"
Unfortunately it did not work. Every 'not so detailed item' gets its
own table instead of a table row.
The latest function reads like:
def latest():
response.functionname='Laatste nieuws'
response.image=URL(r=request,c='static',f='init/media/
utilities_1.jpg')
latest=db((db.nieuws.be
You are taking risks. People can steal your session cookie, access
appadmin and from there run any python code using the query string.
You should not comment those lines but go over https.
Massimo
On Sep 18, 11:46 pm, suiato wrote:
> thanks to the instructions on the book and the example
> web
Hi Massimo, to upset you again, the latest svn trunk (with the
"better" version already?) results in:
File "C:\DOWNLOAD\web2py-trunk\gluon\sneaky.py", line 269, in
build_environ
envione[key]=value
NameError: global name 'envione' is not defined
On Sep19, 4:23pm, mdipierro wrote:
> Here is
Hi Iceberg,
I want to do it from the view becuase I actually want to control the
markup by myself. SQLFORM will ouput the form in a table. What about
if I want to do it in a way other than table. I just want to have
control over the form
Winston
On Sep 19, 10:02 am, Iceberg wrote:
> But why bo
form.custom (see p. 219 in the manual, for example)
On Sat, Sep 19, 2009 at 4:10 AM, eddwinston wrote:
>
> Hi Iceberg,
>
> I want to do it from the view becuase I actually want to control the
> markup by myself. SQLFORM will ouput the form in a table. What about
> if I want to do it in a way ot
Your right, I just can't help it!
:P
On Sat, 2009-09-19 at 01:32 -0700, Iceberg wrote:
> The first 3 lines of your code snippet can be changed into:
>
> {{for count, item in enumerate(news):}}
>
> That is more pythonic. Using counter variable is the bad taste from C
> era.
>
> On Sep19, 3:
It should work. What did it output instead?
Regards,
Jason
On Sat, 2009-09-19 at 01:35 -0700, annet wrote:
> Unfortunately it did not work. Every 'not so detailed item' gets its
> own table instead of a table row.
>
> The latest function reads like:
>
> def latest():
> response.functionnam
Yes, customizing the SQLFORM or FORM is the correct way. See also
this.
http://www.web2py.com/AlterEgo/default/show/205
On Sep19, 5:15pm, Yarko Tymciurak wrote:
> form.custom (see p. 219 in the manual, for example)
>
>
>
> On Sat, Sep 19, 2009 at 4:10 AM, eddwinston wrote:
>
> > Hi Iceberg,
Hi,
I am planning to deploy to GAE and should hopefully see quite a few
users eventually.
Does DAL's GAE support scale well? Will I run into the 1000 fetch()
limit or is that handled
under the hood for example?
Should one rather handcraft the Datastore interface with let's say
1000 concurrent use
Is there a variable which distinguishes dev & production for gae? It
would simplify deployment.
On Sep 18, 3:46 pm, Robin B wrote:
> To send mail locally, you need to specify the mail server to be used:
>
> http://code.google.com/appengine/docs/python/tools/devserver.html#Usi...
>
> Robin
>
> On
An "Add to directroy" link next to EDIT etc. in the admin might be
nice.
Generally I think it would be great if w2p instances were more aware
of other w2p instances (obviously only if the admin wants that), such
that
one could look for a thumbnail, webshot, payment, ... services offered
by other i
Thanks for commenting, Massimo.
On 9月19日, 午後5:40, mdipierro wrote:
> You are taking risks. People can steal your session cookie, access
> appadmin and from there run any python code using the query string.
oops, pretty scary.
>
> You should not comment those lines but go over https.
Actually,
Hello,
I'm new to this group and to web2py and even to web development but
not completely to Python and thus this suggestion (that could be
completely wrong):
(and BTW, I would like to use this first post to thank a lot Massimo
Di Pierro for his fantastic work !!! )
On 19 sep, 09:27, annet wro
Hi Annet,
I will give you an example using db.person since I don't know which
fields you want displayed.
rr=db().select(db.person.ALL) # or whatever selection
rr.hooks=False # only the data
maxk=min(24,len(rr))
# 6 rows with id and name fields
r1=[TR(rr[k].id,rr[k].name) for k in range(0,min(6,m
Hi!
Mi name is Jose Eloy Torres, from Mexico. I've downloaded the web2py
framework (and I bought the book @lulu.com) and it seems a great
product!
I'm interesting in create applications using Web2py and offer they to
customers, but I'd like have the freedom to configure the web server
and instal
Hi eddwinston,
it all depends on what you are working with, more detail is required.
If your form is based on a table the easiest way to go is to use
SQLFORM, which does NOT mean that you have to display it as generated
(you can use what Yarko or Iceberg suggest). And the validation is a
snap.
The GAE DAL does not try to handle the 1000 fetch limit. GAE apps
must be designed differently, meaning if you need more than 1000
results from a query, then probably what you were attempting to do is
not scalable. Queries are O(#results), so you should keep your
queries small to make your reque
Look in gaehandler.py:
if os.environ.get('SERVER_SOFTWARE', '').startswith('Devel'):
(settings.web2py_runtime, settings.web2py_runtime_gae, debug) = \
('gae:development', True, True)
else:
(settings.web2py_runtime, settings.web2py_runtime_gae, debug) = \
('gae:production',
Hi folks,
I just wanted to share a module that I'm working on for a
project. It contains tools for managing client events and resources
from the server. Here are the main features:
1) Dynamic inclusion and downloading of resources (scripts/css).
2) Server side event handling for client sid
Fran is correct. The place to specify the uploadfolder is in the
controller (when uploading) and the download function (for
downloading). I just tested out the functionality and it works as
advertised, enabling every user to have his/her own upload folder.
On Sep 19, 4:33 am, Fran wrote:
> On Se
Massimo, I tested it on the latest release and it works. - Richard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from
Hi All!
I wonder if somebody could help me.
I have:
form=crud.create(db.oklevel_sablon,next=URL
(r=request,f='sablonsor_jog',args="[id]"))
But the next url looks:
.../sablonsor_jog/%5Bid%5D
The "[id]" isn't replaced with the created record's number :(
I read in the book page 217:
"• next
On Sat, Sep 19, 2009 at 1:46 PM, szimszon wrote:
>
> Hi All!
>
> I wonder if somebody could help me.
>
> I have:
>
> form=crud.create(db.oklevel_sablon,next=URL
> (r=request,f='sablonsor_jog',args="[id]"))
>
> But the next url looks:
> .../sablonsor_jog/%5Bid%5D
>
> The "[id]" isn't replaced with
Background:
Working with an app on GAE currently I've run across a slight issue
with uploading data into my app. I initially tried to download my
tables to CSV from my development machine then use simply re-upload
them into GAE. It's been a while since I tried that but it was timing
out.
Proble
> Looking over two tables here are the things I've identified as
> possible problems:
> 1 - This table has a 'double' in it. Not just int/string like the
> working one. For GAE uploading I defined the double field as a GAE
> "float" property. Is it possible web2py defines a 'double' as
> someth
I want to enable upload of a long string via a text field, that I will
then save as a file and store in the same place as uploaded files. I
generate the filename automatically, ensuring it's unique. I save the
filename into the db.table.filename, where filename is Field
('filename','upload'). This
>From what I've read enabling billing doesn't increase the CPU time
just some of the other quotas. It's CPU time that gets eaten up so
badly when you remove/add items to the datastore and I'm not keen on
paying for extra CPU time until I at least have some sort of working
app to expand on.
As fa
The autodelete=True feature doesn't seem to work with the new
capabilities of db.table.field.uploadfolder=/somepath/somwhere.
Anybody else have trouble with this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2p
Winston:
form.custom is one way to do this. That's the method I use and it
works.
However, I believe you can still do it your way. If you want your
controller to be able to process the form, which I think is a good
assumption, then you must have an equivalent myform=FORM(...)
statement in your c
check form.vars['filename_newfilename'];
see the section "SQLFORM and uploads" in the manual (~ p.195)
On Sat, Sep 19, 2009 at 6:13 PM, weheh wrote:
>
> I want to enable upload of a long string via a text field, that I will
> then save as a file and store in the same place as uploaded files. I
Hi Yarko, thanks for the response.
I may already have this section memorized, by now from having read it
around 10 times ;^) But this is not the answer I'm looking for.
Let me explain...
# db:
db.define_table('table1',Field('filename','upload'))
# view
form=SQLFORM.factory(Field('text_in','
why don't you just set a breakpoint and figure it out?
On Sat, Sep 19, 2009 at 6:48 PM, weheh wrote:
>
> Hi Yarko, thanks for the response.
>
> I may already have this section memorized, by now from having read it
> around 10 times ;^) But this is not the answer I'm looking for.
> Let me exp
btw - I am currently having trouble w/ the "sneaky" wsgi...
On Sat, Sep 19, 2009 at 6:58 PM, Yarko Tymciurak wrote:
> why don't you just set a breakpoint and figure it out?
>
>
> On Sat, Sep 19, 2009 at 6:48 PM, weheh wrote:
>
>>
>> Hi Yarko, thanks for the response.
>>
>> I may already have th
On Sep 19, 6:13 pm, Chris S wrote:
> From what I've read enabling billing doesn't increase the CPU time
> just some of the other quotas. It's CPU time that gets eaten up so
> badly when you remove/add items to the datastore and I'm not keen on
> paying for extra CPU time until I at least have
I have renamed the example of routes to routes.py (and I even created
a new file from scratch, just in case) but I don't think it is
executed.
My routes_in is:
routes_in = (
('/', '/applicationname/stats/old'),
)
I wanted to map this:
www.myapplication -> www.myapplication/applicationname/st
Ok, nevermind. I've just remember that you must restart the server in
order for routes to be read again.
But what happens on a shared hosting account, where you have no access
to apache?
On Sep 20, 4:04 am, Jon Romero wrote:
> I have renamed the example of routes to routes.py (and I even created
ok, last post!
You can just kill the processes (it's 4 in the morning here in Athens,
so please excuse me), so routes.py will be read again.
On Sep 20, 4:04 am, Jon Romero wrote:
> I have renamed the example of routes to routes.py (and I even created
> a new file from scratch, just in case) but
I have been using Dreamhost for the past two years, and I have never had a
problem with them.
They just upgraded apache with passenger_wsgi, so python aps using wsgi
(web2py) run fast!
You get unlimited web space and unlimited bandwidth, plus shell access... it
really is the most you will get out
Also, if you want an example of web2py running on dreamhost, head over to
http://surrenderthebooty.thadeusb.com/
It is a aggregator for gaiaonline.com's mini game named booty grab.
It uses web2py auth, external cron, mailer, custom forms, and apache is
serving static files. sqlite3 backend for s
Do you have to use the page object, or could you just make it use the event
object.
Meaning I just want a simple event.listen("click", div, call_func) without
any of the other jazz.
-Thadeus
On Sat, Sep 19, 2009 at 1:14 PM, mr.freeze wrote:
>
> Hi folks,
>
>I just wanted to share a modu
I'm working on it ...
On Sep 19, 7:58 pm, Yarko Tymciurak wrote:
> why don't you just set a breakpoint and figure it out?
>
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this g
The EventManager class requires an instance of the PageManager class.
Idea being, as I add classes to the module, everything will get
rendered through the page manager.
On Sep 19, 8:45 pm, Thadeus Burgess wrote:
> Do you have to use the page object, or could you just make it use the event
> obje
Relevancy to this thread?
On Sep 19, 7:59 pm, Yarko Tymciurak wrote:
> btw - I am currently having trouble w/ the "sneaky" wsgi...
>
>
>
> On Sat, Sep 19, 2009 at 6:58 PM, Yarko Tymciurak wrote:
> > why don't you just set a breakpoint and figure it out?
>
> > On Sat, Sep 19, 2009 at 6:48 PM, we
Have you checked out GAE? I can't vouch for the secure part, pero me
parece que gratis es bastante barato. :^)
On Sep 19, 10:18 am, pepe_eloy wrote:
> Hi!
>
> Mi name is Jose Eloy Torres, from Mexico. I've downloaded the web2py
> framework (and I bought the book @lulu.com) and it seems a great
>
So is the page class acting like a template renderer?
-Thadeus
On Sat, Sep 19, 2009 at 9:28 PM, mr.freeze wrote:
>
> The EventManager class requires an instance of the PageManager class.
> Idea being, as I add classes to the module, everything will get
> rendered through the page manager.
>
Hi everyone
May I know how to process multiple buttons on a form?
For example, I have 2 buttons (process and save). How should I write
the form.accept(request.vars, session) part to differentiate the
actions of the 2 buttons?
form = FORM(TABLE(TR('Sequence (raw format): ',
I was trying to move a MySQL based app to the GAE. The MySQL was
built by inserting values into the SQL table with a python script, so
it made since (to me) to do the same on the GAE. I'm guessing the
easiest way to avoid this would have been to download a CSV of my data
and use the appadmin to
The plot thickens. On further inspection and experimentation, it looks
like the file name must have the table name and the field name encoded
in it. So:
xyz.txt
as a filename will fail to download.
But,
table1.filename.xyz.txt
will work.
--~--~-~--~~~---~--
Hmmm... tricky. My first inclination was to say, check the
request.vars to see if you can tease out which button was pressed. But
I looked in winpdb, myself, and I couldn't see any indication in any
of the variables as to which button was pressed (which isn't to say
that it's not there ... just th
This thread might also be useful to you:
http://groups.google.com/group/web2py/browse_thread/thread/c20e1b4d824ce800/ace5d00c95d8cf93?lnk=gst&q=form%5B0%5D%5B-1%5D%5B1%5D.append#ace5d00c95d8cf93
--~--~-~--~~~---~--~~
You received this message because you are subscri
The PageManager class renders all of the javascript necessary for the
callbacks and resource inclusions. It doesn't render any html.
On Sep 19, 9:37 pm, Thadeus Burgess wrote:
> So is the page class acting like a template renderer?
>
> -Thadeus
>
> On Sat, Sep 19, 2009 at 9:28 PM, mr.freeze wr
OK, here's a way to do it:
{{=form.custom.begin}}
Process
{{=form.custom.submit}}
{{=form.custom.end}}
Then, when you press the process button, the request.vars.process will
not be None.
--~--~-~--~~~---~--~~
You received this message because you are subscribed t
On Sep20, 11:57am, weheh wrote:
> OK, here's a way to do it:
>
> {{=form.custom.begin}}
> name="process">Process
>
> {{=form.custom.submit}}
> {{=form.custom.end}}
>
> Then, when you press the process button, the request.vars.process will
> not be None.
Interesting. But is this trick universa
I have not tried the appadmin on GAE, but I wonder if it uses count
and or offset which will not work beyond 1000 records. You have to
roll your own pagination on GAE by giving each field a unique
composite sorted value or the ID, and then pass a next=key url query
string parameter that points to
oops! Will fix this.
On Sep 19, 6:14 pm, weheh wrote:
> The autodelete=True feature doesn't seem to work with the new
> capabilities of db.table.field.uploadfolder=/somepath/somwhere.
> Anybody else have trouble with this?
--~--~-~--~~~---~--~~
You received this m
very good work! Let us know when you consider it stable.
On Sep 19, 1:14 pm, "mr.freeze" wrote:
> Hi folks,
>
> I just wanted to share a module that I'm working on for a
> project. It contains tools for managing client events and resources
> from the server. Here are the main features:
>
>
...and some of us use webfaction, and are happy with it...
On Sat, Sep 19, 2009 at 9:30 PM, weheh wrote:
>
> Have you checked out GAE? I can't vouch for the secure part, pero me
> parece que gratis es bastante barato. :^)
>
> On Sep 19, 10:18 am, pepe_eloy wrote:
> > Hi!
> >
> > Mi name is Jose
Curious. I originally tested my method on IE7 and it works OK.
Nevertheless, Iceberg is right in that the button tag isn't consistent
across browsers. w3cschools.com says
"""
Always specify the type attribute for the button. The default type for
Internet Explorer is "button", while in other browse
70 matches
Mail list logo