Re: [web2py] How to upload files programmatically from file system?

2016-03-31 Thread Marko Seppälä
Hi Richard, I was finally able to make this work this way: filename = os.path.join(request.folder,'static/images/files/{}'.format(file[1])) stream = open(filename, 'rb') db.vendor.insert(default_name = vendor[0], logo=stream) When I print the path, there is bo

[web2py] error of mongodb when dealing with list:string

2016-03-31 Thread Yibing Liu
Hello everyone. The databese of my web app is mongodb. I have defined a table as the following db.define_table('stu_jb', Field("zy",label="major",type="list:string",requires=IS_IN_SET(major_lists,multiple=True)), ) But when I add a record to the table I get the following error '

[web2py] Empty strings stored as null in database

2016-03-31 Thread Raul Monares
Hello I just updated to version 2.14.3 and noticed that empty strings are being stored as null in database field. This didn't happened in 2.13.4. Is this the intended behavior ? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: Web2py Edit feature

2016-03-31 Thread Leonel Câmara
It really looks like a permission problem. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Goo

[web2py] Re: Web2py Edit feature

2016-03-31 Thread Vu Pham
I even removed everything in Web2py folder from first computer, and started fresh with everything. That still does not work. It might be something like regedit, or some system flags... On Thursday, March 31, 2016 at 4:11:13 PM UTC-7, Vu Pham wrote: > > No, there is no error. > The strange thing

[web2py] Re: Web2py Edit feature

2016-03-31 Thread Vu Pham
No, there is no error. The strange thing is that I copied what I had and can not edit in this first computer, and pasted them in second computer. And everything is working as normal. I can edit, and do my work as normal. That has to be something preventing me from editing in first environment.

[web2py] Re: Web2py Edit feature

2016-03-31 Thread Leonel Câmara
I don't mean during the launch of web2py, I mean, if you go to the blank edit page you're getting and you go to the browser developer console (usually f12 shows it) do you see errors there in the console tab? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://gi

[web2py] Re: Web2py Edit feature

2016-03-31 Thread Vu Pham
Everything is fine. There is no error when launching Web2py framework. Thanks for your help, Vu On Thursday, March 31, 2016 at 3:21:07 PM UTC-7, Leonel Câmara wrote: > > Do you have any errors in the browser console? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Web2py Edit feature

2016-03-31 Thread Leonel Câmara
Do you have any errors in the browser console? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the

[web2py] Re: Web2py Edit feature

2016-03-31 Thread Vu Pham
All files have read/write permission. And I did not change any permission. ! On Thursday, March 31, 2016 at 3:06:44 PM UTC-7, Leonel Câmara wrote: > > Did you change file permissions? Is it possible web2py does not have > permission to modify the files? > -- Resources: - http://web2py.com - htt

[web2py] Re: Web2py Edit feature

2016-03-31 Thread Leonel Câmara
Did you change file permissions? Is it possible web2py does not have permission to modify the files? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You

[web2py] Re: passing variable from view to next controller after form submit

2016-03-31 Thread villas
Just try an experiment like this... if form.process().accepted: myvars = {'myvar1': 'A', 'myvar2': 'B'} redirect(URL('default', 'nextstep', vars=myvars )) def nextstep(): print request.vars.myvar1, request.vars.myvar2 return myvars On Thursday, 31 March 2016 21:32:31 UTC+1,

[web2py] Re: checkboxes framework7.io and validate

2016-03-31 Thread 'DenesL' via web2py-users
Let me re-phrase the question. Would it be invalid to post the input field name='box1' type='checkbox' as box1[] ? I have been unsuccessfull in replicating a post with box1[] from checkboxes without Framework7 except when the input itself is named box1[]. F7 uses javascript to modify the DOM an

[web2py] Re: passing variable from view to next controller after form submit

2016-03-31 Thread aetagothno
Is it possible for me to do jquery within the controller?? So after form.process().accepted I can hide the div containing the form and show a div which will contain a button that the user can click and this way I will be able to pass the variable from the view into another controller? I've only

[web2py] Re: Web2py Edit feature

2016-03-31 Thread Vu Pham
I did try all browser (IE, Chrome). It has same problem ! On Thursday, March 31, 2016 at 1:03:49 PM UTC-7, Vu Pham wrote: > > Hello, > Can you help me with this problem. > > I had been editing my code without any problem. But lately every time I > click on Edit feature, and it does not go to the

[web2py] Re: Web2py Edit feature

