[web2py] Re: Custom name for uploaded file

2011-11-19 Thread miroslavgojic
Hear is PHP example (to show what is my wish to do): in HTML: html body form action=upload_file.php method=post enctype=multipart/form-data label for=fileFilename:/label input type=file name=file id=file / br / input type=submit name=submit value=Submit / /form /body /html in PHP file

[web2py] Re: Authorization decorators always generate db queries

2011-11-19 Thread Ids
Ok. Will try it monday when I get back to work and have access to a computer with web2py.

[web2py] ImportError: No module named google.appengine.ext

2011-11-19 Thread Constantine Vasil
In my db.py I am importing: from google.appengine.ext import db as google_db But got the following error: ImportError: No module named *google.appengine.ext* I see in gaehandler.py there is *google.appengine.ext:* from *google.appengine.ext* import webapp from

[web2py] Re: Custom name for uploaded file

2011-11-19 Thread miroslavgojic
What I have for now: in view: {{=form}} {{=form_data}} in controller: import cgi def upload(): form = FORM(Upload file:,INPUT(_type='file',_name='myfile'),INPUT(_type='submit',_name='submit',_value='Submit')) if form.accepts(request,session): response.flash = 'form accepted'

[web2py] sqlform.grid and sqlform.smartgrid archived table for record versioning

2011-11-19 Thread 黄祥
hi, is it possible for sqlform.grid and sqlform.smartgrid use the archive table for record versioning? i tried to use the sqlform.grid and sqlform.smartgrid with record versioning but returned an error : AttributeError: 'DIV' object has no attribute 'process' my controller is : def index():

[web2py] Re: Custom name for uploaded file

2011-11-19 Thread Anthony
Sure, you can code all that manually. On Saturday, November 19, 2011 2:53:13 AM UTC-5, miroslavgojic wrote: I reed all in online book about upload and forms... Can I make my upload manually, something like: brows_file - upload_to_some_folder. What is happening after I submit button 'upload'

[web2py] Re: Custom name for uploaded file

