[web2py] py4web and webkit
Unable to use _dashboard using webkit by python gi.repository. ** Message: 08:21:43.542: console message: http://localhost:8000/_dashboard/static/js/index.js @5: SyntaxError: Unexpected token '>' -- 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/0186bdac-b321-46fe-a138-986252c21511%40googlegroups.com.
[web2py] GeneratorExit on admin application with mobile
Hello everyone. I'm using pythonanywhere where I uploaded a web2py application. Everything is fine on my pc. But, if you use a tablet Android 4.4 with firefox, I noticed a strange behavior. It all works EXCEPT ADMIN application. I could see in the error pythonanywhere log this warning: 11/10/2016 13: 27: 39.031: Error running WSGI application Traceback (most recent call last): File "/bin/user_wsgi_wrapper.py", line 156, in __call__ yield response GeneratorExit You can suggest something to solve this problem or I must resign myself to not use my tablet to work Tanks -- 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] admin does not work with tablet on pythonanywhere
Goodmorning everyone. I downloaded an application on pythonanywhere. It works both on the tablet and on PC. But if I try to perform admin it works perfectly on PC while on the tablet shows a blank page. You can give me some information about it? -- 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] widget: unexpected error
Hi all! I built a widget that scans the local server file system. I attach the code of the widget. The content of form.vars and request.vars when the form is submitted is inexplicable for me: form = SQLFORM.factory( Field('tree2','string', widget=WDG.field_treeview(startpath=startpath, selectmode='A')), ) *if form.process(keepvalues=True).accepted:* * p*rint 0, form.vars, request.vars Ispecting html form code, the only input tag is this: input id=no_table_tree2 name=tree2 type=text class=string value= style=width:500px; This is the unexpected output: Storage {'id': None} Storage {'_formkey': '86774a01-ab3d-4021-bc7a-838758854aeb', '_formname': 'no_table/create', 'tree2': '/home/x/web2py/web2py/applications/WDG'} web2py 2.3.2 python 2.7 linux mint 14 I don't understand. Can anyone help me? thanks in advance -- --- 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. #---TREEVIEW class field_treeview: def __init__(self, startpath='', width=500, static=True, showmode='A', selectmode='A'): self.startpath = startpath self.width = width self.static = static self.showmode = showmode self.selectmode = selectmode def __call__(self, field, value=''): _id = %s_%s % (field._tablename, field.name) _name = field.name #altrimenti accepts restituisce errori if not field.default: field.default='' html = treeview_input(name=_name, value=value, id=_id, startpath=self.startpath, showmode=self.showmode, selectmode=self.selectmode, width=self.width, border=False, static=self.static) return html def treeview_input(name, value='', id='', startpath='', showmode='A', selectmode='A', width=400, border=False, static=False): if not id: id = name _name = name _id_tree = %s_tree % _name id_divimp = id + '_divimp' id_divtree = id + '_divtree' _value = value or '' winp = input id=%(id)s name=%(name)s type=text class=string value=%(value)s style=width:%(width)spx;/ % dict(id=id, name=_name, value=_value, width=width) wbtn = button class=btn onclick=%(name)s_hide(); return false; style=margin-bottom:10px; Explore/button % dict(name=_name) def action(itemtype, itemname, fullpath): cmd = '' jscmd = $('#%(id)s').val('%(fullpath)s'); %(name)s_show(); return false; % dict(id=id, fullpath=fullpath, name=_name) if selectmode == 'A': cmd = jscmd if itemtype == selectmode: cmd = jscmd return cmd wtree = _treeview(id=_id_tree, startpath=startpath, jsaction=action, showmode=showmode, width=width, border=True, static=static) width += 100 out = [] js = script function %(name)s_hide() { $('#%(id_divimp)s').hide(); $('#%(id_divtree)s').show(); } function %(name)s_show() { $('#%(id_divimp)s').show(); $('#%(id_divtree)s').hide(); } /script % dict(name=_name, id_divimp=id_divimp, id_divtree=id_divtree) out.append(div id=%s % id_divimp) out.append(winp) out.append(nbsp;) out.append(wbtn) out.append(/div) out.append(div id=%s style=display:none;padding:4px;margin-bottom:10px;width:%spx; % ( id_divtree, str(width)) ) out.append(wtree) out.append(/div) out.append(js) html = '\n'.join(out) return XML(html) def treeview(id='', startpath='', showmode='A', selectmode='A', width=400, jsaction=None, border=False, static=False): html = _treeview(id, startpath, showmode, selectmode, width, jsaction, border, static) return XML(html) def _treeview(id='', startpath='', showmode='A', selectmode='A', width=400, jsaction=None, border=False, static=False): action e' una funzione che ritorna una stringa javascript da eseguire al click def action(itemtype, itemname, fullpath) response = current.response response.files.append(URL(c='static/WDG/jquery.treeview',f='jquery.treeview.js')) response.files.append(URL(c='static/WDG/jquery.treeview',f='jquery.treeview.css')) if not startpath: startpath = os.getcwd() fullpath = os.path.abspath(startpath) out = [] strid = '' if id: strid = id=%s % id style = '' if border: style += border:1px solid #BFBFBF; background-color:#EFEFEF;padding:25px;margin-bottom:10px; out.append( div %(strid)s style=%(style)s % dict(strid=strid, style=style))
[web2py] Re: Querying on 1:M Relationships in SQLFORM.grid and SQLFORM.smartgrid
FYI, I did create an issue for this (#979) in google code. Best, Mike L On Monday, November 26, 2012 3:51:52 PM UTC-5, Adi wrote: +1 this would be a great and needed feature... just stumbled into this problem, and working around it :) On Friday, August 31, 2012 5:48:17 PM UTC-4, Massimo Di Pierro wrote: Hello Mike, thanks for your patch? Would you please attach it to a google code issue so we do not forget. We cannot add new feaures until all 2.0.x issues have been resolved. On Friday, August 31, 2012 2:41:30 PM UTC-5, Mike Leone wrote: Hello, We're building a web2py application that leverages SQLFORM.smartgrid heavily. Out of the box, this does not support filtering on 1:M relationships, or reference fields on the model. We understand the concerns about this: It could potentially be a huge performance hit, especially if the related table has a large number of rows. On the other hand, this functionality is very valuable. Being able to filter on related tables is a very common need in applications. Often, users need to filter on lookup tables that have a relatively small number of rows, and the performance hit is negligible. This is a very common feature in Django, and in Rails admin interfaces like ActiveScaffold and RailsAdmin. Example: Given a model like this: db.define_table('book', Field('user_id', 'reference auth_user'), Field('title'), Field('genre')) And a controller like this: def index(): grid = SQLFORM.smartgrid(db.book) return dict(grid=grid) The query interface will look like this by default: http://i49.tinypic.com/2ugjt02.jpg Note how this includes title and genre, but not the auth_user reference. We patched web2py to allow to for 1:M reference fields in the query interface. The resulting interface and generated query look something like this: http://i46.tinypic.com/28taq74.png Here is our simple patch to allow searching on reference fields like this: https://gist.github.com/ff543a5c6d3bc14b9079 This is obviously NOT ready for production; it's a simple proof of concept. Note the potentially very expensive ALL query. Because of the performance risks, something like this only makes sense if developers can opt in, i.e. explicitly say so if they want to include a given reference field in the query interface. 1. Would the web2py maintiners be interested in a feature like this if it is opt-in? I'm willing to devote some time to submit a more robust patch if I could get some guidance. 2. I also have a simple implementation for querying on list:reference fields that I can share as well. Finally, I just want to thank the web2py team. I've really enjoyed using the framework and hope to help out as much as I can. Thanks, Mike Leone Principal, Engineering Panoptic Development, Inc. --
[web2py] Querying on 1:M Relationships in SQLFORM.grid and SQLFORM.smartgrid
Hello, We're building a web2py application that leverages SQLFORM.smartgrid heavily. Out of the box, this does not support filtering on 1:M relationships, or reference fields on the model. We understand the concerns about this: It could potentially be a huge performance hit, especially if the related table has a large number of rows. On the other hand, this functionality is very valuable. Being able to filter on related tables is a very common need in applications. Often, users need to filter on lookup tables that have a relatively small number of rows, and the performance hit is negligible. This is a very common feature in Django, and in Rails admin interfaces like ActiveScaffold and RailsAdmin. Example: Given a model like this: db.define_table('book', Field('user_id', 'reference auth_user'), Field('title'), Field('genre')) And a controller like this: def index(): grid = SQLFORM.smartgrid(db.book) return dict(grid=grid) The query interface will look like this by default: http://i49.tinypic.com/2ugjt02.jpg Note how this includes title and genre, but not the auth_user reference. We patched web2py to allow to for 1:M reference fields in the query interface. The resulting interface and generated query look something like this: http://i46.tinypic.com/28taq74.png Here is our simple patch to allow searching on reference fields like this: https://gist.github.com/ff543a5c6d3bc14b9079 This is obviously NOT ready for production; it's a simple proof of concept. Note the potentially very expensive ALL query. Because of the performance risks, something like this only makes sense if developers can opt in, i.e. explicitly say so if they want to include a given reference field in the query interface. 1. Would the web2py maintiners be interested in a feature like this if it is opt-in? I'm willing to devote some time to submit a more robust patch if I could get some guidance. 2. I also have a simple implementation for querying on list:reference fields that I can share as well. Finally, I just want to thank the web2py team. I've really enjoyed using the framework and hope to help out as much as I can. Thanks, Mike Leone Principal, Engineering Panoptic Development, Inc. --
[web2py] new web2py application
Fine! http://www.globaleaks.org/
[web2py] Re: fluxflex - how to?
Hi, sameone knows how to see server error log informations in fluxflex? I receive internal server errors in uploading a plugin file. Thanks On 27 Ago, 13:39, Ray (a.k.a. Iceberg) iceb...@21cn.com wrote: On Aug 27, 10:03 am, MidGe degreef.mic...@gmail.com wrote: I am trying to use fluxflex but I must be missing something fundamental as I do not understand what is happening when I follow the instructions. First of all, it all seems to be working fine. I can see the site and I can log in admin etc... When I use git to clone the fluxflex install on my machine, it gives me a nearly empty repository! I would expect to get an install similar to the one I get when I unpack web2py on my machine. I cannot see any applications, let alone other files that I may need modify or create, like routes.py. Can someone point out to me where am I supposed to make the changes I may require? Where is the install of web2py located? Should it not be there when I git clone the flexflux instance to my drive? Any help or pointer to a help would be greatly appreciated. I am not the author of web2py-for-fluxflex, but here is my understanding anyway. The web2py-for-fluxflex repo is designed to be nearly empty. It just contains scripts to download latest official web2py stable release. That is it. Nothing more. And this way every user can use this repo, instead of everyong forking his own web2py repo which will soon become out-of-sync. So later we need to use web2py way to do all other jobs, includes but not limited to: 1. upgrade the web2py by clicking upgrade button in web2py's admin app (I guess no one did that yet, at the time of my writing this post) 2. upload/upgrade/deploy individual app, by packing your web2py app into a .w2p file and then upload it. I havn't tried that yet. It might encounter some post-size-limit of fluxflex. We will see. I don't know how to git-pull or hg-pull an individual app, like I did on webfaction. Perhaps that is not possible on fluxflex, unless they provide an ssh shell in the future. Just my 2 cents. Regards, Ray
[web2py] Re: ajax function
I need to use ajax web2py function passing a costant, es.: ajax(url,[ 'namefld1', 'namefld2', 'costant-value'], ':eval') Exploring code I see that I must insert an input tag with desidered value and call it by name. There is a smarter way? Thanks On 5 Apr, 16:06, Ross Peoples ross.peop...@gmail.com wrote: Could you be a little more specific? Are you trying to pass args and vars? Or are you trying to load HTML using AJAX and sending it to a target DIV? If you are using web2py's ajax function, you may be limited to what you can do. Worst case, you can always try calling jQuery's load() method: var url = {{=URL('ajax_view.load', args={'arg1': 'my', 'arg2', 'value'})}}; jQuery('#target').load(url); Or like this: var url = {{=URL('ajax_view.load')}}; jQuery('#target').load(url, {arg1: 'my', arg2, 'value'}); Does this help?
[web2py] ajax function
Hi, sometimes I need to use ajax function passing as second argument a list of ids and costants. There is a way to pass to callback values of elements by id, AND string costants? Thanks for help.
[web2py] sqlite:memory
Hi, have you test 'sqlite:memory' with new DAL? Using db = DAL('sqlite:memory:') (is the syntax correct?) I can insert a new row, but I can't retrieve it when I select the next request. It seems the db is too much volatile... Thanks. leone
[web2py] auth - some help in settings
Hi. I need some help in auth settings: I define auth.settings.controller = 'piripicchio' but I continue to receive error about missing '/default/user' function (I have put user in piripicchio controller). I set auth.settings.mailer = mail auth.settings.registration_requires_verification = True auth.settings.registration_requires_approval = True but I not received any mail. Mail settings are ok (I success using it in others functions) and I authorize myself with my email. And: what means .Approval consists of setting registration_key=='' via appadmin or programmatically as said in book??? Have you a code example? Thanks in advance and happy new year leone
[web2py] Re: auth - some help in settings
Thanks for you help! About auth.settings.controller I see in the browser a page with content: invalid function (default/user) The function exists in piripicchio controller, not in default! It seems that auth.settings.controller doesn't work. Where my mistake? About auth.settings.registration: - OK, now it is clear - but @auth.requires_login() forbids the access until I set profile? Thanks, leone On Dec 30, 1:49 pm, Kaer kaerbu...@gmail.com wrote: On Dec 30, 1:10 pm, leone handja...@gmail.com wrote: Hi. I need some help in auth settings: I define auth.settings.controller = 'piripicchio' but I continue to receive error about missing '/default/user' function (I have put user in piripicchio controller). The trace would be helpful (at least if you accept help from people like me ;-)) I set auth.settings.mailer = mail auth.settings.registration_requires_verification = True auth.settings.registration_requires_approval = True but I not received any mail. Mail settings are ok (I success using it in others functions) and I authorize myself with my email. And: what means .Approval consists of setting registration_key=='' via appadmin or programmatically as said in book??? That means that if you want to approve a profile, you need to put an empty string in its registration_key field (auth_user table) You can do that in appadmin (probably :http://localhost:8000/YOUR_APP/appadmin/select/db?query=db.auth_user.id0) or programmatically with something like : db(db.auth_user.id==1).update(registration_key=) Have you a code example? Thanks in advance and happy new year leone
[web2py] auth.settings.controller doesn't run
Hi all! Happy new year! I have put user func in a controller other than 'default' and i set auth.settings.controller='newcontroller' but web2py continue to call default/user To bypass it I put the newcontroller name in Auth init: auth = Auth(globals(),db,'newcontroller') so it runs, but I have to update auth.settings.logout_next = URL(r=request,c='newcontroller',f='index') etc. Setting auth.settings.controller to 'newcontroller', the value of self.settings.controller in def url of Auth class is always 'default'. Is it ok??? Thanks leone
[web2py] Re: auth.settings.controller doesn't run
I have a second trouble. Using email notification i receive correctly a mail that link me to web2py login telling that an authorization is pending. This at the first click on the link in mail. The second click results instead a 404 NOT FOUND page. This is very confusing, because the user expects informations about pending authorization. Is it correct? I am missing something? On Dec 31, 7:07 am, leone handja...@gmail.com wrote: Hi all! Happy new year! I have put user func in a controller other than 'default' and i set auth.settings.controller='newcontroller' but web2py continue to call default/user To bypass it I put the newcontroller name in Auth init: auth = Auth(globals(),db,'newcontroller') so it runs, but I have to update auth.settings.logout_next = URL(r=request,c='newcontroller',f='index') etc. Setting auth.settings.controller to 'newcontroller', the value of self.settings.controller in def url of Auth class is always 'default'. Is it ok??? Thanks leone
[web2py] Re: redirect using a new window
I need to redirect to a new page (for example as a new tab in chrome). On Nov 25, 4:30 pm, mdipierro mdipie...@cs.depaul.edu wrote: I do not understand what you want to do. On Nov 25, 7:13 am, leone handja...@gmail.com wrote: Thanks for suggest, but I need something redirect(URL(..), _target='new'). I fear that it doesn't exists, though web2py does anything. On Nov 24, 11:19 pm, mdipierro mdipie...@cs.depaul.edu wrote: or a href={{=URL(...)}} target=newclick me/a On Nov 24, 2:47 pm, Michele Comitini michele.comit...@gmail.com wrote: do you mean like this? {{=A('click me!', _href=URL(...), _target='new')}} 2010/11/24 leone handja...@gmail.com: Hi, there is a way to redirect to a new page simulating A , target='new' using URL() or a controller function??? Thanks leone
[web2py] Re: redirect using a new window
The first: A('Open in new window',_href=URL('...'),_target='_blank') .but using redirection. There is a way? On Nov 26, 6:49 pm, mr.freeze nat...@freezable.com wrote: Or do you mean use some javascript in the response to open a new window? On Nov 26, 11:46 am, mr.freeze nat...@freezable.com wrote: Like so?: A('Open in new window',_href=URL('...'),_target='_blank') On Nov 26, 11:42 am, leone handja...@gmail.com wrote: I need to redirect to a new page (for example as a new tab in chrome). On Nov 25, 4:30 pm, mdipierro mdipie...@cs.depaul.edu wrote: I do not understand what you want to do. On Nov 25, 7:13 am, leone handja...@gmail.com wrote: Thanks for suggest, but I need something redirect(URL(..), _target='new'). I fear that it doesn't exists, though web2py does anything. On Nov 24, 11:19 pm, mdipierro mdipie...@cs.depaul.edu wrote: or a href={{=URL(...)}} target=newclick me/a On Nov 24, 2:47 pm, Michele Comitini michele.comit...@gmail.com wrote: do you mean like this? {{=A('click me!', _href=URL(...), _target='new')}} 2010/11/24 leone handja...@gmail.com: Hi, there is a way to redirect to a new page simulating A , target='new' using URL() or a controller function??? Thanks leone
[web2py] Re: redirect using a new window
Thanks for suggest, but I need something redirect(URL(..), _target='new'). I fear that it doesn't exists, though web2py does anything. On Nov 24, 11:19 pm, mdipierro mdipie...@cs.depaul.edu wrote: or a href={{=URL(...)}} target=newclick me/a On Nov 24, 2:47 pm, Michele Comitini michele.comit...@gmail.com wrote: do you mean like this? {{=A('click me!', _href=URL(...), _target='new')}} 2010/11/24 leone handja...@gmail.com: Hi, there is a way to redirect to a new page simulating A , target='new' using URL() or a controller function??? Thanks leone
[web2py] redirect using a new window
Hi, there is a way to redirect to a new page simulating A , target='new' using URL() or a controller function??? Thanks leone
[web2py] cron
Hi, what means WARNING:web2py.cron:WEB2PY CRON: Stale cron.master detected? My crontab: #crontab 1 * * * * root *plugin_CRONTAB/test (ubuntu os, last rel web2py) Thanks in advance
[web2py] Re: cron
Thanks. I discovered an error in script, as probable cause of that warning. I will follow your suggests! leone On Nov 20, 5:12 pm, Jonathan Lundell jlund...@pobox.com wrote: On Nov 20, 2010, at 6:43 AM, mdipierro wrote: Not 100% sure but I think this means that a cron task did not complete or exited abnormally. Right: still running after 60+ seconds. It's a little tricky to distinguish (in real time, anyway) between abnormal exits and long-running cron jobs, though in the former case you're likely to see other messages as well, I think. If you see that message a lot, and you suspect that you might just have a long-running cron job, try scheduling it less frequently (every 5 or 10 minutes, maybe) and see if it goes away. Assuming you're running hardcron, you might also do a ps and see whether you've got a lot of web2py processes running; that would be a bad sign. On Nov 20, 6:04 am, leone handja...@gmail.com wrote: Hi, what means WARNING:web2py.cron:WEB2PY CRON: Stale cron.master detected? My crontab: #crontab 1 * * * * root *plugin_CRONTAB/test (ubuntu os, last rel web2py) Thanks in advance
[web2py] ajax and FieldStorage
Hi all, I am using ubuntu and chrome. When I pass as ajax param the vale of a input['file'] tag I obtain not a FieldStorage object in request.vars.filepath, but the string C: \fakepath\websys.py that isn't the real directory of file How can I get Fieldstorage object with filename and file stream? Thanks in advance. leone
[web2py] ajax and redirect
Hi all, how can I use redirect() inside a ajax callback? Thanks in advance leone
[web2py] web2py Version 1.89.1 bug?
Hi, I have now installed web2py Version 1.89.1. From /admin/default/index it return Internal error Ticket issued: admin/ 127.0.0.1.2010-11-14.10-27-16.28da5829-363a-47d4-8295-814808f71b52 It is impossible to open ticket, that calls another ticket in deadlock loop. (ubuntu os)
[web2py] Re: crud settings
Thanks. I must be more trusted in web2py! On Nov 12, 3:16 pm, mdipierro mdipie...@cs.depaul.edu wrote: crud.settings.update_next = URL(c=request,f='select') should be crud.settings.update_next = URL(r=request,f='select') or crud.settings.update_next = URL('select') On Nov 12, 6:52 am, leone handja...@gmail.com wrote: Hi, peraphs a bias in def mycontroller(): crud.settings.update_next = URL(c=request,f='select') return dict(crud=crud.update(db.balance, request.args(0))) that redirect to: http://.../../Storage%20{'function':%20'update',%20'body':%20cStringIO.StringO%20object %20at%200x9ea60e0,%20'wsgi':%20Storage%20{'start_response':%20function%2 0lambda%20at%200x9f890d4,%20'middleware':%20function%20lambda%20at%20 0x9f8910c,%20'environ':%20{'wsgi.multiprocess':%20False,%20'HTTP_COOKIE':% 20'rootCA= Bye leone
[web2py] Re: ajax and redirect
Thanks, i understand. On Nov 14, 6:24 pm, mdipierro mdipie...@cs.depaul.edu wrote: depends how you make the ajax callback. If you use LOAD() the redirect should work. If you use ajax(...,':eval') you can return document.location='%s' % URL(...) On Nov 14, 3:23 am, leone handja...@gmail.com wrote: Hi all, how can I use redirect() inside a ajax callback? Thanks in advance leone
[web2py] crud settings
Hi, peraphs a bias in def mycontroller(): crud.settings.update_next = URL(c=request,f='select') return dict(crud=crud.update(db.balance, request.args(0))) that redirect to: http://.../../Storage%20{'function':%20'update',%20'body':%20cStringIO.StringO%20object%20at%200x9ea60e0,%20'wsgi':%20Storage%20{'start_response':%20function%20lambda%20at%200x9f890d4,%20'middleware':%20function%20lambda%20at%200x9f8910c,%20'environ':%20{'wsgi.multiprocess':%20False,%20'HTTP_COOKIE':%20'rootCA= Bye leone
[web2py] cas incorrect address in email
Hi, CAS return this incorrect address in email https://mdp.cti.depaul.edu/cas/cas/verify?id=191key=d1c373ab1570cfb9a7dbb53c186b37a2 It must be https://www.web2py.com/cas/cas/verify?id=191key=d1c373ab1570cfb9a7dbb53c186b37a2 What can I do to correct it. There is a CAS application downloadable? Thanks leone
[web2py] httplib2 request
Hi, I use httplib2 to query an url of the running roket server in web2py. This is my simple code: def POST(url, dictdata): h = httplib2.Http() resp, content = h.request(%s % url, 'POST', body=urlencode(dictdata), headers={'content-type':'text/plain'}, ) return resp, content The web2py function return the correct value in content var, but I cannot retrieve posted dictdata values in request.vars, that is empty. Can someone help me? Thanks, leone
[web2py] sqltable behaviour
Hi, I have this code: def something(): ... def mylink(field, type, ref): ... print I am in mylink at row %s % str(field) ... return URL(r=request,f='something') SQLTABLE( rows, linkto=mylink) ... I can see mylink called for every row in rows-set when I load controller function. Is this behaviour correct? I supposed that mylink was called only when I click on row-id. Thanks in advance leone
[web2py] Re: sqltable behaviour
OK. I was confused by epydoc example: def mylink(field, type, ref): return URL(r=request, args=[field]) rows = db.select(db.sometable.ALL) table = SQLTABLE(rows, linkto=mylink) Thanks very much. On 18 Ott, 14:23, mdipierro mdipie...@cs.depaul.edu wrote: This is correct. I think you want this: def mylink(): ... print I am in mylink at row %s % request.args ... return URL(r=request,f='something') def something(): ... SQLTABLE( rows, linkto=URL('mylink')) On Oct 18, 5:13 am, leone handja...@gmail.com wrote: Hi, I have this code: def something(): ... def mylink(field, type, ref): ... print I am in mylink at row %s % str(field) ... return URL(r=request,f='something') SQLTABLE( rows, linkto=mylink) ... I can see mylink called for every row in rows-set when I load controller function. Is this behaviour correct? I supposed that mylink was called only when I click on row-id. Thanks in advance leone
[web2py] CRUD.UPDATE
Why crud.update(..) shows admin, request, session, request and response buttons at bottom page? How can I drop this? Thanks leone
[web2py] crud.update
Solved. I forgot to create the view. Sorry. leone
[web2py] Re: widgets
Thank for your suggest. I am amazed because my code SQLFORM contains two fields, only one with widget that i made. Observing the result html page code there is no evident difference between two fields. Correct id and correct name, but only one exists in form.vars. I thougth that every input tag existing in form becames form.var, but apparently it is false. So, to debug my error, I need know how form.vars are built and where in web2py code. Can you suggest where i can address my attenction? Thanks leone On 13 Giu, 03:44, Iceberg iceb...@21cn.com wrote: On Jun12, 12:47pm, leone handja...@gmail.com wrote: I coded a widget to use with a Field object. Because I need some javascript actions i wrote pure html-javascript code that my widget returns. It runs, but when I accept the form values are in request.vars, but not in form.vars. How can i store values in form.vars without using input widgets defined by SQLFORM.widgets...? Thanks in advance leone You'd better let your widget derive from the default widgets, or you need to make sure yours contain proper _id and _name etc. See alsohttp://web2py.com/book/default/section/7/5?search=widgets
[web2py] Re: widgets
I used your suggest, without success. My code: form = SQLFORM.factory ( Field('test1','string', widget=mywidget, default='...'), Field('test2','string', widget=mywidget, default='...'), ) def mywidget(field, value): _id = '%s_%s' % (field._tablename, field.name) _name = field.name .. lst = _funcxxx(value) script = SCRIPT(..) select = SELECT( lst, _name=_name, _id=_id, _class=field.type, _value=value, _onchange=javascript: getcontent(); ) return DIV(select, script) form.vars --- Storage {'id': 1} after form.accepts values of testx are correctly stored in request.vars Where is my error Thanks On 13 Giu, 04:04, mr.freeze nat...@freezable.com wrote: Here are some examples that may help:http://www.web2pyslices.com/main/default/search?query=7criteria=cate... As Iceberg says, your widget must have the proper attributes to be accepted by form.accepts. I like to render the field using the default widget then modify it. This way I know it has the proper attributes. def my_widget(f,v): inp = SQLFORM.widgets.string.widget(f,v) #or another depending on field scr = SCRIPT('...',_type=''text/javascript') return DIV(inp,scr) On Jun 11, 11:47 pm, leone handja...@gmail.com wrote: I coded a widget to use with a Field object. Because I need some javascript actions i wrote pure html-javascript code that my widget returns. It runs, but when I accept the form values are in request.vars, but not in form.vars. How can i store values in form.vars without using input widgets defined by SQLFORM.widgets...? Thanks in advance leone
[web2py] widgets
I coded a widget to use with a Field object. Because I need some javascript actions i wrote pure html-javascript code that my widget returns. It runs, but when I accept the form values are in request.vars, but not in form.vars. How can i store values in form.vars without using input widgets defined by SQLFORM.widgets...? Thanks in advance leone
[web2py] Re: One click start for local development?
#!/bin/sh cd ./web2py cat /dev/null httpserver.log python web2py.py -a password -i 127.0.0.1 -p 8000 -f /home// web2py leone On 14 Mar, 18:28, Hillman hillma...@gmail.com wrote: Is there a way to start up the local server without needing to use the GUI? Something like: $ python web2py.py --port=8000 --admin- password=password-or-None And then just have it start as if I hit the Start Server button? Thanks. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] DAL connect string
I need to resume the connect string from db object. There is a way? Thanks L -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: DAL connect string
Ops, excuse me: 'resume' is confusing. In a plugin I want to know the connect string of db (only db object is accessible). L On 5 Feb, 15:46, mdipierro mdipie...@cs.depaul.edu wrote: Can you explain? When is the connection droppped? What code? Specifically, are you using pool_size? On Feb 5, 8:20 am, leone handja...@gmail.com wrote: I need to resume the connect string from db object. There is a way? Thanks L -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: plug-in webfolder
Thanks On 30 Gen, 13:37, selecta gr...@delarue-berlin.de wrote: ok i updated the plugin, hope it works now address is stillhttp://jaguar.biologie.hu-berlin.de/~fkrause/web2py.plugin.webfolder.w2p On Jan 30, 10:34 am, selecta gr...@delarue-berlin.de wrote: Field('parent', 'reference plugin_webfolder_files', default=0, requires = IS_IN_DB(db,'plugin_webfolder_files.id','%(name)s')) this is what i used but leone said that with postgres he get IntegrityError: insert or update on table plugin_webfolder_files violates foreign key constraint plugin_webfolder_files_parent_fkey DETAIL: Key (parent)=(0) is not present in table plugin_webfolder_files. in my first answer i did not know why but no i realize this is due to default=0 so the default thing should just be removed On Jan 29, 4:42 pm, mdipierro mdipie...@cs.depaul.edu wrote: I do not understand: Field('parent', 'integer', default=0, requires = IS_IN_DB (db,'plugin_webfolder_files.id','%(name)s')) Why this is interger and not a reference. Why a default value that would not pass validation? Why not this: Field('parent', 'reference plugin_webfolder_files', default=None, requires = IS_EMPTY_OR(IS_IN_DB (db,'plugin_webfolder_files.id','%(name)s'))) On Jan 29, 9:33 am, selecta gr...@delarue-berlin.de wrote: maybe it is also a mistake to state default=0 try with default=None or without the default value On Jan 29, 4:19 pm, selecta gr...@delarue-berlin.de wrote: guess this has something to do with how i define the table i would guess this line does not work Field('parent', 'reference plugin_webfolder_files', default=0, requires = IS_IN_DB(db,'plugin_webfolder_files.id','%(name)s')) you can exchange it with Field('parent', 'integer', default=0, requires = IS_IN_DB (db,'plugin_webfolder_files.id','%(name)s')) a web2py expert should look into this since it should work i guess On Jan 29, 1:48 pm, leone handja...@gmail.com wrote: Using postgres i debug IntegrityError: insert or update on table plugin_webfolder_files violates foreign key constraint plugin_webfolder_files_parent_fkey DETAIL: Key (parent)=(0) is not present in table plugin_webfolder_files. Have you a suggest? On 29 Gen, 10:38, selecta gr...@delarue-berlin.de wrote: Here is a webfolder plug-in. It is still quite raw.http://jaguar.biologie.hu-berlin.de/~fkrause/web2py.plugin.webfolder.w2p Feel free to use and improve it. It depends on an improved IS_IN_SET validator. To use the plug-in you need to replace the constructor of IS_IN_SET (gluon/validators.py) with def __init__( self, theset, labels=None, error_message='value not allowed', multiple=False, zero='', sort=False, ): self.multiple = multiple self.labels = labels if theset and (isinstance(theset[0], list) or isinstance(theset [0], tuple)) and len(theset[0])==2: self.theset = [str(item) for item,label in theset] self.labels = [str(label) for item,label in theset] else: self.theset = [str(item) for item in theset] if isinstance(theset, dict): self.labels = theset.values() self.error_message = error_message self.zero = zero self.sort = sort -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: plug-in webfolder
Using postgres i debug IntegrityError: insert or update on table plugin_webfolder_files violates foreign key constraint plugin_webfolder_files_parent_fkey DETAIL: Key (parent)=(0) is not present in table plugin_webfolder_files. Have you a suggest? On 29 Gen, 10:38, selecta gr...@delarue-berlin.de wrote: Here is a webfolder plug-in. It is still quite raw.http://jaguar.biologie.hu-berlin.de/~fkrause/web2py.plugin.webfolder.w2p Feel free to use and improve it. It depends on an improved IS_IN_SET validator. To use the plug-in you need to replace the constructor of IS_IN_SET (gluon/validators.py) with def __init__( self, theset, labels=None, error_message='value not allowed', multiple=False, zero='', sort=False, ): self.multiple = multiple self.labels = labels if theset and (isinstance(theset[0], list) or isinstance(theset [0], tuple)) and len(theset[0])==2: self.theset = [str(item) for item,label in theset] self.labels = [str(label) for item,label in theset] else: self.theset = [str(item) for item in theset] if isinstance(theset, dict): self.labels = theset.values() self.error_message = error_message self.zero = zero self.sort = sort -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Question about SQLFORM flow
I have a question. In flow SQLFORM, accepts etc. when SQLFORM (and the its field values) is rendered as html script so that is updatable only by javascript functions added to returned code? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Question about SQLFORM flow
Yes. I have to modify some tag attributes generates by SQLFORM after form.accepts, so I suppose i have to use javascript. Thanks On 27 Gen, 16:43, Thadeus Burgess thade...@thadeusb.com wrote: no. its rendered as html, you can style it however you like with css i think thats what you are asking? -Thadeus On Wed, Jan 27, 2010 at 8:27 AM, mdipierro mdipie...@cs.depaul.edu wrote: Please ask again. I do not understand. On Jan 27, 4:54 am, leone handja...@gmail.com wrote: I have a question. In flow SQLFORM, accepts etc. when SQLFORM (and the its field values) is rendered as html script so that is updatable only by javascript functions added to returned code? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.comweb2py%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/web2py?hl=en. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] widgets
Have sameone an example about SQLFORM.widgets.options.widget(...)? I am no able to obtain a select-option widget. Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: update a form field after validation
Sorry. How can I force a value in a field of SQLFORM.factory after its validation? Thanks leone On 22 Gen, 20:03, mdipierro mdipie...@cs.depaul.edu wrote: I still do not understand. I want to know what you try to accomplish, not how you do it. On Jan 22, 12:38 pm, leone handja...@gmail.com wrote: Very simple: IS_AUTONUMBER return an incremental value. It runs well if I use SQLFORM with a db linking the validator to a field before calling SQLFORM, so I view the value in the form. But using SQLFORM.factory I obtain the correct value in form.vars object, but I want to see it on the screen too and I dont' understand how! Probably is very simple, but i have no idea ... Thanks leone On 22 Gen, 18:34, mdipierro mdipie...@cs.depaul.edu wrote: Not sure I understand what this supposed to do. Would you explain it once more. On Jan 22, 10:47 am, leone handja...@gmail.com wrote: I suppose that my error is in setting the new value to field. I am confused. def index(): form = SQLFORM.factory ( Field('autonumber','integer', requires=IS_AUTONUMBER (progfile, 1)), ) def upd_auto(form): form.custom.autonumber = form.vars.autonumber if form.accepts(request.vars, session, keepvalues=True, onvalidation=upd_auto): pass return dict(form=form) Thanks leone On 22 Gen, 17:34, DenesL denes1...@yahoo.ca wrote: Can you post your code? On Jan 22, 11:14 am, leone handja...@gmail.com wrote: I done it, but when I update forms.vars. with the new value it is not update in the form. Have you a suggest? leone On 22 Gen, 17:03, DenesL denes1...@yahoo.ca wrote: If I understand correctly you could use onvalidation. Example: def your_action(): def funcx(): # code that runs after validation ... if form.accepts(..., onvalidation=funcx): ... On Jan 22, 10:51 am, leone handja...@gmail.com wrote: I have a SQLFORM.factory with a Field that requires a custom class to incremet a value. It runs, but I can't understand how I can udate the field value after form.accepts and before form is exposed. Have same example? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] update a form field after validation
I have a SQLFORM.factory with a Field that requires a custom class to incremet a value. It runs, but I can't understand how I can udate the field value after form.accepts and before form is exposed. Have same example? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] update a form field after validation
I have a SQLFORM.factory with a Field that requires a custom class to incremet a value. It runs, but I can't understand how I can udate the field value after form.accepts and before form is exposed. Have same example? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: update a form field after validation
I done it, but when I update forms.vars. with the new value it is not update in the form. Have you a suggest? leone On 22 Gen, 17:03, DenesL denes1...@yahoo.ca wrote: If I understand correctly you could use onvalidation. Example: def your_action(): def funcx(): # code that runs after validation ... if form.accepts(..., onvalidation=funcx): ... On Jan 22, 10:51 am, leone handja...@gmail.com wrote: I have a SQLFORM.factory with a Field that requires a custom class to incremet a value. It runs, but I can't understand how I can udate the field value after form.accepts and before form is exposed. Have same example? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: update a form field after validation
I suppose that my error is in setting the new value to field. I am confused. def index(): form = SQLFORM.factory ( Field('autonumber','integer', requires=IS_AUTONUMBER (progfile, 1)), ) def upd_auto(form): form.custom.autonumber = form.vars.autonumber if form.accepts(request.vars, session, keepvalues=True, onvalidation=upd_auto): pass return dict(form=form) Thanks leone On 22 Gen, 17:34, DenesL denes1...@yahoo.ca wrote: Can you post your code? On Jan 22, 11:14 am, leone handja...@gmail.com wrote: I done it, but when I update forms.vars. with the new value it is not update in the form. Have you a suggest? leone On 22 Gen, 17:03, DenesL denes1...@yahoo.ca wrote: If I understand correctly you could use onvalidation. Example: def your_action(): def funcx(): # code that runs after validation ... if form.accepts(..., onvalidation=funcx): ... On Jan 22, 10:51 am, leone handja...@gmail.com wrote: I have a SQLFORM.factory with a Field that requires a custom class to incremet a value. It runs, but I can't understand how I can udate the field value after form.accepts and before form is exposed. Have same example? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: update a form field after validation
Very simple: IS_AUTONUMBER return an incremental value. It runs well if I use SQLFORM with a db linking the validator to a field before calling SQLFORM, so I view the value in the form. But using SQLFORM.factory I obtain the correct value in form.vars object, but I want to see it on the screen too and I dont' understand how! Probably is very simple, but i have no idea ... Thanks leone On 22 Gen, 18:34, mdipierro mdipie...@cs.depaul.edu wrote: Not sure I understand what this supposed to do. Would you explain it once more. On Jan 22, 10:47 am, leone handja...@gmail.com wrote: I suppose that my error is in setting the new value to field. I am confused. def index(): form = SQLFORM.factory ( Field('autonumber','integer', requires=IS_AUTONUMBER (progfile, 1)), ) def upd_auto(form): form.custom.autonumber = form.vars.autonumber if form.accepts(request.vars, session, keepvalues=True, onvalidation=upd_auto): pass return dict(form=form) Thanks leone On 22 Gen, 17:34, DenesL denes1...@yahoo.ca wrote: Can you post your code? On Jan 22, 11:14 am, leone handja...@gmail.com wrote: I done it, but when I update forms.vars. with the new value it is not update in the form. Have you a suggest? leone On 22 Gen, 17:03, DenesL denes1...@yahoo.ca wrote: If I understand correctly you could use onvalidation. Example: def your_action(): def funcx(): # code that runs after validation ... if form.accepts(..., onvalidation=funcx): ... On Jan 22, 10:51 am, leone handja...@gmail.com wrote: I have a SQLFORM.factory with a Field that requires a custom class to incremet a value. It runs, but I can't understand how I can udate the field value after form.accepts and before form is exposed. Have same example? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] sql replace
Exist db.replace(...) and db.exists(query) functions in datadase layer? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: sql replace
Simply to use sql REPLACE statement. leone On 20 Gen, 16:02, mdipierro mdipie...@cs.depaul.edu wrote: Sorry I do not understand the question. What do you want to do? On Jan 20, 3:49 am, leone handja...@gmail.com wrote: Exist db.replace(...) and db.exists(query) functions in datadase layer? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Troubles with migrate
Several times I receive errors from auth.define_tables() , telling me that relation auth_user already exists. Where is my error? -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Troubles with migrate
Solved with auth.define_tables(migrate=False) On 18 Gen, 10:56, leone handja...@gmail.com wrote: Several times I receive errors from auth.define_tables() , telling me that relation auth_user already exists. Where is my error? -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Troubles with migrate
Thanks On 18 Gen, 16:52, Thadeus Burgess thade...@thadeusb.com wrote: I notice this alot when you delete database tables, and you still have an active authenticated session lying around. So if you delete your database files, make sure to clear sessions as well. -Thadeus On Mon, Jan 18, 2010 at 7:37 AM, leone handja...@gmail.com wrote: Solved with auth.define_tables(migrate=False) On 18 Gen, 10:56, leone handja...@gmail.com wrote: Several times I receive errors from auth.define_tables() , telling me that relation auth_user already exists. Where is my error? -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/web2py?hl=en. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: widget and its form
I am making a widget with more fields that must return a single value when form is submitted. I have two way (I suppose..): to use javascript at the submit event of specific form (I need form id) or/and to put validation code in widget function. The better should be have code to study to discover the web2py way to solution. Thanks leone On 13 Gen, 19:26, mdipierro mdipie...@cs.depaul.edu wrote: How a widget can know the name and id of the form in which it resides? The built-in widgets do not know. You can make your own widget and pass the information to it. What do you have in mind? On Jan 13, 12:13 pm, leone handja...@gmail.com wrote: Is it possible to use javascript function on submit? yes. Look into web2py_ajax.html. It does that. Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: widget and its form
I am trying to build a complex widget that mixes helpers (an INPUT helper) and plain html code that include others input tags used by javascript. It output all by (DIV object).components.extend([...,...]). It is all ok when SQLFORM.factory displays it, but fail when I accept the form: if form.accepts(request.vars, session): File /web2py/web2py/gluon/sqlhtml.py, line 897, in accepts self.vars.id = self.table.insert(**fields) File /web2py/web2py/gluon/sql.py, line 1847, in insert query = self._insert(**fields) File /web2py/web2py/gluon/sql.py, line 1832, in _insert vs.append(sql_represent(value, ft, fd, self._db._db_codec)) File /web2py/web2py/gluon/sql.py, line 497, in sql_represent if fieldtype[0] == 'i': TypeError: 'NoneType' object is unsubscriptable Any idea about my error? On 14 Gen, 09:19, leone handja...@gmail.com wrote: I am making a widget with more fields that must return a single value when form is submitted. I have two way (I suppose..): to use javascript at the submit event of specific form (I need form id) or/and to put validation code in widget function. The better should be have code to study to discover the web2py way to solution. Thanks leone On 13 Gen, 19:26, mdipierro mdipie...@cs.depaul.edu wrote: How a widget can know the name and id of the form in which it resides? The built-in widgets do not know. You can make your own widget and pass the information to it. What do you have in mind? On Jan 13, 12:13 pm, leone handja...@gmail.com wrote: Is it possible to use javascript function on submit? yes. Look into web2py_ajax.html. It does that. Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: widget and its form
Ach! Thanks. Now it runs. leone On 14 Gen, 15:13, mdipierro mdipie...@cs.depaul.edu wrote: You have Field('name',type=None) and this cannot be. On Jan 14, 7:35 am, leone handja...@gmail.com wrote: I am trying to build a complex widget that mixes helpers (an INPUT helper) and plain html code that include others input tags used by javascript. It output all by (DIV object).components.extend([...,...]). It is all ok when SQLFORM.factory displays it, but fail when I accept the form: if form.accepts(request.vars, session): File /web2py/web2py/gluon/sqlhtml.py, line 897, in accepts self.vars.id = self.table.insert(**fields) File /web2py/web2py/gluon/sql.py, line 1847, in insert query = self._insert(**fields) File /web2py/web2py/gluon/sql.py, line 1832, in _insert vs.append(sql_represent(value, ft, fd, self._db._db_codec)) File /web2py/web2py/gluon/sql.py, line 497, in sql_represent if fieldtype[0] == 'i': TypeError: 'NoneType' object is unsubscriptable Any idea about my error? On 14 Gen, 09:19, leone handja...@gmail.com wrote: I am making a widget with more fields that must return a single value when form is submitted. I have two way (I suppose..): to use javascript at the submit event of specific form (I need form id) or/and to put validation code in widget function. The better should be have code to study to discover the web2py way to solution. Thanks leone On 13 Gen, 19:26, mdipierro mdipie...@cs.depaul.edu wrote: How a widget can know the name and id of the form in which it resides? The built-in widgets do not know. You can make your own widget and pass the information to it. What do you have in mind? On Jan 13, 12:13 pm, leone handja...@gmail.com wrote: Is it possible to use javascript function on submit? yes. Look into web2py_ajax.html. It does that. Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] widget and its form
How a widget can know the name and id of the form in which it resides? Is it possible to use javascript function on submit? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] import table
I must import tables from a database manteining the id value of original tables. How can I do? It seems not possible force a value in rowid. Is it possible have more than one autonumber Field (not as rowid) in a table? Thanks leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: import table
Thanks for yours suggests. I have already created a new colum as integer valorized with rowids of old table. But I have to set it with the new value (in progress) when I insert a new row. There is a smart way to do it? leone On 9 Gen, 09:56, Philip Kilner phil.kil...@gmail.com wrote: Hi Leone, leone wrote: I must import tables from a database manteining the id value of original tables. How can I do? It seems not possible force a value in rowid. Let web2py assign the id incrementally, as normal. Treat the imported row_id as a separate column of data, but set it as unique. Is it possible have more than one autonumber Field (not as rowid) in a table? Probably not (the limitation would be at the db level), but in this case you do not need to - the /imported/ row_id will be an autonumber field in the system where it is /generated/, but it has already been generated at the point that you import the data into web2py, so it just needs to be a unique integer in web2py. HTH -- Regards, PhilK Email: p...@xfr.co.uk 'a bell is a cup...until it is struck' -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: import table
I resolved with a new validator IS_AUTONUMBER On 9 Gen, 11:07, leone handja...@gmail.com wrote: Thanks for yours suggests. I have already created a new colum as integer valorized with rowids of old table. But I have to set it with the new value (in progress) when I insert a new row. There is a smart way to do it? leone On 9 Gen, 09:56, Philip Kilner phil.kil...@gmail.com wrote: Hi Leone, leone wrote: I must import tables from a database manteining the id value of original tables. How can I do? It seems not possible force a value in rowid. Let web2py assign the id incrementally, as normal. Treat the imported row_id as a separate column of data, but set it as unique. Is it possible have more than one autonumber Field (not as rowid) in a table? Probably not (the limitation would be at the db level), but in this case you do not need to - the /imported/ row_id will be an autonumber field in the system where it is /generated/, but it has already been generated at the point that you import the data into web2py, so it just needs to be a unique integer in web2py. HTH -- Regards, PhilK Email: p...@xfr.co.uk 'a bell is a cup...until it is struck' -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py:38202] SQLFORM
Good morning. Using SQLFORM I must update a row with defined values that i want push in the input tags programmatically. There is a way? Thanks. leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py:38213] Re: SQLFORM
When SQLFORM is called with record parm valorized, a row is loaded to be updated. I want set the value of a column by code BEFORE submit it so that it is visible in input field. Default doesn't work (it is not a new row...). How can I do? Is it possible? Thanks leone On 2 Gen, 16:37, mdipierro mdipie...@cs.depaul.edu wrote: Sorry, I do not understand. Can you make an example? On Jan 2, 5:44 am, leone handja...@gmail.com wrote: Good morning. Using SQLFORM I must update a row with defined values that i want push in the input tags programmatically. There is a way? Thanks. leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py:38217] Re: SQLFORM
Very simple!!! Thanks. leone On 2 Gen, 17:09, mdipierro mdipie...@cs.depaul.edu wrote: Invece di form=crud.update(table,record_id) Try this: record=table[record_id] record.fieldname = 'newvalue' form=crud.update(table,record) On Jan 2, 9:51 am, leone handja...@gmail.com wrote: When SQLFORM is called with record parm valorized, a row is loaded to be updated. I want set the value of a column by code BEFORE submit it so that it is visible in input field. Default doesn't work (it is not a new row...). How can I do? Is it possible? Thanks leone On 2 Gen, 16:37, mdipierro mdipie...@cs.depaul.edu wrote: Sorry, I do not understand. Can you make an example? On Jan 2, 5:44 am, leone handja...@gmail.com wrote: Good morning. Using SQLFORM I must update a row with defined values that i want push in the input tags programmatically. There is a way? Thanks. leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py:38219] Re: SQLFORM
A suggest for documentation: explicit that record argument can be the rowid or the row object. I had not understud it before. By and new thanks. leone On 2 Gen, 17:48, leone handja...@gmail.com wrote: Very simple!!! Thanks. leone On 2 Gen, 17:09, mdipierro mdipie...@cs.depaul.edu wrote: Invece di form=crud.update(table,record_id) Try this: record=table[record_id] record.fieldname = 'newvalue' form=crud.update(table,record) On Jan 2, 9:51 am, leone handja...@gmail.com wrote: When SQLFORM is called with record parm valorized, a row is loaded to be updated. I want set the value of a column by code BEFORE submit it so that it is visible in input field. Default doesn't work (it is not a new row...). How can I do? Is it possible? Thanks leone On 2 Gen, 16:37, mdipierro mdipie...@cs.depaul.edu wrote: Sorry, I do not understand. Can you make an example? On Jan 2, 5:44 am, leone handja...@gmail.com wrote: Good morning. Using SQLFORM I must update a row with defined values that i want push in the input tags programmatically. There is a way? Thanks. leone -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py:35538] web2py and postgresql
Grrr. I can't uderstand. I have code that runs in sqlite bat non in postgresql. Apparently it is very simple. Where is my error?? db.define_table('secretnum', Field('primocod','string', length=8), Field('secondocod','string', length=5), Field('terzocod','string', length=5), Field('username','string', length=20), Field('attivo','boolean', default=True), ) row = db(db.secretnum.primocod == '12345678').select() Error: File /home/eugenio/web2py/web2py/gluon/sql.py, line 2901, in select rows = response(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 2896, in response db._execute(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 909, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) InternalError: current transaction is aborted, commands ignored until end of transaction block --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35548] Re: web2py and postgresql
Sob, sob... Thanks On 18 Nov, 18:19, annet annet.verm...@gmail.com wrote: I cut and paste your code in a db.py and the default.py index function and it ran without problem. I work on a Mac and use Postgres Plus 8.3 and Web2py 1.72.3 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@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35549] Re: web2py and postgresql
Strange, very strange. The code runs in db.py module but not in plugin_secretnum.py module in models. Have you notice about plugin problem? On 18 Nov, 18:19, annet annet.verm...@gmail.com wrote: I cut and paste your code in a db.py and the default.py index function and it ran without problem. I work on a Mac and use Postgres Plus 8.3 and Web2py 1.72.3 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@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35562] Re: web2py and postgresql
If I put DAL and table definition in db.py all is Ok and sql.log report: CREATE TABLE secretnum( id SERIAL PRIMARY KEY, primocod VARCHAR(8), secondocod VARCHAR(5), terzocod VARCHAR(5), username VARCHAR(20), attivo CHAR(1) ); success! If I put DAL and table definition in plugin_secretnum.py in models I have error: row = db(db.secretnum.primocod == primocod).select() File /home/eugenio/web2py/web2py/gluon/sql.py, line 2901, in select rows = response(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 2896, in response db._execute(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 909, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) InternalError: current transaction is aborted, commands ignored until end of transaction block ...and sql.log have no new message. On 18 Nov, 21:01, mdipierro mdipie...@cs.depaul.edu wrote: what is in sql.log? On Nov 18, 10:54 am, leone handja...@gmail.com wrote: Grrr. I can't uderstand. I have code that runs in sqlite bat non in postgresql. Apparently it is very simple. Where is my error?? db.define_table('secretnum', Field('primocod','string', length=8), Field('secondocod','string', length=5), Field('terzocod','string', length=5), Field('username','string', length=20), Field('attivo','boolean', default=True), ) row = db(db.secretnum.primocod == '12345678').select() Error: File /home/eugenio/web2py/web2py/gluon/sql.py, line 2901, in select rows = response(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 2896, in response db._execute(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 909, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) InternalError: current transaction is aborted, commands ignored until end of transaction block --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35564] Re: web2py and postgresql
Peraphs I found the piece of code that creates the problem. After table definition I have: try: db.executesql(CREATE UNIQUE INDEX indexO ON secretnum (primocod);) except: pass if I comment these rows all runs, even if DAL and table definition is in plugin_secretnum.py On 18 Nov, 21:11, leone handja...@gmail.com wrote: If I put DAL and table definition in db.py all is Ok and sql.log report: CREATE TABLE secretnum( id SERIAL PRIMARY KEY, primocod VARCHAR(8), secondocod VARCHAR(5), terzocod VARCHAR(5), username VARCHAR(20), attivo CHAR(1) ); success! If I put DAL and table definition in plugin_secretnum.py in models I have error: row = db(db.secretnum.primocod == primocod).select() File /home/eugenio/web2py/web2py/gluon/sql.py, line 2901, in select rows = response(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 2896, in response db._execute(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 909, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) InternalError: current transaction is aborted, commands ignored until end of transaction block ...and sql.log have no new message. On 18 Nov, 21:01, mdipierro mdipie...@cs.depaul.edu wrote: what is in sql.log? On Nov 18, 10:54 am, leone handja...@gmail.com wrote: Grrr. I can't uderstand. I have code that runs in sqlite bat non in postgresql. Apparently it is very simple. Where is my error?? db.define_table('secretnum', Field('primocod','string', length=8), Field('secondocod','string', length=5), Field('terzocod','string', length=5), Field('username','string', length=20), Field('attivo','boolean', default=True), ) row = db(db.secretnum.primocod == '12345678').select() Error: File /home/eugenio/web2py/web2py/gluon/sql.py, line 2901, in select rows = response(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 2896, in response db._execute(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 909, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) InternalError: current transaction is aborted, commands ignored until end of transaction block --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35572] Re: web2py and postgresql
Yes, I understand. Thanks On 18 Nov, 21:11, leone handja...@gmail.com wrote: If I put DAL and table definition in db.py all is Ok and sql.log report: CREATE TABLE secretnum( id SERIAL PRIMARY KEY, primocod VARCHAR(8), secondocod VARCHAR(5), terzocod VARCHAR(5), username VARCHAR(20), attivo CHAR(1) ); success! If I put DAL and table definition in plugin_secretnum.py in models I have error: row = db(db.secretnum.primocod == primocod).select() File /home/eugenio/web2py/web2py/gluon/sql.py, line 2901, in select rows = response(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 2896, in response db._execute(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 909, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) InternalError: current transaction is aborted, commands ignored until end of transaction block ...and sql.log have no new message. On 18 Nov, 21:01, mdipierro mdipie...@cs.depaul.edu wrote: what is in sql.log? On Nov 18, 10:54 am, leone handja...@gmail.com wrote: Grrr. I can't uderstand. I have code that runs in sqlite bat non in postgresql. Apparently it is very simple. Where is my error?? db.define_table('secretnum', Field('primocod','string', length=8), Field('secondocod','string', length=5), Field('terzocod','string', length=5), Field('username','string', length=20), Field('attivo','boolean', default=True), ) row = db(db.secretnum.primocod == '12345678').select() Error: File /home/eugenio/web2py/web2py/gluon/sql.py, line 2901, in select rows = response(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 2896, in response db._execute(query) File /home/eugenio/web2py/web2py/gluon/sql.py, line 909, in lambda self._execute = lambda *a, **b: self._cursor.execute(*a, **b) InternalError: current transaction is aborted, commands ignored until end of transaction block --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35481] plugins
I try to understand and build a plugin. I have a silly question: how can I compress the code in a package?? Thanks. --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35399] plugin
There is a developer-manual to build plugins? --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35328] CRUD
I have no success to customize submit button in crud_create and crud_update. I can't redirect crud_update too. Where is my error? My code: def add(): form = crud.create(db.address, message='Row added') crud.settings.keepvalues = True crud.messages.submit_button = 'Add' return dict(form=form) def update(): form = crud.update(db.address, request.args[0], message='Row updated') crud.messages.submit_button = 'Update/Delete' crud.settings.update_next = URL(r=request, c='default', f='index') return dict(form=form) --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35330] Re: CRUD
Thanks. There is no mention in manual. By On 14 Nov, 11:56, mr.freeze nat...@freezable.com wrote: You need to set your crud settings before calling the crud functions: def add(): crud.settings.keepvalues = True crud.messages.submit_button = 'Add' form = crud.create(db.things, message='Row added') return dict(form=form) def update(): crud.messages.submit_button = 'Update/Delete' crud.settings.update_next = URL(r=request, c='default', f='index') form = crud.update(db.address, request.args[0], message='Row updated') return dict(form=form) On Nov 14, 3:40 am, leone handja...@gmail.com wrote: I have no success to customize submit button in crud_create and crud_update. I can't redirect crud_update too. Where is my error? My code: def add(): form = crud.create(db.address, message='Row added') crud.settings.keepvalues = True crud.messages.submit_button = 'Add' return dict(form=form) def update(): form = crud.update(db.address, request.args[0], message='Row updated') crud.messages.submit_button = 'Update/Delete' crud.settings.update_next = URL(r=request, c='default', f='index') return dict(form=form) --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35338] Re: CRUD
no effect...neither session.flash='' or message = '' On 14 Nov, 12:52, Iceberg iceb...@21cn.com wrote: Use session.flash instead. On Nov14, 7:06pm, leone handja...@gmail.com wrote: Ooops... It runs but .update_next interferes with message in response.flash and redirect *before* the drop_down message. There is a way to redirect *after* notification of response.flash? Thanks in advance. On 14 Nov, 11:56, mr.freeze nat...@freezable.com wrote: You need to set your crud settings before calling the crud functions: def add(): crud.settings.keepvalues = True crud.messages.submit_button = 'Add' form = crud.create(db.things, message='Row added') return dict(form=form) def update(): crud.messages.submit_button = 'Update/Delete' crud.settings.update_next = URL(r=request, c='default', f='index') form = crud.update(db.address, request.args[0], message='Row updated') return dict(form=form) On Nov 14, 3:40 am, leone handja...@gmail.com wrote: I have no success to customize submit button in crud_create and crud_update. I can't redirect crud_update too. Where is my error? My code: def add(): form = crud.create(db.address, message='Row added') crud.settings.keepvalues = True crud.messages.submit_button = 'Add' return dict(form=form) def update(): form = crud.update(db.address, request.args[0], message='Row updated') crud.messages.submit_button = 'Update/Delete' crud.settings.update_next = URL(r=request, c='default', f='index') return dict(form=form) --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35339] Re: CRUD
On crud.select function, id link is disabled if you specify field names: fields=['id','aaa','bbb'...] Is it correct? On 14 Nov, 11:56, mr.freeze nat...@freezable.com wrote: You need to set your crud settings before calling the crud functions: def add(): crud.settings.keepvalues = True crud.messages.submit_button = 'Add' form = crud.create(db.things, message='Row added') return dict(form=form) def update(): crud.messages.submit_button = 'Update/Delete' crud.settings.update_next = URL(r=request, c='default', f='index') form = crud.update(db.address, request.args[0], message='Row updated') return dict(form=form) On Nov 14, 3:40 am, leone handja...@gmail.com wrote: I have no success to customize submit button in crud_create and crud_update. I can't redirect crud_update too. Where is my error? My code: def add(): form = crud.create(db.address, message='Row added') crud.settings.keepvalues = True crud.messages.submit_button = 'Add' return dict(form=form) def update(): form = crud.update(db.address, request.args[0], message='Row updated') crud.messages.submit_button = 'Update/Delete' crud.settings.update_next = URL(r=request, c='default', f='index') return dict(form=form) --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:34896] SQLTABLE
Where can I find documentation about SQLTABLE? --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:33582] A newbie question
I can't understand as web2py renders input text='file' name='pippo'... in request object. request.var.pippo is filename; where is fileobject? Somewhere your manual has the answer, but I have no success to find it. Thanks PS. I learn very much reading plugin approach --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:33592] Re: A newbie question
Yes, and I expect request.vars.pippo.filename, request.vars.pippo.file and request.vars.pippo.value but I have only request.vars.pippo as filename string. I tought my error code, but the content of request.vars.pippo is strange in case of error. But if you are sure this is my trouble. What have I done? Thanks On 24 Ott, 17:24, mdipierro mdipie...@cs.depaul.edu wrote: request.vars.pippo would be a cgi.FieldStorage object: http://docs.python.org/library/cgi.html On Oct 24, 10:20 am, leone handja...@gmail.com wrote: I can't understand as web2py renders input text='file' name='pippo'... in request object. request.var.pippo is filename; where is fileobject? Somewhere your manual has the answer, but I have no success to find it. Thanks PS. I learn very much reading plugin approach --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:33606] Re: A newbie question
Dear Massimo, I write a view: form action='' method='post' input type='file' name='filepath' input type='submit' /form and a controller def provafile(): if request.vars.filepath: print 0, request.vars.filepath.getvalue('filename') return dict() but error raise: request.vars.filepath is a str object, not FieldStorage Where my error? On 24 Ott, 17:24, mdipierro mdipie...@cs.depaul.edu wrote: request.vars.pippo would be a cgi.FieldStorage object: http://docs.python.org/library/cgi.html On Oct 24, 10:20 am, leone handja...@gmail.com wrote: I can't understand as web2py renders input text='file' name='pippo'... in request object. request.var.pippo is filename; where is fileobject? Somewhere your manual has the answer, but I have no success to find it. Thanks PS. I learn very much reading plugin approach --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:33618] Re: A newbie question
I have no words. On 24 Ott, 20:24, mdipierro mdipie...@cs.depaul.edu wrote: haha, the form tag is missing form enctype=multipart/form-data On Oct 24, 1:14 pm, leone handja...@gmail.com wrote: Dear Massimo, I write a view: form action='' method='post' input type='file' name='filepath' input type='submit' /form and a controller def provafile(): if request.vars.filepath: print 0, request.vars.filepath.getvalue('filename') return dict() but error raise: request.vars.filepath is a str object, not FieldStorage Where my error? On 24 Ott, 17:24, mdipierro mdipie...@cs.depaul.edu wrote: request.vars.pippo would be a cgi.FieldStorage object: http://docs.python.org/library/cgi.html On Oct 24, 10:20 am, leone handja...@gmail.com wrote: I can't understand as web2py renders input text='file' name='pippo'... in request object. request.var.pippo is filename; where is fileobject? Somewhere your manual has the answer, but I have no success to find it. Thanks PS. I learn very much reading plugin approach --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32996] import module from modules
I try to import a module of py files (initialized by __init__.py) and that is set in applications/myapp/modules folder, but I receive errors about import. from applications/myapp/modules/mymodule import * fails! Is it possible this approach or I have to put py files directly under / modules directory? If not, why? Thanks --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:33026] Re: import module from modules
Yes I know. I use it to import single module. I receive errors when I try to import applications.myapp.modules.widgets.pippo as pippo where widgets is a directory ( with __init__.py) located in myapp/ modules and contain pippo.py. I can import only modules as files under /modules? leone On 16 Ott, 15:37, mdipierro mdipie...@cs.depaul.edu wrote: If you module is a file applications/mypp/modules/mymodule.py then you should be able to import is with from applications.myapp.modules.mymodule import * or exec('from applications.%s.modules.mymodule import *' % request.application) It is important that the module itself imports other files from the same module using relative paths and not absolute paths. Massimo On Oct 16, 5:37 am, leone handja...@gmail.com wrote: I try to import a module of py files (initialized by __init__.py) and that is set in applications/myapp/modules folder, but I receive errors about import. from applications/myapp/modules/mymodule import * fails! Is it possible this approach or I have to put py files directly under / modules directory? If not, why? Thanks --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:33033] Re: import module from modules
Thanks leone On 16 Ott, 22:05, mdipierro mdipie...@cs.depaul.edu wrote: No this should work. I do it all the time. There must a bypo somewhere On Oct 16, 2:15 pm, leone handja...@gmail.com wrote: Yes I know. I use it to import single module. I receive errors when I try to import applications.myapp.modules.widgets.pippo as pippo where widgets is a directory ( with __init__.py) located in myapp/ modules and contain pippo.py. I can import only modules as files under /modules? leone On 16 Ott, 15:37, mdipierro mdipie...@cs.depaul.edu wrote: If you module is a file applications/mypp/modules/mymodule.py then you should be able to import is with from applications.myapp.modules.mymodule import * or exec('from applications.%s.modules.mymodule import *' % request.application) It is important that the module itself imports other files from the same module using relative paths and not absolute paths. Massimo On Oct 16, 5:37 am, leone handja...@gmail.com wrote: I try to import a module of py files (initialized by __init__.py) and that is set in applications/myapp/modules folder, but I receive errors about import. from applications/myapp/modules/mymodule import * fails! Is it possible this approach or I have to put py files directly under / modules directory? If not, why? Thanks --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32654] Re: SELECT - UTF-8 errors
Yes, I have added .encode('utf8') to my default Field('subject','text', default=u''.encode('utf8')), On 11 Ott, 01:53, Iceberg iceb...@21cn.com wrote: On Oct11, 3:42am, leone handja...@gmail.com wrote: I have same string inserted in a table. When I select them, I debug this error: File /xx/xx/web2py/web2py/gluon/sql.py, line 2235, in response return self._db._cursor.fetchall() OperationalError: Could not decode to UTF-8 column 'subject' with text 'x i xxx' This is a problem of sql.py module. What can I do? Thanks Did you ever try searching utf8 in this group or in google? That is very likely a common utf8 issue. See this. http://groups.google.com/group/web2py/browse_frm/thread/e9bc715d7d10458a --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32634] SELECT - UTF-8 errors
I have same string inserted in a table. When I select them, I debug this error: File /xx/xx/web2py/web2py/gluon/sql.py, line 2235, in response return self._db._cursor.fetchall() OperationalError: Could not decode to UTF-8 column 'subject' with text 'x � i�xxx' This is a problem of sql.py module. What can I do? Thanks --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32536] Re: SQLFORM
does't work the #mytable_myfield solution, and I can't understand why! (no web2py_ajax.html in code) On 9 Ott, 07:15, mr.freeze nat...@freezable.com wrote: Try using the class: input.string { width: 450px; } or if you don't want to affect all input.string: #mytable_myfield{ width: 450px; } or go crazy... db.define_table('mytable',Field('myfield','string')) db.mytable.myfield.widget = lambda f,v: INPUT(_type=text, _value=v, _class=crazy_input,_name=myfield,_id=mytable_myfield, _size=100) On Oct 8, 11:40 pm, leone handja...@gmail.com wrote: I know, but no effect. Strange. Do you know if SQLFORM's argument onvalidation is executed before inserting row? On 8 Ott, 22:51, Thadeus Burgess thade...@thadeusb.com wrote: leone, To change the size in css you have to use the width property, there is no size property in css. input #table_field { width: 350px; } -Thadeus On Thu, Oct 8, 2009 at 3:07 PM, leone handja...@gmail.com wrote: Second question solved. About input length css has no effect. SQLFORM(onvalidation is executed before or after inserting row? On 8 Ott, 17:23, Thadeus Burgess thade...@thadeusb.com wrote: massimo, On my machine locally, web2py_ajax.html seems to overwrite any length settings put into css.. The jQuery commands that change the length need to be either commented out or removed. -Thadeus On Thu, Oct 8, 2009 at 8:07 AM, mdipierro mdipie...@cs.depaul.edu wrote: You should set it using css. For a table table and a field field the id of the input field is #table_field you should be able to do something like this in the page style input #table_field { size: 5 } /style On Oct 8, 8:01 am, leone handja...@gmail.com wrote: Two questions: 1) how can I set the length of an html input field generated by SQLFORM? They have all the same size. 2) It needs same commit() using SQLite? My submits seem to generate no rows. No need for commit. Do you have form.accepts(...)? Hard to tell the problem without looking at the action. Thanks in advance. --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32546] SQLFORM onvalidate
I have questions about SQLFORM onvalidate. Before inserting a row I have to resize an image by PIL and push b64encoded bytes on a blob field. So I have defined onvalidate=DoSomething in SQLFORM. DoSomething has form as input arg, resize image as thumbnails, encode it and push in form.vars.myblob (or db.mytable.myblob???). The new record is OK, but blob field is empty. Can someone orient me? --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32547] Re: SQLFORM
Solved. My error is a space between input and #mytable_myfield in css definition. The css approach is effective and elegant. On 9 Ott, 08:50, Iceberg iceb...@21cn.com wrote: The crazy need not be that crazy. I normally do: db.Field('myfield','string', widget=lambda field,value,**kwargs: StringWidget.widget(field,value,_size=40,**kwargs) so that the output field has a size=40 setting. css should also work. Just make sure your definition appear in right place so that it won't be override by default setting. On Oct9, 1:15pm, mr.freeze nat...@freezable.com wrote: Try using the class: input.string { width: 450px; } or if you don't want to affect all input.string: #mytable_myfield{ width: 450px; } or go crazy... db.define_table('mytable',Field('myfield','string')) db.mytable.myfield.widget = lambda f,v: INPUT(_type=text, _value=v, _class=crazy_input,_name=myfield,_id=mytable_myfield, _size=100) On Oct 8, 11:40 pm, leone handja...@gmail.com wrote: I know, but no effect. Strange. Do you know if SQLFORM's argument onvalidation is executed before inserting row? On 8 Ott, 22:51, Thadeus Burgess thade...@thadeusb.com wrote: leone, To change the size in css you have to use the width property, there is no size property in css. input #table_field { width: 350px; } -Thadeus On Thu, Oct 8, 2009 at 3:07 PM, leone handja...@gmail.com wrote: Second question solved. About input length css has no effect. SQLFORM(onvalidation is executed before or after inserting row? On 8 Ott, 17:23, Thadeus Burgess thade...@thadeusb.com wrote: massimo, On my machine locally, web2py_ajax.html seems to overwrite any length settings put into css.. The jQuery commands that change the length need to be either commented out or removed. -Thadeus On Thu, Oct 8, 2009 at 8:07 AM, mdipierro mdipie...@cs.depaul.edu wrote: You should set it using css. For a table table and a field field the id of the input field is #table_field you should be able to do something like this in the page style input #table_field { size: 5 } /style On Oct 8, 8:01 am, leone handja...@gmail.com wrote: Two questions: 1) how can I set the length of an html input field generated by SQLFORM? They have all the same size. 2) It needs same commit() using SQLite? My submits seem to generate no rows. No need for commit. Do you have form.accepts(...)? Hard to tell the problem without looking at the action. Thanks in advance. --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32548] Re: SQLFORM onvalidate
excuse me: onvalidation not onvalidate. On 9 Ott, 14:20, leone handja...@gmail.com wrote: I have questions about SQLFORM onvalidate. Before inserting a row I have to resize an image by PIL and push b64encoded bytes on a blob field. So I have defined onvalidate=DoSomething in SQLFORM. DoSomething has form as input arg, resize image as thumbnails, encode it and push in form.vars.myblob (or db.mytable.myblob???). The new record is OK, but blob field is empty. Can someone orient me? --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32556] Re: SQLFORM onvalidate
Solved: if form.accepts(request.vars, session, keepvalues=True, onvalidation=WriteThumb): . def WriteThumb(form): i = cStringIO.StringIO() o = cStringIO.StringIO() i.write(form.vars.imgfile.value) i.seek(0) im = Image.open(i, 'r') im.thumbnail((100,100),Image.ANTIALIAS) im.save(o,'jpeg') form.vars.thumbnail = base64.b64encode(o.getvalue()) o.close() i.close() img src=data:image/jpeg;base64,{{=row['thumbnail']}} alt=Thumbnail photo / On 9 Ott, 14:48, leone handja...@gmail.com wrote: excuse me: onvalidation not onvalidate. On 9 Ott, 14:20, leone handja...@gmail.com wrote: I have questions about SQLFORM onvalidate. Before inserting a row I have to resize an image by PIL and push b64encoded bytes on a blob field. So I have defined onvalidate=DoSomething in SQLFORM. DoSomething has form as input arg, resize image as thumbnails, encode it and push in form.vars.myblob (or db.mytable.myblob???). The new record is OK, but blob field is empty. Can someone orient me? --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32557] Re: SQLFORM onvalidate
I forget: from PIL import Image On 9 Ott, 15:49, leone handja...@gmail.com wrote: Solved: if form.accepts(request.vars, session, keepvalues=True, onvalidation=WriteThumb): . def WriteThumb(form): i = cStringIO.StringIO() o = cStringIO.StringIO() i.write(form.vars.imgfile.value) i.seek(0) im = Image.open(i, 'r') im.thumbnail((100,100),Image.ANTIALIAS) im.save(o,'jpeg') form.vars.thumbnail = base64.b64encode(o.getvalue()) o.close() i.close() img src=data:image/jpeg;base64,{{=row['thumbnail']}} alt=Thumbnail photo / On 9 Ott, 14:48, leone handja...@gmail.com wrote: excuse me: onvalidation not onvalidate. On 9 Ott, 14:20, leone handja...@gmail.com wrote: I have questions about SQLFORM onvalidate. Before inserting a row I have to resize an image by PIL and push b64encoded bytes on a blob field. So I have defined onvalidate=DoSomething in SQLFORM. DoSomething has form as input arg, resize image as thumbnails, encode it and push in form.vars.myblob (or db.mytable.myblob???). The new record is OK, but blob field is empty. Can someone orient me? --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32474] SQLFORM
Two questions: 1) how can I set the length of an html input field generated by SQLFORM? They have all the same size. 2) It needs same commit() using SQLite? My submits seem to generate no rows. Thanks in advance. --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32532] Re: SQLFORM
I know, but no effect. Strange. Do you know if SQLFORM's argument onvalidation is executed before inserting row? On 8 Ott, 22:51, Thadeus Burgess thade...@thadeusb.com wrote: leone, To change the size in css you have to use the width property, there is no size property in css. input #table_field { width: 350px; } -Thadeus On Thu, Oct 8, 2009 at 3:07 PM, leone handja...@gmail.com wrote: Second question solved. About input length css has no effect. SQLFORM(onvalidation is executed before or after inserting row? On 8 Ott, 17:23, Thadeus Burgess thade...@thadeusb.com wrote: massimo, On my machine locally, web2py_ajax.html seems to overwrite any length settings put into css.. The jQuery commands that change the length need to be either commented out or removed. -Thadeus On Thu, Oct 8, 2009 at 8:07 AM, mdipierro mdipie...@cs.depaul.edu wrote: You should set it using css. For a table table and a field field the id of the input field is #table_field you should be able to do something like this in the page style input #table_field { size: 5 } /style On Oct 8, 8:01 am, leone handja...@gmail.com wrote: Two questions: 1) how can I set the length of an html input field generated by SQLFORM? They have all the same size. 2) It needs same commit() using SQLite? My submits seem to generate no rows. No need for commit. Do you have form.accepts(...)? Hard to tell the problem without looking at the action. Thanks in advance. --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32379] Re: FORM factory
I notice that if you don't match defined Field in SQLFORM.factory and {{=form...}} in html form.results is False but form.errors is empty. The length attribute of Field-string doesn't produce a desired width of input. There is a different way to obtain the apprioate layout? On 6 Ott, 21:53, mdipierro mdipie...@cs.depaul.edu wrote: Let us know when you find out. Massimo On Oct 6, 2:43 pm, leone handja...@gmail.com wrote: Acc.!! It works fine, but form.accets(request.vars) returns always False. I have a button type=submit with an image before {{=form.custom.end}}. I suppose this could be an error and Ihave substitute it with {{=form.custom.submit}} with no result. I have difficult to find solutions using your manual, but it is my problem. On 6 Ott, 19:58, mdipierro mdipie...@cs.depaul.edu wrote: It is automatic. You just need Field('name',requires=IS_IN_SET(('a','b','c'))) or requires IS_IN_DB On Oct 6, 11:32 am, leone handja...@gmail.com wrote: How can I render a select option sequence by Field in SQLFORM.factory? Thanks! On 6 Ott, 17:14, mdipierro mdipie...@cs.depaul.edu wrote: yes form=SQLFORM.factory(Field('x'),Field('y')) HTML .. {{=form.custom.begin}} {{=form.custom.widget.x}} {{=form.custom.widget.y}} {{=form.custom.submit}} {{=form.custom.end}} .. /HTML On Oct 6, 9:51 am, leone handja...@gmail.com wrote: I want use FORM object and helpers objects, but I need complete control over html code. Exists a factory method as in SQLFORM, so I can code HTML .. {{=form.begin}} {{=form.widget.x}} {{=form.widget.y}} {{=form.submit}} {{=form.end}} .. /HTML ??? If not, exist an alternative way to obtain the advantages of web2py and html flexibility? --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32288] FORM factory
I want use FORM object and helpers objects, but I need complete control over html code. Exists a factory method as in SQLFORM, so I can code HTML .. {{=form.begin}} {{=form.widget.x}} {{=form.widget.y}} {{=form.submit}} {{=form.end}} .. /HTML ??? If not, exist an alternative way to obtain the advantages of web2py and html flexibility? --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32294] Re: FORM factory
How can I render a select option sequence by Field in SQLFORM.factory? Thanks! On 6 Ott, 17:14, mdipierro mdipie...@cs.depaul.edu wrote: yes form=SQLFORM.factory(Field('x'),Field('y')) HTML .. {{=form.custom.begin}} {{=form.custom.widget.x}} {{=form.custom.widget.y}} {{=form.custom.submit}} {{=form.custom.end}} .. /HTML On Oct 6, 9:51 am, leone handja...@gmail.com wrote: I want use FORM object and helpers objects, but I need complete control over html code. Exists a factory method as in SQLFORM, so I can code HTML .. {{=form.begin}} {{=form.widget.x}} {{=form.widget.y}} {{=form.submit}} {{=form.end}} .. /HTML ??? If not, exist an alternative way to obtain the advantages of web2py and html flexibility? --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32302] Re: FORM factory
Acc.!! It works fine, but form.accets(request.vars) returns always False. I have a button type=submit with an image before {{=form.custom.end}}. I suppose this could be an error and Ihave substitute it with {{=form.custom.submit}} with no result. I have difficult to find solutions using your manual, but it is my problem. On 6 Ott, 19:58, mdipierro mdipie...@cs.depaul.edu wrote: It is automatic. You just need Field('name',requires=IS_IN_SET(('a','b','c'))) or requires IS_IN_DB On Oct 6, 11:32 am, leone handja...@gmail.com wrote: How can I render a select option sequence by Field in SQLFORM.factory? Thanks! On 6 Ott, 17:14, mdipierro mdipie...@cs.depaul.edu wrote: yes form=SQLFORM.factory(Field('x'),Field('y')) HTML .. {{=form.custom.begin}} {{=form.custom.widget.x}} {{=form.custom.widget.y}} {{=form.custom.submit}} {{=form.custom.end}} .. /HTML On Oct 6, 9:51 am, leone handja...@gmail.com wrote: I want use FORM object and helpers objects, but I need complete control over html code. Exists a factory method as in SQLFORM, so I can code HTML .. {{=form.begin}} {{=form.widget.x}} {{=form.widget.y}} {{=form.submit}} {{=form.end}} .. /HTML ??? If not, exist an alternative way to obtain the advantages of web2py and html flexibility? --~--~-~--~~~---~--~~ 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 this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---