2016-03-31 Thread Vu Pham
On Thursday, March 31, 2016 at 1:03:49 PM UTC-7, Vu Pham wrote: > > Hello, > Can you help me with this problem. > > I had been editing my code without any problem. But lately every time I > click on Edit feature, and it does not go to the Edit screen any more. > Could you tell me why. > attached

[web2py] passing variable from view to next controller after form submit

2016-03-31 Thread aetagothno
I fill an empty array with form values in a single view, how am I able to pass this array into a new view so that I can do what I want with the values in the new controller after the form is submitted? I try doing something like the following within my controller containing the form: if form

[web2py] Re: Why am I not being redirected after the form submission?

2016-03-31 Thread Anthony
On Thursday, March 31, 2016 at 1:03:34 PM UTC-4, Jacob Devin wrote: > > What's the difference between these two and when should we use them? > dpform=SQLFORM(db.info,row.id,fields=['dp'],showid=False).process() > dpform=SQLFORM(db.info,row.id,fields=['dp'],showid=False) > You should typically ca

[web2py] Re: Web2py Edit feature

2016-03-31 Thread Dave S
On Thursday, March 31, 2016 at 1:03:49 PM UTC-7, Vu Pham wrote: > > Hello, > Can you help me with this problem. > > I had been editing my code without any problem. But lately every time I > click on Edit feature, and it does not go to the Edit screen any more. > Could you tell me why. > attached

[web2py] move detect_record_change section under SQLFORM in the book

2016-03-31 Thread 'DenesL' via web2py-users
Suggestion: the detect_record_change section appears under FORM in the book http://web2py.com/books/default/chapter/29/07/forms-and-validators#Detect-record-change but it does *not* work with FORM. Its existence might be missed since there is no mention of it under SQLFORM. Denes -- Resources:

[web2py] Web2py Edit feature

2016-03-31 Thread Vu Pham
Hello, Can you help me with this problem. I had been editing my code without any problem. But lately every time I click on Edit feature, and it does not go to the Edit screen any more. Could you tell me why. attached is the screen when I used Edit button in any application even built-in apps lik

[web2py] CAS provider Logout Issue

2016-03-31 Thread Franz Pietz
Hello, I am using CAS to manage login in my application, with the following structure: MainApp -> Main Application App1 and App2 -> Secondary applications App1 and App2 are configured so that the login is managed by MainApp. For login, everything works fine: - If I login in MainApp,I'm logged

[web2py] Re: Update multiple existing records with the same data from 1 form which is the second form on the page

2016-03-31 Thread Dave S
On Thursday, March 31, 2016 at 8:28:30 AM UTC-7, drew Roberts wrote: > > On Monday, March 21, 2016 at 9:53:36 PM UTC-4, drew Roberts wrote: > >> I have something like this in a controller: >> >> [...] >> > If I put something in the cur_camp field and submit, all rows "selected" >> are updated w

[web2py] Re: How to reload the whole page after form in the .load page (called in current page) accepts the form?

2016-03-31 Thread Leonel Câmara
Regular redirect doesn't work for ajax requests, you need to add client_side=True to those redirects. Example: redirect(URL('default','screen')) Should change to: redirect(URL('default','screen'), client_side=True) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] How to reload the whole page after form in the .load page (called in current page) accepts the form?

2016-03-31 Thread Jacob Devin
Here after default/delformforscreen.load accepts the form default/screen.html should load. How do I do that? It ain't working the way I thought. So I marked comment signs infront of that (see below) . def screen(): row=db(db.info.info_id==auth.user_id).select().first() if row: g

[web2py] Re: Why am I not being redirected after the form submission?

2016-03-31 Thread Jacob Devin
What's the difference between these two and when should we use them? dpform=SQLFORM(db.info,row.id,fields=['dp'],showid=False).process() dpform=SQLFORM(db.info,row.id,fields=['dp'],showid=False) On Thursday, March 31, 2016 at 5:36:01 PM UTC+5:30, Anthony wrote: > > You cannot call .process() twic

Re: [web2py] Re: update crud form

2016-03-31 Thread Richard Vézina
You don't need default for a update form... and as I said you query was wrong... I have big doubt that your auth_user content is not what you think it is... You should look at what your DB contains... Your form may not pass because the value you try to update already not unique too... which would

[web2py] Re: update crud form

2016-03-31 Thread 'Laer Cius' via web2py-users
Well according to the blog that was the proper way to set the form with default from the database but I maybe understood it wrong. I ended up here cos I didn't find how to set up the default with a lambda function. And so far, I always get a "lamba accpets 1 argument error Anyway despite I comme

