[web2py] Web2py: Update table content after submit action

2019-05-25 Thread Cristina Sig



I have a table filled with records from a database. 

Also, I have a button to add a new record. Once I enter all the data for 
the new record and press the submit button, I want to update the content of 
the table without reloading the page (without F5).

I'm struggling to find a solution to this so any suggestions would be 
welcomed.


Database

db.define_table('Student',
Field('name', 'string', label='Name'),
Field('last_Name', 'string', label='Last Name'),
Field('age', 'integer', label='Age'),
Field('nationality', 'string', label='Nationality'),
   )




Controller (Tools.py)

def studentNew():
formStudent=crud.create(db.Student)
if formStudent.accepted:
response.js = '(function($) 
{$("#myModalADD").modal("hide");}(jQuery));'  //hide modal after press submit 
button
response.flash = 'Record added successfully!' //displays message after 
press submit
return dict(formStudent=formStudent)




View


$(document).ready(function(){
   tabla= $('#table').DataTable( {
   'scrollX': true,
   'responsive':true,
   'sRowSelect': "single",
  });


Add New Student


   
   
  Name
  Last Name
  Age
  Nationality
   


{{for student in formListar:}}

{{=student.Student.name}}
{{=student.Student.last_name}}
{{=student.Student.age}}
{{=student.Student.nationality}}

{{pass}}



 //Modal that contains the Add New 
Student Form and Submit button
  

  
   Add New Student
  
   {{=LOAD('Tools','studentNew', ajax=True, 
ajax_trap=True)}}
  
  
Cancel
 
  

  




-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/3dc1794f-9cb4-4e39-8201-3ab9ab04a9ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Web2py Update records only if user is signed in with a different session from previous

2016-10-04 Thread Meinolf
Hi there,

I need to update my table record only if the user is logged in with a 
different session from the previous, but with the code i have, it keeps 
updating when i thought the user still logged in with the same session. 
problem is i can't view the session id which seem to be encrypted, i can't 
tell when its the same and when its not. Did i miss something? below is my 
code:

prev_ses_id = db((db.rates.user_id==auth.user.id) & 
(db.rates.item_id==request.args(0))).select(db.rates.ses_id)

myrow = db((db.rates.user_id==auth.user.id) & 
(db.rates.item_id==request.args(0)) &
  
~(db.rates.ses_id==prev_ses_id)).update(search_term=db.rates.search_term + 
' ' +
  str(request.vars.search_term),interest=db.rates.interest 
+ ' ' +
  (dictionary.synonym(request.vars.search_term)), 
clicks=db.rates.clicks+1)

Will appreciate all the help i can get.
Thanks

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Web2py Update

2016-02-07 Thread Maurice Waka
Hi
I have been using web2py for about 1 yr now. I love it. I recently came 
acros this crazy article about web2py advantages and disadvantages.
My question is that have, these disadvantages been addressed since 6 yrs 
ago in your updates? 
Am working on and app and would love to launch it soon, in web2py and I 
dont want programmers to come and discredit my work.
Here is the 
link: http://ahmedsoliman.com/2010/07/29/the-good-and-bad-about-web2py/
Kind regards

-- 
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 Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py update FROM 2.9.12 TO 2.11.2 - Internal error; Revert to 2.9.12 - Internal Server Error

2015-07-28 Thread Jim S
Just a thought I had   Is this the update where you had to go and get 
pydal and install it separately?  I seem to recall having the same type of 
issue when I upgraded similarly quite some time ago.

-Jim


On Monday, July 27, 2015 at 5:08:21 PM UTC-5, JoeCodeswell wrote:

 Dear Richard and web2py-users,

 Richard, thanks for the responses. I submitted a ticket to webFaction and 
 got them to give me a tar file of their last backup of the web2py folder. 
 So now i can run it the way it was.

 I still have a question. What was wrong with my update instructions? They 
 have worked many many times in the past.

 Here they are again.

 [usr@srvr bin]$  cd /THEPATH/apache2/bin
 [usr@srvr bin]$ ./stop
 [usr@srvr bin]$  cd /THEPATH
 [usr@srvr DIRX]$ rm web2py_src.zip
 [jdor@web396 DIRX]$ wget -q http://www.web2py.com/
 examples/static/web2py_src.zip
 [jdor@web396 DIRX]$ unzip -q web2py_src.zip
 replace web2py/web2py.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
 [jdor@web396 DIRX]$ cd /THEPATH/apache2/bin
 [jdor@web396 bin]$ ./start
 [jdor@web396 bin]$

 Thanks again in advance for any ideas.

 Love and peace,

 Joe


 On Monday, July 27, 2015 at 1:14:30 PM UTC-7, JoeCodeswell wrote:

 Thanks for the response, Richard.

 Would you please delete most of the gory detail in your previous response 
 in p6 as I did. It makes it difficult to load the page.

 In answer to your question, I could not run Welcome when i did the 
 original update AND i cannot run Welcome now.

 Thanks again Richard.

 Love and peace,

 Joe 

 On Monday, July 27, 2015 at 1:05:30 PM UTC-7, Richard wrote:

 It seems that it complain about git not up to date...

 Richard

 On Mon, Jul 27, 2015 at 4:04 PM, Richard Vézina ml.richa...@gmail.com 
 wrote:

 Did the update was succesful?

 Can you run Welcome...

 Your ticket traceback is not really friendly to analyse...

 :)

 Richard

 On Mon, Jul 27, 2015 at 3:59 PM, JoeCodeswell joecod...@gmail.com 
 wrote:


 Dear web2py-users,

 On WebFaction, I just tried TWICE to update web2py stable FROM 2.9.12 TO 
 2.11.2. 

 Here's my scrubbed update commands.

 [usr@srvr bin]$  cd /THEPATH/apache2/bin
 [usr@srvr bin]$ ./stop
 [usr@srvr bin]$  cd /THEPATH
 [usr@srvr DIRX]$ rm web2py_src.zip
 [jdor@web396 DIRX]$ wget -q http://
 www.web2py.com/examples/static/web2py_src.zip
 [jdor@web396 DIRX]$ unzip -q web2py_src.zip
 replace web2py/web2py.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
 [jdor@web396 DIRX]$ cd /THEPATH/apache2/bin
 [jdor@web396 bin]$ ./start
 [jdor@web396 bin]$

 RESULT Internal error Ticket issued: 
 admin/50.131.104.50.2015-07-27.18-04-23.6cbc7a3f-91c9-4f0c-..
 Here's a scrubbed partial listing. 

 (dp1
 S'output'
 p2
 Stype 'exceptions.AttributeError' type object 'DAL' has no attribute 
 'Field'
 p3
 sS'layer'
 p4
 S'/THEPATH/web2py/applications/admin/controllers/default.py'
 p5
 sS'code'
 p6
 S'# -*- coding: utf-8 -*-\n\nEXPERIMENTAL_STUFF = True\nMAXNFILES = 
 1000\n\nif EXPERIMENTAL_STUFF:\nif is_mobile:\nresponse.view = 
 response.view.replace(\'default/\', \'default.mobile/\')\n   
  response.menu = []\n\nimport re\nfrom gluon.admin import *\nfrom 
 gluon.fileutils import abspath, read_file, write_file\nfrom gluon.utils 
 import web2py_uuid\nfrom gluon.tools import Config\nfrom gluon.com 
 filename=filename,\nrealfilename=realfilename,\n   
  filetyp

 ...



-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py update FROM 2.9.12 TO 2.11.2 - Internal error; Revert to 2.9.12 - Internal Server Error

2015-07-28 Thread 黄祥
i think it's about pydal.
e.g. 

   1. 
   
   wget -c http://web2py.com/examples/static/web2py_src.zip
   rm -rf web2py/applications
   rm -rf web2py/deposit
   rm -rf web2py/examples
   rm -rf web2py/extras
   rm -rf web2py/gluon
   rm -rf web2py/handlers
   rm -rf web2py/logs
   rm -rf web2py/scripts
   rm -rf web2py/site-packages
   unzip web2py_src.zip
   replace web2py/web2py.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
   

please backup your app and web2py first, before trying.

best regards,
stifan

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] web2py update FROM 2.9.12 TO 2.11.2 - Internal error; Revert to 2.9.12 - Internal Server Error

2015-07-27 Thread JoeCodeswell
Thanks for the response, Richard.

Would you please delete most of the gory detail in your previous response 
in p6 as I did. It makes it difficult to load the page.

In answer to your question, I could not run Welcome when i did the original 
update AND i cannot run Welcome now.

Thanks again Richard.

Love and peace,

Joe 

On Monday, July 27, 2015 at 1:05:30 PM UTC-7, Richard wrote:

 It seems that it complain about git not up to date...

 Richard

 On Mon, Jul 27, 2015 at 4:04 PM, Richard Vézina ml.richa...@gmail.com 
 javascript: wrote:

 Did the update was succesful?

 Can you run Welcome...

 Your ticket traceback is not really friendly to analyse...

 :)

 Richard

 On Mon, Jul 27, 2015 at 3:59 PM, JoeCodeswell joecod...@gmail.com 
 javascript: wrote:


 Dear web2py-users,

 On WebFaction, I just tried TWICE to update web2py stable FROM 2.9.12 TO 
 2.11.2. 

 Here's my scrubbed update commands.

 [usr@srvr bin]$  cd /THEPATH/apache2/bin
 [usr@srvr bin]$ ./stop
 [usr@srvr bin]$  cd /THEPATH
 [usr@srvr DIRX]$ rm web2py_src.zip
 [jdor@web396 DIRX]$ wget -q http://
 www.web2py.com/examples/static/web2py_src.zip
 [jdor@web396 DIRX]$ unzip -q web2py_src.zip
 replace web2py/web2py.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
 [jdor@web396 DIRX]$ cd /THEPATH/apache2/bin
 [jdor@web396 bin]$ ./start
 [jdor@web396 bin]$

 RESULT Internal error Ticket issued: 
 admin/50.131.104.50.2015-07-27.18-04-23.6cbc7a3f-91c9-4f0c-..
 Here's a scrubbed partial listing. 

 (dp1
 S'output'
 p2
 Stype 'exceptions.AttributeError' type object 'DAL' has no attribute 
 'Field'
 p3
 sS'layer'
 p4
 S'/THEPATH/web2py/applications/admin/controllers/default.py'
 p5
 sS'code'
 p6
 S'# -*- coding: utf-8 -*-\n\nEXPERIMENTAL_STUFF = True\nMAXNFILES = 
 1000\n\nif EXPERIMENTAL_STUFF:\nif is_mobile:\nresponse.view = 
 response.view.replace(\'default/\', \'default.mobile/\')\n   
  response.menu = []\n\nimport re\nfrom gluon.admin import *\nfrom 
 gluon.fileutils import abspath, read_file, write_file\nfrom gluon.utils 
 import web2py_uuid\nfrom gluon.tools import Config\nfrom gluon.compileapp 
 import find_exposed_functions\nfrom glob import glob\nimport shutil\nimport 
 platform\n\ntry:\nimport git\nif git.__version__  \'0.3.1\':\n 
raise ImportError(Your version of git is %s. Upgrade to 0.3.1 or 
 better. % git.__version__)\nhave_git = True\nexcept ImportError, e:\n 
have_git = False\nGIT_MISSING = \'Requires gitpython module, but not 
 installed or incompatible version: %s\' % e\n\nfrom gluon.languages import 
 (read_possible_languages, read_dict, write_dict,\n 
 read_plural_dict, write_plural_dict)\n\n\nif DEMO_MODE and 
 request.function in [\'change_password\', 
 \'pack\',\n\'pack_custom\',\'pack_plugin\', \'upgrade_web2py\', 
 \'uninstall\',\n\'cleanup\', \'compile_app\', \'remove_compiled_app\', 
 \'delete\',\n\'delete_plugin\', \'create_file\', \'upload_file\', 
 \'update_languages\',\n\'reload_routes\', \'git_push\', \'git_pull\', 
 \'install_plugin\']:\nsession.flash = T(\'disabled in demo mode\')\n   
  redirect(URL(\'site\'))\n\nif is_gae and request.function in (\'edit\', 
 \'edit_language\',\n\'edit_plurals\', \'update_languages\', 
 \'create_file\', \'install_plugin\'):\nsession.flash = T(\'disabled in 
 GAE mode\')\nredirect(URL(\'site\'))\n\nif not is_manager() and 
 request.function in [\'change_password\', \'upgrade_web2py\']:\n   
  session.flash = T(\'disabled in multi user mode\')\n   
  redirect(URL(\'site\'))\n\nif FILTER_APPS and request.args(0) and not 
 request.args(0) in FILTER_APPS:\nsession.flash = T(\'disabled in demo 
 mode\')\nredirect(URL(\'site\'))\n\n\nif not session.token:\n   
  session.token = web2py_uuid()\n\n\ndef count_lines(data):\nreturn 
 len([line for line in data.split(\'\\n\') if line.strip() and not 
 line.startswith(\'#\')])\n\n\ndef log_progress(app, mode=\'EDIT\', 
 filename=None, progress=0):\nprogress_file = os.path.join(apath(app, 
 r=request), \'progress.log\')\nnow = str(request.now)[:19]\nif not 
 os.path.exists(progress_file):\nsafe_open(progress_file, 
 \'w\').write(\'[%s] START\\n\' % now)\nif filename:\n   
  safe_open(progress_file, \'a\').write(\n\'[%s] %s %s: %s\\n\' 
 % (now, mode, filename, progress))\n\n\ndef safe_open(a, b):\nif 
 (DEMO_MODE or is_gae) and (\'w\' in b or \'a\' in b):\nclass tmp:\n 
def write(self, data):\npass\ndef 
 close(self):\npass\nreturn tmp()\nreturn 
 open(a, b)\n\n\ndef safe_read(a, b=\'r\'):\nsafe_file = safe_open(a, 
 b)\ntry:\nreturn safe_file.read()\nfinally:\n   
  safe_file.close()\n\n\ndef safe_write(a, value, b=\'w\'):\nsafe_file = 
 safe_open(a, b)\ntry:\nsafe_file.write(value)\nfinally:\n   
  safe_file.close()\n\n\ndef get_app(name=None):\napp = name or 
 

Re: [web2py] web2py update FROM 2.9.12 TO 2.11.2 - Internal error; Revert to 2.9.12 - Internal Server Error

2015-07-27 Thread JoeCodeswell
Dear Richard and web2py-users,

Richard, thanks for the responses. I submitted a ticket to webFaction and 
got them to give me a tar file of their last backup of the web2py folder. 
So now i can run it the way it was.

I still have a question. What was wrong with my update instructions? They 
have worked many many times in the past.

Here they are again.

[usr@srvr bin]$  cd /THEPATH/apache2/bin
[usr@srvr bin]$ ./stop
[usr@srvr bin]$  cd /THEPATH
[usr@srvr DIRX]$ rm web2py_src.zip
[jdor@web396 DIRX]$ wget -q http://www.web2py.com/
examples/static/web2py_src.zip
[jdor@web396 DIRX]$ unzip -q web2py_src.zip
replace web2py/web2py.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
[jdor@web396 DIRX]$ cd /THEPATH/apache2/bin
[jdor@web396 bin]$ ./start
[jdor@web396 bin]$

Thanks again in advance for any ideas.

Love and peace,

Joe


On Monday, July 27, 2015 at 1:14:30 PM UTC-7, JoeCodeswell wrote:

 Thanks for the response, Richard.

 Would you please delete most of the gory detail in your previous response 
 in p6 as I did. It makes it difficult to load the page.

 In answer to your question, I could not run Welcome when i did the 
 original update AND i cannot run Welcome now.

 Thanks again Richard.

 Love and peace,

 Joe 

 On Monday, July 27, 2015 at 1:05:30 PM UTC-7, Richard wrote:

 It seems that it complain about git not up to date...

 Richard

 On Mon, Jul 27, 2015 at 4:04 PM, Richard Vézina ml.richa...@gmail.com 
 wrote:

 Did the update was succesful?

 Can you run Welcome...

 Your ticket traceback is not really friendly to analyse...

 :)

 Richard

 On Mon, Jul 27, 2015 at 3:59 PM, JoeCodeswell joecod...@gmail.com 
 wrote:


 Dear web2py-users,

 On WebFaction, I just tried TWICE to update web2py stable FROM 2.9.12 TO 
 2.11.2. 

 Here's my scrubbed update commands.

 [usr@srvr bin]$  cd /THEPATH/apache2/bin
 [usr@srvr bin]$ ./stop
 [usr@srvr bin]$  cd /THEPATH
 [usr@srvr DIRX]$ rm web2py_src.zip
 [jdor@web396 DIRX]$ wget -q http://
 www.web2py.com/examples/static/web2py_src.zip
 [jdor@web396 DIRX]$ unzip -q web2py_src.zip
 replace web2py/web2py.py? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
 [jdor@web396 DIRX]$ cd /THEPATH/apache2/bin
 [jdor@web396 bin]$ ./start
 [jdor@web396 bin]$

 RESULT Internal error Ticket issued: 
 admin/50.131.104.50.2015-07-27.18-04-23.6cbc7a3f-91c9-4f0c-..
 Here's a scrubbed partial listing. 

 (dp1
 S'output'
 p2
 Stype 'exceptions.AttributeError' type object 'DAL' has no attribute 
 'Field'
 p3
 sS'layer'
 p4
 S'/THEPATH/web2py/applications/admin/controllers/default.py'
 p5
 sS'code'
 p6
 S'# -*- coding: utf-8 -*-\n\nEXPERIMENTAL_STUFF = True\nMAXNFILES = 
 1000\n\nif EXPERIMENTAL_STUFF:\nif is_mobile:\nresponse.view = 
 response.view.replace(\'default/\', \'default.mobile/\')\n   
  response.menu = []\n\nimport re\nfrom gluon.admin import *\nfrom 
 gluon.fileutils import abspath, read_file, write_file\nfrom gluon.utils 
 import web2py_uuid\nfrom gluon.tools import Config\nfrom gluon.com 
 filename=filename,\nrealfilename=realfilename,\n   
  filetyp

 ...



-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] web2py update app admin doesn't work anymore

2015-04-25 Thread BlueShadow
Hi I'm running web2py on ubuntu with nginx after updating to the current 
version my appadmin doesn't work anymore.
this is the error I got directly from the appadmin error folder:
S'output'
p2
Stype 'exceptions.ImportError' No module named pydal.objects
p3
sS'layer'
p4
S'/home/www-data/web2py/applications/admin/controllers/default.py'
p5
sS'code'
p6

thanks for your help

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] web2py update nothing is working anymore

2013-10-01 Thread BlueShadow
Hi
i tried to upgrade the framework after using the experimental upgrading 
button in the admin panel. I couldn't access the admin panel anymore. I got 
an error page which I could not open.
So I copied my application to some place on the server (cp -R ) deleted 
web2py (rm -R) used the nginx install script. Now the admin panel is 
working again. But once I copied my page to the web2py applications folder 
the app isn't working anymore. (unknown error)
I tried to put my app on a locale web2py (windows compiled) copy and it 
doesn't work either. and gives me an error no auth_groups
So I'm pretty much stuck I just used a backup to restore the part where at 
least my page was running but I still don't have any access to the admin 
panel.

-- 
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 Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Web2py Update

2012-03-18 Thread Ovidio Marinho
Check for update web2py 1.99.4 does not work, someone has a solution?




   Ovidio Marinho Falcao Neto
Web Developer
 ovidio...@gmail.com
  ovidiomari...@itjp.net.br
 ITJP - itjp.net.br
   83   8826 9088 - Oi
   83   9334 0266 - Claro
Brasil