2011-11-19 Thread Anthony
On Saturday, November 19, 2011 4:54:03 AM UTC-5, miroslavgojic wrote: What I have for now: in view: {{=form}} {{=form_data}} No need for 'form_data' on the page (your controller doesn't return it anyway). in controller: import cgi def upload(): form = FORM(Upload

[web2py] Create a simple drop down list

2011-11-19 Thread EdgarAllenPoe
Can some one show me what the code would look like to accomplish the following: Create a drop down list for field A that will be populated by field B A.db.t_ab_recipient.f_distribution_name B.db.t_ab_distribution.f_distributionname Any help would be appreciated.

[web2py] Re: forms and validators

2011-11-19 Thread Anthony
Since you won't know the record type until after the form is submitted, it might be best to handle that with an onvalidation function: http://web2py.com/book/default/chapter/07#onvalidation Anthony On Saturday, November 19, 2011 1:14:47 AM UTC-5, Jimmy Stewpot wrote: Hello, I am trying to

Re: [web2py] Eclipse+Pydev+GAE+Debugging

2011-11-19 Thread ~redShadow~
On Fri, 2011-11-18 at 20:02 -0800, Constantine Vasil wrote: Why Eclipse debugger cannot stops at controllers? I guess you have this problem because controllers never get imported, but they are just execfile()'d, so the debugger doesn't even know that code gets executed.. -- Samuele

[web2py] Re: Create a simple drop down list

2011-11-19 Thread Anthony
You could do: db.t_ab_recipient.f_distribution_name.requires = IS_IN_DB(db, 't_ab_distribution.f_distributionname') See http://web2py.com/book/default/chapter/07#Database-Validators. Instead, though, you might want to explicitly link the two tables: db.define_table('t_ab_distribution',

[web2py] Re: Eclipse+Pydev+GAE+Debugging

2011-11-19 Thread Constantine Vasil
controllers never get imported What do you suggest to solve this? I mention when debugger comes to controllers it compiles them and also every time when a view is requested. That is not needed because GAE compiles them before uploading to Google anyway. Are there a way to switch of the

Re: [web2py] ImportError: No module named google.appengine.ext

2011-11-19 Thread Jonathan Lundell
On Nov 19, 2011, at 12:56 AM, Constantine Vasil wrote: In my db.py I am importing: from google.appengine.ext import db as google_db But got the following error: ImportError: No module named google.appengine.ext I see in gaehandler.py there is google.appengine.ext: from

[web2py] Upload in GAE, SQLFORM.factory, multiple tables

2011-11-19 Thread Bruno Rocha
I have One form for multiple tables working very well locally, I can include data and upload images normally on rocket server and sqlite. my model * Field(author, reference auth_user), ** Field(author_nickname, string), **

[web2py] Re: Upload in GAE, SQLFORM.factory, multiple tables

2011-11-19 Thread Bruno Rocha
On Sat, Nov 19, 2011 at 2:02 PM, Bruno Rocha rochacbr...@gmail.com wrote: *if request.env.web2py_runtime_gae: * this was a typo when writing the email, actually is *if **NOT** request.env.web2py_runtime_gae:*

[web2py] Including Virtualfields in SQLFORM.grid

2011-11-19 Thread villas
Hi All, Is there some way of including virtualfields in the grid? It would be very useful. Thanks, David

[web2py] Re: Custom name for uploaded file

2011-11-19 Thread miroslavgojic
No need for 'form_data'. When you upload the file, the field values are stored in request.vars and then transferred into form.vars. The file upload will be in form.vars.myfile, which will already be a cgi.FieldStorage() object. So, form.vars.myfile.file will be the open file object, and

[web2py] Re: Custom name for uploaded file

2011-11-19 Thread Anthony
You might need to access the file before calling form.accepts (first you'll have to check that form.vars.myfile exists). You can also access it via request.vars.myfile (which won't change, even after form.accepts). Anthony On Saturday, November 19, 2011 11:41:02 AM UTC-5, miroslavgojic wrote:

[web2py] Re: Custom name for uploaded file

2011-11-19 Thread miroslavgojic
The error is caused when file is not selected. By default on first run form is empty (file is not selected), and form must wait for selecting and submitting. How access to file before calling form? What that mean? Miroslav On Nov 19, 5:52 pm, Anthony abasta...@gmail.com wrote: You might need

[web2py] Simplifying a SQL statement

2011-11-19 Thread Adrian Edwards
I'm trying to figure out a way to simplify a series of SQL statements. I have the following 2 tables db.define_table('event_users', Field('event', 'reference events'), Field('user_name', 'reference auth_user'), Field('goal', 'double'), Field('last_entry', 'date'),

[web2py] Re: Custom name for uploaded file

2011-11-19 Thread Anthony
You can tell if the function is being called with a form submission by checking for request.vars: if request.vars: print 'this is a form submission' On Saturday, November 19, 2011 12:06:40 PM UTC-5, miroslavgojic wrote: The error is caused when file is not selected. By default on first

[web2py] Re: best way to contact a programmer

2011-11-19 Thread Marin Dodoub
Thanks for all your answers. I have been quite busy these days, so I only answer now. Marin On 18 nov, 17:10, Constantine Vasil thst...@gmail.com wrote: +dlypka * * I am developing web services for already 7 years (SOAP, REST, XML, etc.) using .NET. At this time back in the beginning yes it

[web2py] Modernizr 2

2011-11-19 Thread Carlos
Hi, Should we upgrade to Modernizr 2 ?. http://www.modernizr.com/ Carlos

[web2py] Re: sqlform.grid and sqlform.smartgrid archived table for record versioning

2011-11-19 Thread Massimo Di Pierro
grid = SQLFORM.smartgrid(db.item, user_signature = False, oncreate = auth.archive, onupdate=auth.archive) oncreate may be optional, depending on whether the current record is archived or the previous record. This has not been settled in web2py but will be settled in the next few days. On Nov

[web2py] Re: Modernizr 2

2011-11-19 Thread Massimo Di Pierro
yes. will add later to trunk. On Nov 19, 11:31 am, Carlos carlosgali...@gmail.com wrote: Hi, Should we upgrade to Modernizr 2 ?. http://www.modernizr.com/    Carlos

[web2py] Re: Custom name for uploaded file

2011-11-19 Thread miroslavgojic
Now I have in controller: def upload(): form = FORM(Upload file:,INPUT(_type='file',_name='myfile'),INPUT(_type='submit',_name='submit',_value='Submit')) if request.vars: if form.accepts(request,session): my_file = request.vars.myfile.file my_filename =

[web2py] Re: Eclipse+Pydev+GAE+Debugging

2011-11-19 Thread Nico de Groot
I'm using PyDev (latest) with debugging all the time, putting breakpoints at the controller or inside the controller code just works for me. I'm using Windows 7, Eclipse Helios with Aptana, no problems with earlier Eclipse without Aptana) I just start web2py.py inside Eclipse (right-click,

[web2py] Re: Eclipse+Pydev+GAE+Debugging

2011-11-19 Thread Constantine Vasil
have you tried with GAE?

[web2py] Re: Modernizr 2

2011-11-19 Thread Massimo Di Pierro
done On Nov 19, 11:31 am, Carlos carlosgali...@gmail.com wrote: Hi, Should we upgrade to Modernizr 2 ?. http://www.modernizr.com/    Carlos

Re: [web2py] Re: Custom name for uploaded file

2011-11-19 Thread Miroslav Gojic
Can I get full example for upload function? This is maybe simply but after one day I don'n have any success. - - Miroslav Gojic - - On Sat, Nov 19, 2011 at 19:24, Anthony abasta...@gmail.com wrote: Don't put the form.accepts inside the 'if request.vars' block -- it needs to run even on form

[web2py] web2py Book 3.2 errors

2011-11-19 Thread Justin Heath
FYI. -- Chapter 4: Workflow Error: explained laster in this chapter Correction: explained later in this chapter -- Chapter 4: Accessing the API from Python modules Error: way way for thme

[web2py] Re: Create a simple drop down list

2011-11-19 Thread EdgarAllenPoe
Thanks Anthony, I want to explicitly link the tables as you described above. Do I put this code in in the DB_WIZARD.PY file? If so how would I modify it. Everything I try produces an error on save. Here are the two tables in question. db.define_table('t_ab_distribution',

[web2py] Re: Create a simple drop down list

2011-11-19 Thread Anthony
db.define_table('t_ab_recipient', [snip] change: Field('f_distribution_name', type='string', label=T('Distribution Name')), to: Field('f_distribution', db.t_ab_distribution, label=T('Distribution Name')), Note, your code wouldn't be producing any

Re: [web2py] Re: Custom name for uploaded file

2011-11-19 Thread Anthony
Something like this: def upload(): import os uploadfolder=os.path.join(request.folder, 'uploads') form = SQLFORM.factory( Field('file', 'upload', uploadfolder=uploadfolder), Field('new_name')) if form.process().accepted:

[web2py] header detail transaction form in one page

2011-11-19 Thread 黄祥
hi, did anyone know how to create header detail transaction form in one page and input it on the database? for example that i created in php : === form_input_tr_pr.php === form name=PRForm method=post enctype=multipart/form-data action=input_tr_pr.php table tr td

[web2py] newbie question

2011-11-19 Thread chawk
db.define_table('discussion', Field('comment', 'text')) def comment(): form = SQLFORM(db.discussion, _class='test1') if form.process().accepted: redirect(URL('comment_results')) return dict(form=form) def comment_results(): items =

Re: [web2py] newbie question

2011-11-19 Thread Chris Hawkes
sorry guys i hit enter to soon, disregard this question On Sat, Nov 19, 2011 at 6:33 PM, chawk chrshawke...@gmail.com wrote: db.define_table('discussion', Field('comment', 'text')) def comment(): form = SQLFORM(db.discussion, _class='test1') if form.process().accepted:

[web2py] Re: VCMS 1.1 Released - a simple CMS developed with web2py

2011-11-19 Thread chinakr
New committer Scateu has joined. A new English version by default will coming soon! Thanks for you all guys's encouragement. On Sep 22, 12:03 am, juanduke juan.fu...@gmail.com wrote: +1 for fully english demo. Will be appreciated :)

[web2py] Re: VCMS 1.1 Released - a simple CMS developed with web2py

2011-11-19 Thread Gour
On Sat, 19 Nov 2011 20:16:39 -0800 (PST) chinakr chin...@gmail.com wrote: New committer Scateu has joined. A new English version by default will coming soon! Thanks for you all guys's encouragement. Great news! Does your CMS provide just an app to create web sites or there is some kind of