[web2py] Re: Update multiple existing records with the same data from 1 form which is the second form on the page

2016-03-31 Thread drew Roberts
On Monday, March 21, 2016 at 9:53:36 PM UTC-4, drew Roberts wrote: > I have something like this in a controller: > > > @auth.requires_login() > def list_machines(): > form=crud.create(db.machine) > form1=SQLFORM(db.machine) > machines=db(db.machine.id>0).select(orderby=db.machine.name)

[web2py] Re: How did you implement chat system in your app? How's my idea?

2016-03-31 Thread Ron Chatterjee
Here is the example from long polling from Ricardo. https://github.com/rpedroso/w2pchat/ But I believe its one chat room. Means no matter who logs into the page see the same chat. Not sure if it can be modified to have multiple chat rooms between two users. On Thursday, March 31, 2016 at 2:2

Re: [web2py] How to upload files programmatically from file system?

2016-03-31 Thread Richard Vézina
Should be URL('static','images/files/{*0*}'.format(file[1])) Richard On Thu, Mar 31, 2016 at 6:34 AM, Marko Seppälä wrote: > Hi, > > I want to upload some of the images programmatically from file system, > when initializing the database. Not the actual file though, just normal > upload so that

Re: [web2py] Re: update crud form

2016-03-31 Thread Richard Vézina
Why that for ??? for row in db(db.auth_user.first_name == db.auth_user.first_name).select(): administrator = row.is_manager first_name = row.first_name last_name = row.last_name nickname= row.nickname email = row.email

[web2py] How to upload files programmatically from file system?

2016-03-31 Thread Marko Seppälä
Hi, I want to upload some of the images programmatically from file system, when initializing the database. Not the actual file though, just normal upload so that file stays in file system but it's accessible via database for every user. I tried something like this: db.define_table('image',

[web2py] enable to download any file of any size,

2016-03-31 Thread Narendra Kumar
Hi, I am trying to download static file, from my application. like xyz.xls file kept in folder "myApp/download/" Thanks Narendra -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/l

Re: [web2py] Re: Google App Engine Launcher 1.9.34 breaks web2py?

2016-03-31 Thread Richard Vézina
https://github.com/blog/2131-git-2-8-has-been-released I may be wrong, I think the improvement is in fetch... I thought it was managing clone recursive... Richard On Thu, Mar 31, 2016 at 4:04 AM, Tommi Lahtonen wrote: > > > On Tuesday, March 29, 2016 at 7:48:07 PM UTC+3, Richard wrote: >> >> G

[web2py] Why am I not being redirected after the form submission?

2016-03-31 Thread Anthony
You cannot call .process() twice. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Goo

Re: [web2py] Create links in smartgrid for the child

2016-03-31 Thread Massimiliano
There is a simple way :-) from the code: https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L2914 links(dict): like `{'tablename':[lambda row: A(), ...]}` that will add buttons when table tablename is displayed On Thu, Mar 31, 2016 at 12:18 PM, Massimiliano wrote: > Sorry is a

Re: [web2py] Create links in smartgrid for the child

2016-03-31 Thread Massimiliano
Sorry is a little more complex to get the table name involved. It should be in request.args(1) table = request.args(1).rpartition('.')[0] On Thu, Mar 31, 2016 at 12:10 PM, Massimiliano wrote: > Maybe you can check the table involved and set links option accordingly. > > Something like: > > tab

Re: [web2py] Create links in smartgrid for the child

2016-03-31 Thread Massimiliano
Maybe you can check the table involved and set links option accordingly. Something like: table = request.args(0) or ‘dashboard’ links = [] if table == ‘label_dashboard’: links=[…] grid = SQLFORM.smartgrid(db.dashboard,linked_tables=[‘label_dashboard’], links=links) Not tested On Wed, Mar

[web2py] Why am I not being redirected after the form submission?

2016-03-31 Thread Jacob Devin
def changedp(): row=db(db.info.info_id==auth.user_id).select().first() dpform=SQLFORM(db.info,row.id,fields=['dp'],showid=False).process() if dpform.process().accepted: redirect(URL('default','screen')) return locals() {{extend 'layout.html'}} {{=dpform}} -- Resources: -

Re: [web2py] Re: Google App Engine Launcher 1.9.34 breaks web2py?

2016-03-31 Thread Tommi Lahtonen
On Tuesday, March 29, 2016 at 7:48:07 PM UTC+3, Richard wrote: > > Git 2.8 will solve that... > > what do you mean? I tried with git and it does not work any better than the full src-package. Same error. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://git