Hi everybody,
I'm having a problem with a multiple form page. When I submit the
first form (called form) I get the "user is tampering with form" error
at the trace.
The model is:
db=SQLDB('sqlite://storage.db')
db.define_table('recurso',
SQLField('nombre','string',length=100,notnull=True))
Massimo,
This works as long as there is a field called 'filename' in db.py.
stick this in t2.download at the bottom:
return rows[0][uploadfield]
else:
try:
row=db(db[t][f]==name).select(db[t]['filename'])
response.headers['Content-D
Hi Massimo,
Thanks for your help, that solved it. By the way Web2Py is excellent!
Makes everything so easy, if only more people had your philosophy of
keeping things as simple as possible. Thanks again,
Matt
On Feb 13, 11:49 am, mdipierro wrote:
> You have something else running on port 8000.
Thank you!
On Feb 13, 12:09 am, mdipierro wrote:
> form=FORM('enter your name:', INPUT(_'name',_value='John Doe'),
> INPUT
> (_type='submit'))
>
> On Feb 12, 9:40 pm, ionel wrote:
>
> > Hello everyone,
>
> > There is a way to pre-populate a simple form?
>
> > Ex:
>
> > form=FORM('ente
Hi mdipierro, Thank's for your help.
However, the problem is the same.
Please, do you have other idea?
On 13 feb, 12:34, mdipierro wrote:
> Please one more try replace:
>
> def login(): return dict(form=t2.login())
>
> with
>
> if t2.logged_in:
> cache.ram('client:%s' % t2.person_email
I just moved an app into production using a postgresql database and am
having some trouble with Auth. All of the development was done
against sqlite and everything is working fine in there. In fact,
everything works fine against postgresql too except for registering
new users. For some reason w
Actually this is the way I would like it to work. If it is just a
display then no data in the db() query but if they click on a link to
down load a file it does get the data :)
On Fri, Feb 13, 2009 at 3:43 PM, Wes James wrote:
> in t2.py - def download
>
> if I do:
>
> rows=db(db[t][f]==na
in t2.py - def download
if I do:
rows=db(db[t][f]==name).select()
it does not get a rows[0] when used with itemize, but with an edit call it does?
-wj
On Fri, Feb 13, 2009 at 1:31 PM, compte...@gmail.com
wrote:
>
> ok - i'm looking in sqlhtml.py and getting some more ideas - along
> wit
Massimo,
Thanks very much for your quick response and helpful code.
I'm new to Web2Py, but I'm really enjoying it so far. In a way, it
reminds me of the rapid development positive feedback loop I felt
when I first encountered Borland's Delphi environment. Addictively
fun!
I'm not sure what's
On Feb 13, 7:25 pm, Miguel Goncalves
wrote:
> I would like to create a RESTfull web service with web2py using JSON as the
> 'encoding' format.
I have a RESTlike controller documented here:
https://trac.sahanapy.org/wiki/BluePrintRESTImplementation
JSON POST still needs to be completed, so help
ok - i'm looking in sqlhtml.py and getting some more ideas - along
with wind-ide
Where could I learn how to better access objects in python?
In wing-ide, for instance it shows:
rows gluon.sql.SQLRows
__dict__ dict
_dbgluon.sql.dict
Where can I learn
In def download(self):
I have doing this:
rows=db(db[t][f]==name).select()
print rows.xml()
print type(rows)
print rows
I get this:
foto.idfoto.titlefoto.thumbnailfoto.imagefoto.filename
foto.id,foto.title,foto.thumbnail,foto.image,foto.filena
there are many dialects of rest so there are many ways to do it.
You can do something like this:
import gluon.contrib.simplesjon as json
def delete():
### http:///delete/1
return db(db.book.id==request.args[0]).delete()
def create():
### http:///create?fields=
return db
Hi
I would like to create a RESTfull web service with web2py using JSON as the
'encoding' format.
Suppose I would have a model containing the following data:
-book_id
-title
-author
-brief_description
and I want CRUD functions accessible through a REST web service.
How would I go about that?
Please one more try replace:
def login(): return dict(form=t2.login())
with
if t2.logged_in:
cache.ram('client:%s' % t2.person_email, lambda:request.client,
-1)
def login():
if request.vars.email:
client=cache.ram('client:%s' %
request.vars.email,lambda:request.client, 300)
you can do:
options=[str(x) for x in range(10)]
form=FORM(SELECT(*options,_name='test',_multiple='multiple'),INPUT
(_type='submit'))
or you can do:
from gluon.sqlhtml import form_factory
options=[str(x) for x in range(10)]
form=form_factory(SQLField('test',requires=IS_IN_SET
(options,multiple=T
Hello there, I'm new at web2py, and I have a question. When making a
form with FORM() how I do a ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to w
On Fri, Feb 13, 2009 at 6:59 PM, mr.freeze wrote:
>
> Massimo, do you think jQuery UI should be included with web2py?
According to http://jqueryui.com/download jQeuery UI complete is about
300 kB minified! Usually you build a custom UI file which only
contains the UI elements you need.
Markus
Massimo, do you think jQuery UI should be included with web2py?
BTW, with the PageManager class this works in a controller :)
pagemanager.addscript(JQuery("#footer").bind("click",JFunction(JQuery
("this").hide("slow")() + JQuery("this").show("slow")() ,'e'))())
On Feb 13, 11:26 am, "mr.freeze"
I guess I need to try this myself before sending it. Sorry I have not
done so. I will test it, debug it and get back to you.
massimo
On Feb 13, 11:27 am, drayco wrote:
> Sorry, I tested it again and the problem is the same.
>
> Please, Do you have other suggestion?
>
> On 13 feb, 07:58, mdipier
Yes
format='%(first_name)s %(last_name)s'
db.vote.auth_user_id.requires=IS_IN_DB(db,'auth_user.id',format)
On Feb 13, 11:27 am, "Sebastian E. Ovide"
wrote:
> Hi All,
>
> with IS_IN_DB it possible to display a column of a table in a drop down, say
> for example "username". In some occations it i
Sorry, I tested it again and the problem is the same.
Please, Do you have other suggestion?
On 13 feb, 07:58, mdipierro wrote:
> My Bad. Please try this. replace the login() function
>
> def login(): return dict(form=t2.login())
>
> with
>
> if t2.logged_in:
> cache.ram('client:%s' % t2.per
Hi All,
with IS_IN_DB it possible to display a column of a table in a drop down, say
for example "username". In some occations it is required to display more
than one column (As we use gluon.tools.Auth, we need to display the two
columns "first_name" and "last_name"). Is it possible to do that wit
Okay here it is:
>>>print
>>>JQuery("p").bind("click",JFunction(JQuery("this").slideUp()(),'e','o'))()
$('p').bind("click", function(e, o){$(this).slideUp();});
>>>print JQuery("this").slideUp()()
$(this).slideUp();
class JQuery:
def __init__(self,name,attr=None,*args):
self.name=na
Sorry, just removed the previous post because of an error. It doesn't
account for jQuery function calls like slideUp(). I'll repost once
fixed and rename Function to JFunction.
On Feb 13, 11:13 am, mdipierro wrote:
> I like it. I would call Function JFunction instead.
>
> Massion
>
> On Feb 13
I like it. I would call Function JFunction instead.
Massion
On Feb 13, 11:01 am, "mr.freeze" wrote:
> What about this? '()' at the end of a JQuery statement terminates the
> line (;). Also added a simple Function wrapper class. Treats 'this' as
> a keyword.
>
> Mind you, there is a good chance
I am not sure I understand the details but you can mimic the behaviour
this way:
language_info=str(T('english.xml'))
### the use the web2py internationalization page to translate
english.xml into french.xml, etc. for the languages you support. The
":" here is a just a strick to remind you that t
What about this? '()' at the end of a JQuery statement terminates the
line (;). Also added a simple Function wrapper class. Treats 'this' as
a keyword.
Mind you, there is a good chance that these helpers are more difficult
that just writing jQuery code :)
So this:
print JQuery('#test').click(Fun
Hello mate,
I have a question about the internationalization... In Java using
Struts for example in the JSP file we have something like:
And inside the resource application "resources.application_fr" or
"resources.application_En" we have an entry for index.info so that
when we switch the langua
Can anyone advise? This is the message that appears when running
web2py.exe:
default applications appear to be installed already
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2009
Version 1.56.2 (2009-02-08 21:49:34)
Database drivers available: SQLite3, MySQL
pleas
You have something else running on port 8000.
Try a different port (8001, 8002, etc.)
If it still does not work it could also be a firewall issue.
Massimo
On Feb 13, 10:45 am, Matt wrote:
> Can anyone advise? This is the message that appears when running
> web2py.exe:
>
> default applications
Exmaple of using processing JS with web2py:
http://mdp.cti.depaul.edu/appliances/default/show/46
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to web2
Chris, you manage to package this a little better please let me know.
You could write an alterego entry about it or just post the code
somewhere.
Massimo
On Feb 13, 10:24 am, mdipierro wrote:
> Hi Chris,
>
> no. But it is trivial with web2py.
>
> Here I implemented the example
> inhttp://www.s
Hi Chris,
no. But it is trivial with web2py.
Here I implemented the example in
http://www.sitepoint.com/print/hierarchical-data-database/
db=SQLDB('sqlite://tree.db')
db.define_table('tree',db.Field('title'),db.Field
('left','integer'),db.Field('right','integer'))
db.tree.insert(title='Food',l
On Feb 13, 2:38 pm, Markus Gritsch wrote:
> Better create a file views/default/user.html with the following content:
A little nicer:
http://groups.google.com/group/web2py/msg/63378d6aa3a1f62e
F
--~--~-~--~~~---~--~~
You received this message because you are subsc
With the latest trunk this will work.
On Feb 13, 9:01 am, blackthorne wrote:
> Never mind my first question...
> I see I can do:
> return dict(form = auth.register(next="login"),form2 = auth.login
> (next="index"))
>
> On Feb 13, 2:47 pm, blackthorne wrote:
>
> > Yes thank you but notice 2 diff
Just wondering if anyone has implemented modified preorder tree
traversal (MPTT) functions for Web2Py yet. MPTT is an efficient
approach to organizing hierarchically-related records (e.g., nested
menus, parent/child relationships, etc.) in a database.
I was hoping someone here might've already im
that would not work. I can change tools to make it work.
Massimo
On Feb 13, 9:01 am, blackthorne wrote:
> Never mind my first question...
> I see I can do:
> return dict(form = auth.register(next="login"),form2 = auth.login
> (next="index"))
>
> On Feb 13, 2:47 pm, blackthorne wrote:
>
> > Yes
Never mind my first question...
I see I can do:
return dict(form = auth.register(next="login"),form2 = auth.login
(next="index"))
On Feb 13, 2:47 pm, blackthorne wrote:
> Yes thank you but notice 2 different questions:
> - How can you have both login and register forms in the same page?
> reques
Yes thank you but notice 2 different questions:
- How can you have both login and register forms in the same page?
request.args[0] can never be both...
- If I want to add more fields to the user registration more specific
to the application I want to create... how can I avoid having to
create 2 f
On Fri, Feb 13, 2009 at 3:19 PM, Paul Eden wrote:
>
> Just remove the
>
> onclick="document.location='{{=URL("admin","default","design",args=request.application)}}'">admin
> request
> request{{=BEAUTIFY(request)}}
> session
> session{{=BEAUTIFY(session)}}
> response
> id="response">response{{=B
Thanks for reply:)
On Feb 13, 3:03 pm, mdipierro wrote:
> Not yet.
>
> On Feb 13, 6:59 am, pigmej wrote:
>
> > that's an example table:
> > db.define_table("test",
> > SQLField("test1",'string'),
> > SQLField("test2","string"),
> > )
>
> > Could
On Fri, Feb 13, 2009 at 7:09 AM, annet wrote:
> Another question: when I expose user there are four buttons: admin,
> request, session and response, which when you click on them display
> information I don't wish to expose to the visitor. How do I get rid of
> them and what is their function?
Wh
Hi Sebastian,
Thanks for your reply, I had to read db.py again and again
#
# # then, to expose authentication
# # http:///[app]/default/user/login
# # http:///[app]/default/user/logout
# # http:///[app]/default/
I thought I did that but does not seem to work. Working on it
On Feb 13, 7:19 am, AchipA wrote:
> Would it be possible to update/generate the epydocs only if there is
> actual change or a stable release ? I'm updating from google svn and
> every time see this huge list of epydoc files, which
On Feb 13, 10:45 am, annet wrote:
> Am I right to conclude that Python is T0 web2py is T1, that on top of
> web2py you got T2 and T3
Yes
> and that from web2py version 1.56 the
> authentication, authorization and crud functionality is moved from the
> T2 into tools.py?
yes
> I downloaded web2
Not yet.
On Feb 13, 6:59 am, pigmej wrote:
> that's an example table:
> db.define_table("test",
> SQLField("test1",'string'),
> SQLField("test2","string"),
> )
>
> Could I define default value of "test2" field based on content of
> "test1" field of
At the lowest approximation you just need
from gluon.tools import *
auth=Auth(globals(),db) ### (1)
crud=Crud(globals(),db) ### (2)
in model and
def user(): return dict(form=auth()) ### (1)
def data(): return dict(form=crud()) ### (2)
def download(): return response.download(request,db)
1) exp
My Bad. Please try this. replace the login() function
def login(): return dict(form=t2.login())
with
if t2.logged_in:
cache.ram('client:%s' % t2.person_id, lambda:request.client, 0)
### store client ip in cache
def login():
if request.vars.email:
client=cache.ram('client:%s' %
Would it be possible to update/generate the epydocs only if there is
actual change or a stable release ? I'm updating from google svn and
every time see this huge list of epydoc files, which only have their
generation date modified...
--~--~-~--~~~---~--~~
You recei
yes on both counts; chrome has some really nice features but there are
enough instances such as this that I've gone back to Firefox as my
default browser; sorry I don't know why tests behavior occurs or what
can be done to correct it
On Feb 13, 3:44 am, Markus Gritsch wrote:
> Hi,
>
> when runni
that's an example table:
db.define_table("test",
SQLField("test1",'string'),
SQLField("test2","string"),
)
Could I define default value of "test2" field based on content of
"test1" field of the same record ?
Something like this ( but it doesn't work
This is not a simple task, you can find info on how to use AJAX with
web2py both in the cookbook and in the manual pdf, with lots of
examples. Yield is powerful, but you have to know about generators and
iterators to use it, with setting a small Popen buffer you might get
away without them (althou
Hi Annet,
if you follow the instructions from welcome/models/db.py and you will find
that your app. serves a bunch of URLs.
For example
http:///[app]/default/user/login in my wellcome app is
http://127.0.0.1:8000/wellcome/default/user/login
etc...
Sebastia
Good day.
Thank you for all your responses.
It's seems that i have to AJAX the messages into the browser somehow,
but i have absolutely no idea how.
I am showing you the main template of any automation, maybe you can
understand what i am dealing with here.
# Controller file
def index():
"Chec
that is a good news, so we do not have to patch the CAS app !
Sebastian E. Ovide
On Fri, Feb 13, 2009 at 3:41 AM, Robin B wrote:
>
> > r=db(db.cas_user.id==id).select() #OK
> > r=db(db.cas_user.verification==key).select() #OK
> > r=db(db.cas_user.id==id)(db.cas_user
I went through the web2py manual and the Web Design Patterns and T2
Components PDF. I am happy with the way web2py is being developed,
however, since I am a novice when it comes to Python an web2py, the
implications of the iterations are not always clear to me.
Am I right to conclude that Python
Hi,
when running the [ test ] link in appadmin for an arbitrary
controller, the following page is displayed, and no progress is made:
Testing application "welcome"
Testing controller "default.py"... please wait!
I observe this behavior only in Safari and Chrome. It works fine in
Firefox and I
On Feb 13, 3:34 am, blackthorne wrote:
> How can I generate, in a single page, both login and register forms
> since Auth() seems to generate them according the URL passed?
All you need in the view is:
{{=form}}
I prefix mine with this to make it more user-friendly, which you can
adapt as you l
59 matches
Mail list logo