[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 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 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] Help with Argument list in redirection
I'm redirecting from a function as: redirect(URL(r = request, f = 'testingargs', args = arglist )) At "testingargs" function, I'm getting "underscores" for arguments (request.args(0)) if there are any spaces in arguments. Is there a way to receive arguments without getting these underscores ? redirect(URL (f="testingargs", args=["these are args with spaces"]) I'm getting at testingargs function for request.args(0): these_args_have_spaces -- 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] Selfreference and IS_IN_DB Pulldown
Hi All, I have 2 tables in an one2many relation. Table "config" has a selfreference. approval.define_table("config", SQLField("name", "string", notnull=True), SQLField("parent", 'reference config')) approval.define_table("recipe", SQLField("name", "string", notnull=True), SQLField("config", approval.config)) approval.config.parent.requires=IS_NULL_OR(IS_IN_DB(approval (approval.config.parent == None), 'config.id', "%(name)s", zero=None)) approval.recipe.config.requires=IS_IN_DB(approval, 'config.id', "% (name)s") This works. My Problem is to get a string in pulldown for approval.recipe.config like this "%(name)s [%(parent.name)s]". Any Ideas to achieve this? Martin -- 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.
Re: [web2py] Re: Getting representation from two levels deep relation
No success. Here's what I tested in the controller: * All these alternatives result in an input text with the integer value of opportunity_id being rendered: 1) db.task.opportunity_id.represent=lambda opportunity_id: opportunity_id.oppy_main_id.name 2) db.task.opportunity_id.represent=lambda opportunity_id: db.opportunity[opportunity_id].oppty_main_id.name 3) db.task.opportunity_id.represent=lambda opportunity_id: db.oppty_main[db.opportunity[opportunity_id].oppty_main_id].name * The same tests preceeded by: db.task.opportunity_id.writable=False 1) raises exception: db.task.opportunity_id.represent=lambda opportunity_id: opportunity_id.oppy_main_id.name AttributeError: 'NoneType' object has no attribute 'name' 2) & 3) The name represented in the html element Since I can't figure out an alternative way to accomplish this in the controller, I'll use form.custom to do it on the view. However, a controller based solution is still I believe relevant. Miguel -- 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 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 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 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: Help with Argument list in redirection
Solved it using this: arglist = "page = 0" + "&orderpref=" + "None" + "&agent=" + str (form.vars.agent) + \ "&fsource=" + str(form.vars.fsource) + "&fromdate=" + str (form.vars.fromdate) + "&to=" + str(form.vars.to) redirect(URL(request.application, 'default', 'searchpurchaseresults/?' + arglist )) I received at other function using myarg = request.vars.varname I think code's bit clumsy which reduces readability of code, any other way to produce that arglst ?? On Jan 14, 4:39 pm, vvk wrote: > I'm redirecting from a function as: > redirect(URL(r = request, f = 'testingargs', args = arglist )) > > At "testingargs" function, I'm getting "underscores" for arguments > (request.args(0)) if there are any spaces in arguments. Is there a way > to receive arguments without getting these underscores ? > > redirect(URL (f="testingargs", args=["these are args with spaces"]) > I'm getting at testingargs function for request.args(0): > these_args_have_spaces -- 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] Knowing whether the form has been submitted
In the controller I have the code: form = SQLFORM(db.plugin) #sets a non-editable form value to an editable form value. There is then a DB validator which converts it into a proper slug form.vars.slug = form.vars.name if form.accepts(request.vars, session): My problem is that I want to alter data that has been submitted by the form before it is saved into the database. If I do what I have done above, then it errors out if the form hasn't been submitted. I understand that form.accepts() essentially checks if the form has been submitted, then validates the data and then saves the data, all without being interrupted. Coming from Django I'm used to: if the form has been submitted: if the form is valid: save the form() Which leaves many stages at which to validate data. Has anyone come across this problem before? What were your solutions? Thanks alot. -- 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: Selfreference and IS_IN_DB Pulldown
You need web2py 1.74.6 approval.define_table("config", SQLField("name", "string", notnull=True), SQLField("parent", 'reference config'), format = lambda r:"%s [%s]" % (r.name,r.parent.name)) approval.define_table("recipe", SQLField("name", "string", notnull=True), SQLField("config", approval.config)) approval.config.parent.requires=IS_NULL_OR(IS_IN_DB(approval (approval.config.parent == None), 'config.id', "%(name)s", zero=None)) This will be very slow if the list is long. On Jan 14, 5:41 am, rfx_labs wrote: > Hi All, > > I have 2 tables in an one2many relation. Table "config" has a > selfreference. > > approval.define_table("config", > SQLField("name", "string", notnull=True), > SQLField("parent", 'reference config')) > > approval.define_table("recipe", > SQLField("name", "string", notnull=True), > SQLField("config", approval.config)) > > approval.config.parent.requires=IS_NULL_OR(IS_IN_DB(approval > (approval.config.parent == None), 'config.id', "%(name)s", zero=None)) > approval.recipe.config.requires=IS_IN_DB(approval, 'config.id', "% > (name)s") > > This works. > My Problem is to get a string in pulldown for approval.recipe.config > like this "%(name)s [%(parent.name)s]". > > Any Ideas to achieve this? > > Martin -- 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
You have Field('name',type=None) and this cannot be. On Jan 14, 7:35 am, leone 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 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 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 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: Help with Argument list in redirection
ahhh! redirect(URL(request.application, 'default', 'searchpurchaseresults', vars=dict(page=0,orderpref='None',agent=form.vars.agent, fsource=form.vars.fsource, fromdate=form.vars.fromdate, to=form.vars.to))) > On Jan 14, 7:45 am, vvk wrote: > Solved it using this: > > arglist = "page = 0" + "&orderpref=" + "None" + "&agent=" + str > (form.vars.agent) + \ > "&fsource=" + str(form.vars.fsource) > + "&fromdate=" + str > (form.vars.fromdate) + "&to=" + str(form.vars.to) > redirect(URL(request.application, 'default', 'searchpurchaseresults/?' > + arglist )) > > I received at other function using > myarg = request.vars.varname > > I think code's bit clumsy which reduces readability of code, any other > way to produce that arglst ?? > > On Jan 14, 4:39 pm, vvk wrote: > > > I'm redirecting from a function as: > > redirect(URL(r = request, f = 'testingargs', args = arglist )) > > > At "testingargs" function, I'm getting "underscores" for arguments > > (request.args(0)) if there are any spaces in arguments. Is there a way > > to receive arguments without getting these underscores ? > > > redirect(URL (f="testingargs", args=["these are args with spaces"]) > > I'm getting at testingargs function for request.args(0): > > these_args_have_spaces > > -- 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: Knowing whether the form has been submitted
accepts(...,onaccept=lambda form:do_something(form)) On Jan 14, 2:24 am, "Logan (LK)" wrote: > In the controller I have the code: > > form = SQLFORM(db.plugin) > > #sets a non-editable form value to an editable form value. There > is then a DB validator which converts it into a proper slug > form.vars.slug = form.vars.name > > if form.accepts(request.vars, session): > > My problem is that I want to alter data that has been submitted by the > form before it is saved into the database. If I do what I have done > above, then it errors out if the form hasn't been submitted. I > understand that form.accepts() essentially checks if the form has been > submitted, then validates the data and then saves the data, all > without being interrupted. Coming from Django I'm used to: > > if the form has been submitted: > if the form is valid: > save the form() > > Which leaves many stages at which to validate data. Has anyone come > across this problem before? What were your solutions? > > Thanks alot. -- 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 wrote: > You have Field('name',type=None) and this cannot be. > > On Jan 14, 7:35 am, leone 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 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 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 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: Getting representation from two levels deep relation
'represent' is used for output type fields. I believe you should be trying with a widget to get the SELECT you want. -- 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.
Re: [web2py] Several File Upload Using Ajax... Any Example available by any chance ?
I would be nice if someone could port this php backended upload panel: http://filetree.extjs.eu/ -wes On Wed, Jan 13, 2010 at 7:33 PM, Yannick wrote: > Hello mate, > I just wonder if there is an example of several upload file (all at > once a little bit like gmail attachment files) with Web2py ? > If you know some example... Please let me know... > > Cheers, > Yannick P. > > -- > 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. > > > > -- 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] how calculate field total
What is the best solution to automatically calculate a total field? db.define_table ('order_detail', Field('product_name'), Field('qtd', 'integer'), Field('price', 'integer'), Field('total', 'integer', writable=False) ) Where total = qtd * price requires and a custom validator? how to do? onvalidation on form? how to do? -- Atenciosamente -- = Alexandre Andrade Hipercenter.com -- 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: how calculate field total
with 1.74.5 and later you only need db.order_detail.total.compute=lambda r: r['qtd']*r['price'] On Jan 14, 8:51 am, Alexandre Andrade wrote: > What is the best solution to automatically calculate a total field? > > db.define_table ('order_detail', > Field('product_name'), > Field('qtd', 'integer'), > Field('price', 'integer'), > Field('total', 'integer', writable=False) > ) > > Where total = qtd * price > > requires and a custom validator? how to do? > onvalidation on form? how to do? > > -- > Atenciosamente > > -- > = > Alexandre Andrade > Hipercenter.com -- 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] Large datasets
Is web2py suitable if I want to work with large datasets? I am currently developing a database and want to use web2py to make it available to the client. Up to now I was using the shell and appadmin interfaces to the databasis. When trying out the webgrid-slice from http://www.web2pyslices.com/main/slices/take_slice/39 and also the "Quick Table Management Snippet" from http://www.web2pyslices.com/main/slices/take_slice/42 to develop an interface to one of the tables containing about 168800 records python used up all the resources on my computer (more than 3.4G of memory) and I had to kill the process. In both cases I referred to the table as the datasource. What I do not understand is that in the appadmin interface I do not have the same problem. How do I prevent web2py loading whole dataset into memory? After all what is the use of a sql database if the everything is loaded into RAM? Regards Johann -- 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: Is there a better way of doing this in GAE?
You can improve your example with query = (db.advertisement.owner==auth.user.id) links = db(query).select(orderby=db.advertisement.posted_on) for b in links: query=(db.published.advertisement_id==b.id) res = db(query).select() for a in res: print a.mag_id but this would not make it any faster. I order to make it faster you would have to change your model. How depends on usage statistics and types of queries. Everything you do is a result of a tradeoff. You should look into from gluon.conrtib.gql import gae Field('publications',gae.ListProperty(int)) which maps into a the equivalent GAE ListProperty. You may also want to consider denormalizing the database. In both cases you gain speed but may lose referential integrity. There are many ways to do this and which one On Jan 14, 1:11 am, Miguel wrote: > Hi > > Advertisements can be published in different magazines. I represent > this with the following tables: > > db.define_table("magazine", > SQLField("owner",db.auth_user, writable=False, readable=False)) > > db.define_table("advertisement", > SQLField("owner",db.auth_user,writable=False, readable=False), > SQLField("description", "text", notnull=True, label = T > ("Description"), > SQLField("mag_id", db.magazine,writable=False, readable=False)) > > db.define_table("published", > SQLField("advertisement_id", db.advertisement), > SQLField("mag_id", db.magazine), > SQLField("url", "string",length=2048, notnull=True, > default=None)) > > What I need is a query that, given a user, for each of his > advertisement gives me the magazines it is printed on. > Since on GAE I cannot have joins I simulated this by doing the > following: > > query = (db.advertisement.id>0)&(db.advertisement.owner == > auth.user.id) > links = db(query).select(orderby=db.advertisement.posted_on) > > # links now contains all the advertisements for the logged-in user > > for b in links: > query=(db.published.id>0) & (db.published.advertisement_id == > b.id) > res = db(query).select() > for a in res: > print a.mag_id # prints the id of the magazine the > advertisement is published in > > Is there a better way of doing this in GAE? Performance is one of my > main concerns here. > > thanks > -M -- 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 query: limit ?
What is the equivalent in DAL for l = db.executesql("select id from artikel limit 10;") Regards Johann -- 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: Getting representation from two levels deep relation
I think all the problems arise from the fact that you do: IS_IN_DB(db(db.opportunity.id==db.task.opportunity_id),...) this is a join and you cannot do a JOIN in a validator because you are referencing one table, not the temp table result of a join. Parhaps this is what you want: db.task.opportunity_id.requires=IS_NULL_OR( IS_IN_DB(db,'opportunity.id',lambda opp: opp.oppty_main_id.name)) Mind that if you have any broken reference (like a NULL reference or a reference to a record that no longer exist opp.oppty_main_id.name will break. Also mind that this is very slow since it results in a select for every record in the SELECT/OPTION. I would recommend caching the records and their names and use IS_IN_SET instead of IS_IN_DB. Massimo On Jan 13, 8:00 am, Miguel Lopes wrote: > I have the following tables: task, opportunity, and oppty_main > With the following relations: > * task.opportunity_id->opportunity.id > * opportunity.oppty_main_id->oppty_main.id > > When updating a task I have a SELECT for the related opportunities: > > db.task.opportunity_id.requires=IS_NULL_OR( > IS_IN_DB(db(db.opportunity.id==db.task.opportunity_id), > 'opportunity.id')) > > The problem is how to get the representation to show the name of the > opportunity, which is at oppty_main.name! > Something like (doesn't work): > db.task.opportunity_id.requires=IS_NULL_OR( > IS_IN_DB(db(db.opportunity.id==db.task.opportunity_id), > 'opportunity.id', > '%(db.task.opportunity_id.oppty_main_id.name)s') > > Miguel -- 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.
Re: [web2py] Re: how calculate field total
Thanks, very nice. 2010/1/14 mdipierro > with 1.74.5 and later you only need > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > On Jan 14, 8:51 am, Alexandre Andrade > wrote: > > What is the best solution to automatically calculate a total field? > > > > db.define_table ('order_detail', > > Field('product_name'), > > Field('qtd', 'integer'), > > Field('price', 'integer'), > > Field('total', 'integer', writable=False) > > ) > > > > Where total = qtd * price > > > > requires and a custom validator? how to do? > > onvalidation on form? how to do? > > > > -- > > Atenciosamente > > > > -- > > = > > Alexandre Andrade > > Hipercenter.com > > -- > 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. > > > > -- Atenciosamente -- = Alexandre Andrade Hipercenter.com -- 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: Large datasets
The web2py DAL sipmly provides an interface to your database. There is no overhead that depends on the size of your dataset. If you database can handle it, web2py can. There are exceptions. For example the requires=IS_IN_DB(..,) validator builds an in-memory list of all the references in order to make the HTML dropdown. This is ok for a small number of references. You want to validate without the dropdown (requires=[IS_IN_DB(...)], note the []) and perhaps implement auto completion (it is discussed in the book). You also have to avoid db(...).select() but use pagination db (...).select(limitby=(min,max)) instead. appadmin does it by default. Some plugins do not do pagination and break on large datasets. You have to ask their authors. MySQL, PostgreSQL, Firebird, Informix, and DB2 handle pagination well. MSSQL and Oracle do not. Avoid them. Massimo On Jan 14, 9:12 am, Johann Spies wrote: > Is web2py suitable if I want to work with large datasets? > > I am currently developing a database and want to use web2py to make it > available to the client. > > Up to now I was using the shell and appadmin interfaces to the databasis. > > When trying out the webgrid-slice > fromhttp://www.web2pyslices.com/main/slices/take_slice/39and also the > "Quick Table Management Snippet" > fromhttp://www.web2pyslices.com/main/slices/take_slice/42to develop an > interface to one of the tables containing about 168800 records python > used up all the resources on my computer (more than 3.4G of memory) > and I had to kill the process. > > In both cases I referred to the table as the datasource. > > What I do not understand is that in the appadmin interface I do not > have the same problem. > > How do I prevent web2py loading whole dataset into memory? After all > what is the use of a sql database if the everything is loaded into > RAM? > > Regards > Johann -- 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 query: limit ?
l = db().select(db.artikel.id,limitby=(0,10)) On Jan 14, 9:19 am, Johann Spies wrote: > What is the equivalent in DAL for > > l = db.executesql("select id from artikel limit 10;") > > Regards > Johann -- 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.
Re: [web2py] DAL query: limit ?
Hi, I believe it is: db().select(db.artikel.id, limitby=(0, 10)) See ya. -- On Thu, Jan 14, 2010 at 3:19 PM, Johann Spies wrote: > What is the equivalent in DAL for > > l = db.executesql("select id from artikel limit 10;") > > Regards > Johann > > -- > 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. > > > > -- 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.
Re: [web2py] Re: DAL query: limit ?
Thanks - also for your answer on my other question about large datasets. 2010/1/14 mdipierro : > l = db().select(db.artikel.id,limitby=(0,10)) > > On Jan 14, 9:19 am, Johann Spies wrote: >> What is the equivalent in DAL for >> >> l = db.executesql("select id from artikel limit 10;") >> >> Regards >> Johann > > -- > 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. > > > > -- 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.
Re: [web2py] Re: how calculate field total
db.order_detail.total.compute=lambda r: r['qtd']*r['price'] don't work on updates 2010/1/14 mdipierro > with 1.74.5 and later you only need > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > On Jan 14, 8:51 am, Alexandre Andrade > wrote: > > What is the best solution to automatically calculate a total field? > > > > db.define_table ('order_detail', > > Field('product_name'), > > Field('qtd', 'integer'), > > Field('price', 'integer'), > > Field('total', 'integer', writable=False) > > ) > > > > Where total = qtd * price > > > > requires and a custom validator? how to do? > > onvalidation on form? how to do? > > > > -- > > Atenciosamente > > > > -- > > = > > Alexandre Andrade > > Hipercenter.com > > -- > 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. > > > > -- Atenciosamente -- = Alexandre Andrade Hipercenter.com -- 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: how calculate field total
Make sure Field(...,default=None, update=None) On Jan 14, 9:47 am, Alexandre Andrade wrote: > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > don't work on updates > > 2010/1/14 mdipierro > > > > > with 1.74.5 and later you only need > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > On Jan 14, 8:51 am, Alexandre Andrade > > wrote: > > > What is the best solution to automatically calculate a total field? > > > > db.define_table ('order_detail', > > > Field('product_name'), > > > Field('qtd', 'integer'), > > > Field('price', 'integer'), > > > Field('total', 'integer', writable=False) > > > ) > > > > Where total = qtd * price > > > > requires and a custom validator? how to do? > > > onvalidation on form? how to do? > > > > -- > > > Atenciosamente > > > > -- > > > = > > > Alexandre Andrade > > > Hipercenter.com > > > -- > > 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. > > -- > Atenciosamente > > -- > = > Alexandre Andrade > Hipercenter.com -- 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.
Re: [web2py] Re: how calculate field total
still don't work. The value before still mantains. Maybe I have to drop the column and create it again? 2010/1/14 mdipierro > Make sure Field(...,default=None, update=None) > > On Jan 14, 9:47 am, Alexandre Andrade > wrote: > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > don't work on updates > > > > 2010/1/14 mdipierro > > > > > > > > > with 1.74.5 and later you only need > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > On Jan 14, 8:51 am, Alexandre Andrade > > > wrote: > > > > What is the best solution to automatically calculate a total field? > > > > > > db.define_table ('order_detail', > > > > Field('product_name'), > > > > Field('qtd', 'integer'), > > > > Field('price', 'integer'), > > > > Field('total', 'integer', writable=False) > > > > ) > > > > > > Where total = qtd * price > > > > > > requires and a custom validator? how to do? > > > > onvalidation on form? how to do? > > > > > > -- > > > > Atenciosamente > > > > > > -- > > > > = > > > > Alexandre Andrade > > > > Hipercenter.com > > > > > -- > > > 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. > > > > -- > > Atenciosamente > > > > -- > > = > > Alexandre Andrade > > Hipercenter.com > > -- > 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. > > > > -- Atenciosamente -- = Alexandre Andrade Hipercenter.com -- 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] Auth on GAE silently fails to login
def user(): return dict(form=auth()) Locally using SQLite or dev_appserver I can login to my application. When I upload to GAE logging in silently fail, I am redirected from init/default/user/login to init/default/index and no jquery flash message appears. No log entries are added to GAE. In Web2py 1.67.2 login worked. Now in Web2py 1.74.5 it does not. Sorry for the large gap between version... releases were thick and fast at the end of '09! :) Has anyone has this experience? Any pointers? Functions that don't require a login session execute and return fine on GAE. -- 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.
Re: [web2py] Re: Selfreference and IS_IN_DB Pulldown
What is the difference between represent and format? -Thadeus On Thu, Jan 14, 2010 at 8:11 AM, mdipierro wrote: > You need web2py 1.74.6 > > approval.define_table("config", >SQLField("name", "string", notnull=True), > SQLField("parent", 'reference config'), >format = lambda r:"%s [%s]" % (r.name,r.parent.name)) > > approval.define_table("recipe", >SQLField("name", "string", notnull=True), >SQLField("config", approval.config)) > > approval.config.parent.requires=IS_NULL_OR(IS_IN_DB(approval > (approval.config.parent == None), 'config.id', "%(name)s", zero=None)) > > This will be very slow if the list is long. > > On Jan 14, 5:41 am, rfx_labs wrote: > > Hi All, > > > > I have 2 tables in an one2many relation. Table "config" has a > > selfreference. > > > > approval.define_table("config", > > SQLField("name", "string", notnull=True), > > SQLField("parent", 'reference config')) > > > > approval.define_table("recipe", > > SQLField("name", "string", notnull=True), > > SQLField("config", approval.config)) > > > > approval.config.parent.requires=IS_NULL_OR(IS_IN_DB(approval > > (approval.config.parent == None), 'config.id', "%(name)s", zero=None)) > > approval.recipe.config.requires=IS_IN_DB(approval, 'config.id', "% > > (name)s") > > > > This works. > > My Problem is to get a string in pulldown for approval.recipe.config > > like this "%(name)s [%(parent.name)s]". > > > > Any Ideas to achieve this? > > > > Martin > > -- > 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. > > > > -- 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.
Re: [web2py] Re: Help with Argument list in redirection
> ahhh! AH! -Thadeus On Thu, Jan 14, 2010 at 8:16 AM, mdipierro wrote: > ahhh! > > redirect(URL(request.application, 'default', 'searchpurchaseresults', > vars=dict(page=0,orderpref='None',agent=form.vars.agent, > fsource=form.vars.fsource, > fromdate=form.vars.fromdate, > to=form.vars.to))) > > > > > On Jan 14, 7:45 am, vvk wrote: > > Solved it using this: > > > > arglist = "page = 0" + "&orderpref=" + "None" + "&agent=" + str > > (form.vars.agent) + \ > > "&fsource=" + > str(form.vars.fsource) + "&fromdate=" + str > > (form.vars.fromdate) + "&to=" + str(form.vars.to) > > redirect(URL(request.application, 'default', 'searchpurchaseresults/?' > > + arglist )) > > > > I received at other function using > > myarg = request.vars.varname > > > > I think code's bit clumsy which reduces readability of code, any other > > way to produce that arglst ?? > > > > On Jan 14, 4:39 pm, vvk wrote: > > > > > I'm redirecting from a function as: > > > redirect(URL(r = request, f = 'testingargs', args = arglist )) > > > > > At "testingargs" function, I'm getting "underscores" for arguments > > > (request.args(0)) if there are any spaces in arguments. Is there a way > > > to receive arguments without getting these underscores ? > > > > > redirect(URL (f="testingargs", args=["these are args with spaces"]) > > > I'm getting at testingargs function for request.args(0): > > > these_args_have_spaces > > > > > > -- > 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. > > > > -- 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: Auth on GAE silently fails to login
Can you please run a test to better identify the problem. Can you register a new user and try login as the new user? Same problem? On Jan 14, 11:01 am, Carl wrote: > def user(): > return dict(form=auth()) > > Locally using SQLite or dev_appserver I can login to my application. > When I upload to GAE logging in silently fail, I am redirected from > init/default/user/login to init/default/index and no jquery flash > message appears. No log entries are added to GAE. > > In Web2py 1.67.2 login worked. Now in Web2py 1.74.5 it does not. Sorry > for the large gap between version... releases were thick and fast at > the end of '09! :) > > Has anyone has this experience? Any pointers? > > Functions that don't require a login session execute and return fine > on GAE. -- 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] Postgres EXEPTION in web2py
In one of my controller actions required to get the exact EXCEPTION raised by postgreSQL function. How could I fetch the RAISE EXCEPTION error using psycopg (or the connection cursor)? -- 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: Postgres EXEPTION in web2py
I am not sure I understand. If the exception is raised by the database (postgresql), the driver catches it and re-raises it usually as a OperationalError. You need to look into psycopg2 documentation. Web2py does not capture the exception raised by the driver (except in the case of failure to insert for KeyedTables) On Jan 14, 11:34 am, haftish21 wrote: > In one of my controller actions required to get the exact EXCEPTION > raised by postgreSQL function. How could I fetch the RAISE EXCEPTION > error using psycopg (or the connection cursor)? -- 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.
Re: [web2py] Re: how calculate field total
It don't show at form, without readable=False. I set readable=False, but it don't show the updated value. 2010/1/14 mdipierro > Can you also try set readable=False? > > On Jan 14, 9:52 am, mdipierro wrote: > > Make sure Field(...,default=None, update=None) > > > > On Jan 14, 9:47 am, Alexandre Andrade > > wrote: > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > don't work on updates > > > > > 2010/1/14 mdipierro > > > > > > with 1.74.5 and later you only need > > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > > On Jan 14, 8:51 am, Alexandre Andrade > > > > wrote: > > > > > What is the best solution to automatically calculate a total field? > > > > > > > db.define_table ('order_detail', > > > > > Field('product_name'), > > > > > Field('qtd', 'integer'), > > > > > Field('price', 'integer'), > > > > > Field('total', 'integer', writable=False) > > > > > ) > > > > > > > Where total = qtd * price > > > > > > > requires and a custom validator? how to do? > > > > > onvalidation on form? how to do? > > > > > > > -- > > > > > Atenciosamente > > > > > > > -- > > > > > = > > > > > Alexandre Andrade > > > > > Hipercenter.com > > > > > > -- > > > > 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. > > > > > -- > > > Atenciosamente > > > > > -- > > > = > > > Alexandre Andrade > > > Hipercenter.com > > -- > 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. > > > > -- Atenciosamente -- = Alexandre Andrade Hipercenter.com -- 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.
Re: [web2py] Re: how calculate field total
Field('valor_total','double', default=None, update=None, readable=False), db.cronograma_desembolso.valor_total.compute=lambda r: r['valor_custeio_concedente']+ r['valor_investimento_concedente'] + r['valor_custeio_contrapartida']+ r['valor_investimento_contrapartida'] (one line above) 2010/1/14 Alexandre Andrade > It don't show at form, without readable=False. > > I set readable=False, but it don't show the updated value. > > 2010/1/14 mdipierro > >> Can you also try set readable=False? >> >> >> On Jan 14, 9:52 am, mdipierro wrote: >> > Make sure Field(...,default=None, update=None) >> > >> > On Jan 14, 9:47 am, Alexandre Andrade >> > wrote: >> > >> > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] >> > >> > > don't work on updates >> > >> > > 2010/1/14 mdipierro >> > >> > > > with 1.74.5 and later you only need >> > >> > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] >> > >> > > > On Jan 14, 8:51 am, Alexandre Andrade >> > > > wrote: >> > > > > What is the best solution to automatically calculate a total >> field? >> > >> > > > > db.define_table ('order_detail', >> > > > > Field('product_name'), >> > > > > Field('qtd', 'integer'), >> > > > > Field('price', 'integer'), >> > > > > Field('total', 'integer', writable=False) >> > > > > ) >> > >> > > > > Where total = qtd * price >> > >> > > > > requires and a custom validator? how to do? >> > > > > onvalidation on form? how to do? >> > >> > > > > -- >> > > > > Atenciosamente >> > >> > > > > -- >> > > > > = >> > > > > Alexandre Andrade >> > > > > Hipercenter.com >> > >> > > > -- >> > > > 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. >> > >> > > -- >> > > Atenciosamente >> > >> > > -- >> > > = >> > > Alexandre Andrade >> > > Hipercenter.com >> >> -- >> 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. >> >> >> >> > > > -- > Atenciosamente > > -- > = > Alexandre Andrade > Hipercenter.com > -- Atenciosamente -- = Alexandre Andrade Hipercenter.com -- 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: how calculate field total
I see the problem. I can find a way around it but I feel it would be wrong. When you submit a form, what you see is what should go in the DB, even if some fields are readonly. If you have quantity, price and total you should not display the same total that is in DB before submission as readonly, because has you change quantity or price the total should change but it does not. To a user this is confusing. To the user it looks like they submit a form with the wrong total (the previous one, not the one reflacing the change in the other fields). You should not use compute. You should use JS jQuery("input[name='quantity'],input[name='price']").change(function() { jQuery("input[name='total']").val(parseFloat(jQuery("input [name='price']").val())*parseInt(jQuery("input[name='quantity']")); }); when use a custom validator to make sure the user did not mess up this field somehow. there are many options. On Jan 14, 12:57 pm, Alexandre Andrade wrote: > It don't show at form, without readable=False. > > I set readable=False, but it don't show the updated value. > > 2010/1/14 mdipierro > > > > > Can you also try set readable=False? > > > On Jan 14, 9:52 am, mdipierro wrote: > > > Make sure Field(...,default=None, update=None) > > > > On Jan 14, 9:47 am, Alexandre Andrade > > > wrote: > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > don't work on updates > > > > > 2010/1/14 mdipierro > > > > > > with 1.74.5 and later you only need > > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > > On Jan 14, 8:51 am, Alexandre Andrade > > > > > wrote: > > > > > > What is the best solution to automatically calculate a total field? > > > > > > > db.define_table ('order_detail', > > > > > > Field('product_name'), > > > > > > Field('qtd', 'integer'), > > > > > > Field('price', 'integer'), > > > > > > Field('total', 'integer', writable=False) > > > > > > ) > > > > > > > Where total = qtd * price > > > > > > > requires and a custom validator? how to do? > > > > > > onvalidation on form? how to do? > > > > > > > -- > > > > > > Atenciosamente > > > > > > > -- > > > > > > = > > > > > > Alexandre Andrade > > > > > > Hipercenter.com > > > > > > -- > > > > > 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. > > > > > -- > > > > Atenciosamente > > > > > -- > > > > = > > > > Alexandre Andrade > > > > Hipercenter.com > > > -- > > 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. > > -- > Atenciosamente > > -- > = > Alexandre Andrade > Hipercenter.com -- 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: Auth on GAE silently fails to login
Did you ever try register and login locally with dev-appserver before uploading on GAE? Perhaps some index is missing and by running locally, it would re-create the missing index. Anyway, the behavior is strange and I do not fully understand it. Could you email me the app? On Jan 14, 12:42 pm, Carl wrote: > Trying to login after several "counter" calls resets the count. > > 2010/1/14 Carl > > > I added a function for counter... it works on GAE (and it works locally > > too) > > > 2010/1/14 mdipierro > > >> Do your sessions work? > > >> can you try a simple counter? > > >> def counter(): return dict(c=session.c=(session.c or 0)+1) > > >> On Jan 14, 11:50 am, Carl wrote: > >> > Registering a new user... I can see a new row in GAE's data viewer but > >> > once created I don't get automatically logged in (which does happen > >> > locally). When I then try a login with these new user credentials I > >> > get the same silent fail. > > >> > On Jan 14, 5:32 pm, mdipierro wrote: > > >> > > Can you please run a test to better identify the problem. Can you > >> > > register a new user and try login as the new user? Same problem? > > >> > > On Jan 14, 11:01 am, Carl wrote: > > >> > > > def user(): > >> > > > return dict(form=auth()) > > >> > > > Locally using SQLite or dev_appserver I can login to my application. > >> > > > When I upload to GAE logging in silently fail, I am redirected from > >> > > > init/default/user/login to init/default/index and no jquery flash > >> > > > message appears. No log entries are added to GAE. > > >> > > > In Web2py 1.67.2 login worked. Now in Web2py 1.74.5 it does not. > >> Sorry > >> > > > for the large gap between version... releases were thick and fast at > >> > > > the end of '09! :) > > >> > > > Has anyone has this experience? Any pointers? > > >> > > > Functions that don't require a login session execute and return fine > >> > > > on GAE. > > >> -- > >> 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. -- 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.
Re: [web2py] Re: how calculate field total
1. The total is not showed when editing. I don't need in this moment. When I set .compute, its hide (like writable=False and readable=False) the field in the form. 2. the main problem is .compute is not inserting/updating the field on db, and neither acting as represent when showing 2010/1/14 mdipierro > I see the problem. I can find a way around it but I feel it would be > wrong. > > When you submit a form, what you see is what should go in the DB, even > if some fields are readonly. > > If you have quantity, price and total you should not display the same > total that is in DB before submission as readonly, because has you > change quantity or price the total should change but it does not. To a > user this is confusing. To the user it looks like they submit a form > with the wrong total (the previous one, not the one reflacing the > change in the other fields). > > You should not use compute. > > You should use JS > > > jQuery("input[name='quantity'],input[name='price']").change(function() > { > jQuery("input[name='total']").val(parseFloat(jQuery("input > [name='price']").val())*parseInt(jQuery("input[name='quantity']")); > }); > > > when use a custom validator to make sure the user did not mess up this > field somehow. > there are many options. > > On Jan 14, 12:57 pm, Alexandre Andrade > wrote: > > It don't show at form, without readable=False. > > > > I set readable=False, but it don't show the updated value. > > > > 2010/1/14 mdipierro > > > > > > > > > Can you also try set readable=False? > > > > > On Jan 14, 9:52 am, mdipierro wrote: > > > > Make sure Field(...,default=None, update=None) > > > > > > On Jan 14, 9:47 am, Alexandre Andrade > > > > wrote: > > > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > > > don't work on updates > > > > > > > 2010/1/14 mdipierro > > > > > > > > with 1.74.5 and later you only need > > > > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > > > > On Jan 14, 8:51 am, Alexandre Andrade > > > > > > wrote: > > > > > > > What is the best solution to automatically calculate a total > field? > > > > > > > > > db.define_table ('order_detail', > > > > > > > Field('product_name'), > > > > > > > Field('qtd', 'integer'), > > > > > > > Field('price', 'integer'), > > > > > > > Field('total', 'integer', writable=False) > > > > > > > ) > > > > > > > > > Where total = qtd * price > > > > > > > > > requires and a custom validator? how to do? > > > > > > > onvalidation on form? how to do? > > > > > > > > > -- > > > > > > > Atenciosamente > > > > > > > > > -- > > > > > > > = > > > > > > > Alexandre Andrade > > > > > > > Hipercenter.com > > > > > > > > -- > > > > > > 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. > > > > > > > -- > > > > > Atenciosamente > > > > > > > -- > > > > > = > > > > > Alexandre Andrade > > > > > Hipercenter.com > > > > > -- > > > 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. > > > > -- > > Atenciosamente > > > > -- > > = > > Alexandre Andrade > > Hipercenter.com > > -- > 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. > > > > -- Atenciosamente -- = Alexandre Andrade Hipercenter.com -- 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: how calculate field total
Try Field('total','double') (compute=None, writable=True, readable=True) and jQuery("input[name='quantity'],input[name='price']").keyup(function() { jQuery("input[name='total']").val(parseFloat(jQuery("input [name='price']").val())*parseInt(jQuery("input[name='quantity']")); }); Use firebug in to debug the JS. compute should not be used if the field is shown. On Jan 14, 2:18 pm, Alexandre Andrade wrote: > 1. The total is not showed when editing. I don't need in this moment. When I > set .compute, its hide (like writable=False and readable=False) the field in > the form. > 2. the main problem is .compute is not inserting/updating the field on db, > and neither acting as represent when showing > > 2010/1/14 mdipierro > > > > > I see the problem. I can find a way around it but I feel it would be > > wrong. > > > When you submit a form, what you see is what should go in the DB, even > > if some fields are readonly. > > > If you have quantity, price and total you should not display the same > > total that is in DB before submission as readonly, because has you > > change quantity or price the total should change but it does not. To a > > user this is confusing. To the user it looks like they submit a form > > with the wrong total (the previous one, not the one reflacing the > > change in the other fields). > > > You should not use compute. > > > You should use JS > > > > > jQuery("input[name='quantity'],input[name='price']").change(function() > > { > > jQuery("input[name='total']").val(parseFloat(jQuery("input > > [name='price']").val())*parseInt(jQuery("input[name='quantity']")); > > }); > > > > > when use a custom validator to make sure the user did not mess up this > > field somehow. > > there are many options. > > > On Jan 14, 12:57 pm, Alexandre Andrade > > wrote: > > > It don't show at form, without readable=False. > > > > I set readable=False, but it don't show the updated value. > > > > 2010/1/14 mdipierro > > > > > Can you also try set readable=False? > > > > > On Jan 14, 9:52 am, mdipierro wrote: > > > > > Make sure Field(...,default=None, update=None) > > > > > > On Jan 14, 9:47 am, Alexandre Andrade > > > > > wrote: > > > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > > > don't work on updates > > > > > > > 2010/1/14 mdipierro > > > > > > > > with 1.74.5 and later you only need > > > > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > > > > On Jan 14, 8:51 am, Alexandre Andrade > > > > > > > wrote: > > > > > > > > What is the best solution to automatically calculate a total > > field? > > > > > > > > > db.define_table ('order_detail', > > > > > > > > Field('product_name'), > > > > > > > > Field('qtd', 'integer'), > > > > > > > > Field('price', 'integer'), > > > > > > > > Field('total', 'integer', writable=False) > > > > > > > > ) > > > > > > > > > Where total = qtd * price > > > > > > > > > requires and a custom validator? how to do? > > > > > > > > onvalidation on form? how to do? > > > > > > > > > -- > > > > > > > > Atenciosamente > > > > > > > > > -- > > > > > > > > = > > > > > > > > Alexandre Andrade > > > > > > > > Hipercenter.com > > > > > > > > -- > > > > > > > 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. > > > > > > > -- > > > > > > Atenciosamente > > > > > > > -- > > > > > > = > > > > > > Alexandre Andrade > > > > > > Hipercenter.com > > > > > -- > > > > 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. > > > > -- > > > Atenciosamente > > > > -- > > > = > > > Alexandre Andrade > > > Hipercenter.com > > > -- > > 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. > > -- > Atenciosamente > > -- > = > Alexandre Andrade > Hipercenter.com -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To p
Re: [web2py] Re: how calculate field total
Solved without jquery if form.accepts(request.vars, session): row = db.cronograma_desembolso[form.vars.id] total = row.valor_custeio_concedente + row.valor_investimento_concedente + row.valor_custeio_contrapartida + row.valor_investimento_contrapartida row.update_record(valor_total = total) 2010/1/14 mdipierro > Try Field('total','double') (compute=None, writable=True, > readable=True) and > > jQuery("input[name='quantity'],input[name='price']").keyup(function() > { > jQuery("input[name='total']").val(parseFloat(jQuery("input > [name='price']").val())*parseInt(jQuery("input[name='quantity']")); > }); > > Use firebug in to debug the JS. compute should not be used if the > field is shown. > > On Jan 14, 2:18 pm, Alexandre Andrade > wrote: > > 1. The total is not showed when editing. I don't need in this moment. > When I > > set .compute, its hide (like writable=False and readable=False) the field > in > > the form. > > 2. the main problem is .compute is not inserting/updating the field on > db, > > and neither acting as represent when showing > > > > 2010/1/14 mdipierro > > > > > > > > > I see the problem. I can find a way around it but I feel it would be > > > wrong. > > > > > When you submit a form, what you see is what should go in the DB, even > > > if some fields are readonly. > > > > > If you have quantity, price and total you should not display the same > > > total that is in DB before submission as readonly, because has you > > > change quantity or price the total should change but it does not. To a > > > user this is confusing. To the user it looks like they submit a form > > > with the wrong total (the previous one, not the one reflacing the > > > change in the other fields). > > > > > You should not use compute. > > > > > You should use JS > > > > > > > > jQuery("input[name='quantity'],input[name='price']").change(function() > > > { > > > jQuery("input[name='total']").val(parseFloat(jQuery("input > > > [name='price']").val())*parseInt(jQuery("input[name='quantity']")); > > > }); > > > > > > > > when use a custom validator to make sure the user did not mess up this > > > field somehow. > > > there are many options. > > > > > On Jan 14, 12:57 pm, Alexandre Andrade > > > wrote: > > > > It don't show at form, without readable=False. > > > > > > I set readable=False, but it don't show the updated value. > > > > > > 2010/1/14 mdipierro > > > > > > > Can you also try set readable=False? > > > > > > > On Jan 14, 9:52 am, mdipierro wrote: > > > > > > Make sure Field(...,default=None, update=None) > > > > > > > > On Jan 14, 9:47 am, Alexandre Andrade > > > > > > wrote: > > > > > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > > > > > don't work on updates > > > > > > > > > 2010/1/14 mdipierro > > > > > > > > > > with 1.74.5 and later you only need > > > > > > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > > > > > > On Jan 14, 8:51 am, Alexandre Andrade < > alexandrema...@gmail.com> > > > > > > > > wrote: > > > > > > > > > What is the best solution to automatically calculate a > total > > > field? > > > > > > > > > > > db.define_table ('order_detail', > > > > > > > > > Field('product_name'), > > > > > > > > > Field('qtd', 'integer'), > > > > > > > > > Field('price', 'integer'), > > > > > > > > > Field('total', 'integer', writable=False) > > > > > > > > > ) > > > > > > > > > > > Where total = qtd * price > > > > > > > > > > > requires and a custom validator? how to do? > > > > > > > > > onvalidation on form? how to do? > > > > > > > > > > > -- > > > > > > > > > Atenciosamente > > > > > > > > > > > -- > > > > > > > > > = > > > > > > > > > Alexandre Andrade > > > > > > > > > Hipercenter.com > > > > > > > > > > -- > > > > > > > > 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. > > > > > > > > > -- > > > > > > > Atenciosamente > > > > > > > > > -- > > > > > > > = > > > > > > > Alexandre Andrade > > > > > > > Hipercenter.com > > > > > > > -- > > > > > 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://gro
Re: [web2py] Re: Selfreference and IS_IN_DB Pulldown
> Different names help avoid confusion (or so I hoped). huh... Why not use the builtin __str__ or __unicode__ of the class to serve as representation or "format" ? -Thadeus On Thu, Jan 14, 2010 at 12:38 PM, rfx_labs wrote: > > > db.define_table(...,format=...) goes into db.table._format > > Thanks Massimo. Everything works like a charme. > > Martin > > -- > 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. > > > > -- 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: how calculate field total
OK. You can also do: if form.accepts(request.vars, session, onvalidation=lambda form: form.vars.valor_total = form.vars.valor_custeio_concedente + form.vars.valor_investimento_concedente + form.vars.valor_custeio_contrapartida + form.vars.valor_investimento_contrapartida): which is 2 db queries less. On Jan 14, 2:42 pm, Alexandre Andrade wrote: > Solved without jquery > > if form.accepts(request.vars, session): > row = db.cronograma_desembolso[form.vars.id] > total = row.valor_custeio_concedente + > row.valor_investimento_concedente + row.valor_custeio_contrapartida + > row.valor_investimento_contrapartida > row.update_record(valor_total = total) > > 2010/1/14 mdipierro > > > > > Try Field('total','double') (compute=None, writable=True, > > readable=True) and > > > jQuery("input[name='quantity'],input[name='price']").keyup(function() > > { > > jQuery("input[name='total']").val(parseFloat(jQuery("input > > [name='price']").val())*parseInt(jQuery("input[name='quantity']")); > > }); > > > Use firebug in to debug the JS. compute should not be used if the > > field is shown. > > > On Jan 14, 2:18 pm, Alexandre Andrade > > wrote: > > > 1. The total is not showed when editing. I don't need in this moment. > > When I > > > set .compute, its hide (like writable=False and readable=False) the field > > in > > > the form. > > > 2. the main problem is .compute is not inserting/updating the field on > > db, > > > and neither acting as represent when showing > > > > 2010/1/14 mdipierro > > > > > I see the problem. I can find a way around it but I feel it would be > > > > wrong. > > > > > When you submit a form, what you see is what should go in the DB, even > > > > if some fields are readonly. > > > > > If you have quantity, price and total you should not display the same > > > > total that is in DB before submission as readonly, because has you > > > > change quantity or price the total should change but it does not. To a > > > > user this is confusing. To the user it looks like they submit a form > > > > with the wrong total (the previous one, not the one reflacing the > > > > change in the other fields). > > > > > You should not use compute. > > > > > You should use JS > > > > > > > > > jQuery("input[name='quantity'],input[name='price']").change(function() > > > > { > > > > jQuery("input[name='total']").val(parseFloat(jQuery("input > > > > [name='price']").val())*parseInt(jQuery("input[name='quantity']")); > > > > }); > > > > > > > > > when use a custom validator to make sure the user did not mess up this > > > > field somehow. > > > > there are many options. > > > > > On Jan 14, 12:57 pm, Alexandre Andrade > > > > wrote: > > > > > It don't show at form, without readable=False. > > > > > > I set readable=False, but it don't show the updated value. > > > > > > 2010/1/14 mdipierro > > > > > > > Can you also try set readable=False? > > > > > > > On Jan 14, 9:52 am, mdipierro wrote: > > > > > > > Make sure Field(...,default=None, update=None) > > > > > > > > On Jan 14, 9:47 am, Alexandre Andrade > > > > > > > wrote: > > > > > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > > > > > don't work on updates > > > > > > > > > 2010/1/14 mdipierro > > > > > > > > > > with 1.74.5 and later you only need > > > > > > > > > > db.order_detail.total.compute=lambda r: r['qtd']*r['price'] > > > > > > > > > > On Jan 14, 8:51 am, Alexandre Andrade < > > alexandrema...@gmail.com> > > > > > > > > > wrote: > > > > > > > > > > What is the best solution to automatically calculate a > > total > > > > field? > > > > > > > > > > > db.define_table ('order_detail', > > > > > > > > > > Field('product_name'), > > > > > > > > > > Field('qtd', 'integer'), > > > > > > > > > > Field('price', 'integer'), > > > > > > > > > > Field('total', 'integer', writable=False) > > > > > > > > > > ) > > > > > > > > > > > Where total = qtd * price > > > > > > > > > > > requires and a custom validator? how to do? > > > > > > > > > > onvalidation on form? how to do? > > > > > > > > > > > -- > > > > > > > > > > Atenciosamente > > > > > > > > > > > -- > > > > > > > > > > = > > > > > > > > > > Alexandre Andrade > > > > > > > > > > Hipercenter.com > > > > > > > > > > -- > > > > > > > > > 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. > > > > > > > > > -- > > > > > > > > Atenciosamente > > > > > > > > > -- > > > > > > > > ==
[web2py] Re: Selfreference and IS_IN_DB Pulldown
because these method of the field object used to represent a field value, not to represent the field object themself. there is a __str__ and that is used to represent the field object. one think is >>> print db.table.field another is >>> print db.table.field.represent(row.field) On Jan 14, 2:57 pm, Thadeus Burgess wrote: > > Different names help avoid confusion (or so I hoped). > > huh... > > Why not use the builtin __str__ or __unicode__ of the class to serve as > representation or "format" ? > > -Thadeus > > On Thu, Jan 14, 2010 at 12:38 PM, rfx_labs wrote: > > > > db.define_table(...,format=...) goes into db.table._format > > > Thanks Massimo. Everything works like a charme. > > > Martin > > > -- > > 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. -- 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] Haiti Response - web2py/JQuery Coders & Testers Requested
A message for those people who would like to assist with the Haitian earthquake response in a technical capacity. Please assist with SahanaPy's deployment for orgs responding to the Haitian earthquake. *Motto of story* Visit #sahana in irc freenode. *Objective* We are building a registry of response orgs and their activities here: http://is.gd/6h2IQ *Requests* If you have JQuery ot web2py experience, please visit http://trac.sahanapy.org/wiki/Haiti. If you would like to donate time for data entry or end-user/manual testing please lurk at #sahana on irc freenode. *In Wellington now or will be over the weekend?* For people in Wellington and would like to meetup over the weekend to help, please ping me on Twitter or identi.ca @timClicks. Your time & expertise is really appreciated. Thank you. Tim McNamara @timClicks -- 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.
Re: [web2py] Re: validators, form validation
I cloned web2py and write 2 functions for that http://code.google.com/r/pihentagy-web2py/source/list You can use those classes like that: Field('invoice_date','date', requires=IS_DATE_IN_RANGE(minimum=datetime.date.today(), format='%d/%m/%Y')), Field('settlement_date','datetime', requires=IS_DATETIME_IN_RANGE(minimum=datetime.datetime.now(),format='%H:%M:%S %Y-%m-%d')), I don't know why I do not see the newest version in googlecode (I am not familiar with hg, but I think I managed to commit the changes). Just in case here are they: class IS_DATE_IN_RANGE(IS_DATE): def __init__(self, minimum=None, maximum=None, **args): self.minimum = minimum self.maximum = maximum self.error_message_low = args.pop('error_message_low', 'date should be at least %(min)s') self.error_message_high = args.pop('error_message_high', 'date should be before %(max)s') super(IS_DATE_IN_RANGE,self).__init__(**args) def __call__(self, value): (value, msg) = super(IS_DATE_IN_RANGE,self).__call__(value) if msg is not None: return (value, msg) if self.minimum and self.minimum > value: return (value, self.error_message_low % {'min':self.minimum.strftime(self.format)}) if self.maximum and value >= self.maximum: return (value, self.error_message_high % {'max':self.maximum.strftime(self.format)}) return (value, None) class IS_DATETIME_IN_RANGE(IS_DATETIME): def __init__(self, minimum=None, maximum=None, **args): self.minimum = minimum self.maximum = maximum self.error_message_low = args.pop('error_message_low', 'datetime should be at least %(min)s') self.error_message_high = args.pop('error_message_high', 'datetime should be before %(max)s') super(IS_DATETIME_IN_RANGE,self).__init__(**args) def __call__(self, value): (value, msg) = super(IS_DATETIME_IN_RANGE,self).__call__(value) if msg is not None: return (value, msg) if self.minimum and self.minimum > value: return (value, self.error_message_low % {'min':self.minimum.strftime(self.format)}) if self.maximum and value >= self.maximum: return (value, self.error_message_high % {'max':self.maximum.strftime(self.format)}) return (value, None) +-[ Gergely Kontra ]--+ | | | Mobile:(+36 20)356 9656 | | | +- "Olyan lángész vagyok, hogy poroltóval kellene járnom!" -+ On Mon, Jan 11, 2010 at 20:23, mdipierro wrote: > > > On Jan 11, 11:19 am, pihentagy wrote: >> On Jan 11, 2:57 pm, mdipierro wrote: >> >> > You can create your own field-level validators >> >> > class validator: >> > def __init__(self,error_message): self.error_message=error_message >> > def __call__(self,value): >> > if success: return (value,None) >> > else: return (value,self.error_message) >> >> Yes of course, but I thought some "stock" date validators are worth to >> discuss. There are IS_INT_IN_RANGE and friends, then why not >> IS_DATE_IN_RANGE (maybe with defaults to None for both min and max >> date). > > I would take a patch to include IS_DATE_IN_RANGE > >> > both form.accept and crud.create/crud.update take a parameter >> > onvalidation >> >> > onvalidation can point to a function that takes a form, reads >> > form.vars and writes form.errors >> >> > def f(form): >> > if not form.vars.a==form.vars.b: form.errors.b="should be == a" >> > form = crud.create(, onvalidation = f) >> >> But this way the validation is not built into the form/model :( > > what do you mean? > > -- > 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. > > > > -- 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.
Re: [web2py] Re: Auth on GAE silently fails to login
I went into each corner of my app on dev_appserver and then uploaded to GAE but this didn't change the login behaviour. Let me rebuild my app part by part from a skeleton and find the smallest app that breaks. If I don't figure it out from that I can send you the app that works and the app that breaks. My first task of tomorrow! 2010/1/14 mdipierro > Did you ever try register and login locally with dev-appserver before > uploading on GAE? Perhaps some index is missing and by running > locally, it would re-create the missing index. > Anyway, the behavior is strange and I do not fully understand it. > Could you email me the app? > > > On Jan 14, 12:42 pm, Carl wrote: > > Trying to login after several "counter" calls resets the count. > > > > 2010/1/14 Carl > > > > > I added a function for counter... it works on GAE (and it works locally > > > too) > > > > > 2010/1/14 mdipierro > > > > >> Do your sessions work? > > > > >> can you try a simple counter? > > > > >> def counter(): return dict(c=session.c=(session.c or 0)+1) > > > > >> On Jan 14, 11:50 am, Carl wrote: > > >> > Registering a new user... I can see a new row in GAE's data viewer > but > > >> > once created I don't get automatically logged in (which does happen > > >> > locally). When I then try a login with these new user credentials I > > >> > get the same silent fail. > > > > >> > On Jan 14, 5:32 pm, mdipierro wrote: > > > > >> > > Can you please run a test to better identify the problem. Can you > > >> > > register a new user and try login as the new user? Same problem? > > > > >> > > On Jan 14, 11:01 am, Carl wrote: > > > > >> > > > def user(): > > >> > > > return dict(form=auth()) > > > > >> > > > Locally using SQLite or dev_appserver I can login to my > application. > > >> > > > When I upload to GAE logging in silently fail, I am redirected > from > > >> > > > init/default/user/login to init/default/index and no jquery > flash > > >> > > > message appears. No log entries are added to GAE. > > > > >> > > > In Web2py 1.67.2 login worked. Now in Web2py 1.74.5 it does not. > > >> Sorry > > >> > > > for the large gap between version... releases were thick and > fast at > > >> > > > the end of '09! :) > > > > >> > > > Has anyone has this experience? Any pointers? > > > > >> > > > Functions that don't require a login session execute and return > fine > > >> > > > on GAE. > > > > >> -- > > >> 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. > > -- > 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. > > > > -- 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: Auth on GAE silently fails to login
Can you register and login in the Welcome app? that should be the first test. On Jan 14, 3:43 pm, Carl wrote: > I went into each corner of my app on dev_appserver and then uploaded to GAE > but this didn't change the login behaviour. > > Let me rebuild my app part by part from a skeleton and find the smallest app > that breaks. If I don't figure it out from that I can send you the app that > works and the app that breaks. > > My first task of tomorrow! > > 2010/1/14 mdipierro > > > Did you ever try register and login locally with dev-appserver before > > uploading on GAE? Perhaps some index is missing and by running > > locally, it would re-create the missing index. > > Anyway, the behavior is strange and I do not fully understand it. > > Could you email me the app? > > > On Jan 14, 12:42 pm, Carl wrote: > > > Trying to login after several "counter" calls resets the count. > > > > 2010/1/14 Carl > > > > > I added a function for counter... it works on GAE (and it works locally > > > > too) > > > > > 2010/1/14 mdipierro > > > > >> Do your sessions work? > > > > >> can you try a simple counter? > > > > >> def counter(): return dict(c=session.c=(session.c or 0)+1) > > > > >> On Jan 14, 11:50 am, Carl wrote: > > > >> > Registering a new user... I can see a new row in GAE's data viewer > > but > > > >> > once created I don't get automatically logged in (which does happen > > > >> > locally). When I then try a login with these new user credentials I > > > >> > get the same silent fail. > > > > >> > On Jan 14, 5:32 pm, mdipierro wrote: > > > > >> > > Can you please run a test to better identify the problem. Can you > > > >> > > register a new user and try login as the new user? Same problem? > > > > >> > > On Jan 14, 11:01 am, Carl wrote: > > > > >> > > > def user(): > > > >> > > > return dict(form=auth()) > > > > >> > > > Locally using SQLite or dev_appserver I can login to my > > application. > > > >> > > > When I upload to GAE logging in silently fail, I am redirected > > from > > > >> > > > init/default/user/login to init/default/index and no jquery > > flash > > > >> > > > message appears. No log entries are added to GAE. > > > > >> > > > In Web2py 1.67.2 login worked. Now in Web2py 1.74.5 it does not. > > > >> Sorry > > > >> > > > for the large gap between version... releases were thick and > > fast at > > > >> > > > the end of '09! :) > > > > >> > > > Has anyone has this experience? Any pointers? > > > > >> > > > Functions that don't require a login session execute and return > > fine > > > >> > > > on GAE. > > > > >> -- > > > >> 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. > > > -- > > 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. > > -- 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] uWSGI + Cherokee + web2py - a howto.
Inspired by Phyo Arkar's howto on setting up web2py with Cherokee and FCGI I tried the setup, but was somewhat unsatisfied with the fcgi method and decided to try uWSGI. I am happy I did so, since it proved to be real easy and uWSGI is a real powerhouse and deserves attention of the whole python webdev community. On to the howto. I. Compile from source and run the latest uWSGI, 0.9.3 in my case (available here http://projects.unbit.it/uwsgi/wiki). 1. Download the source from and unzip. 2. To compile you must install packages python-dev and libxml2-dev (at least thats what they are called on a debian-based system) 3. When compiling simply run pick a makefile which matches your OS and python version and run something like "make -f Makefile.Linux.Py26". This produces only one executable named uwsgi26, where 26 is my python version. You can put it in /usr/local/bin. 5. To run it, you have two options: 5a) Create an xml file and call it, for example, config.xml. Put something like this in it: /var/web2py/ wsgihandler In this file "pythonpath" is where your web2py directory is and "script" is the file you want to run, in this case its web2py's "wsgihandler.py". Now run uWSGI like this, but replace "www-data" with the owner of your web2py directory, if its the same as your current user omit the sudo command: sudo -u www-data uwsgi26 -s /tmp/uwsgi.sock -C -x config.xml Why you need to change user is because web2py writes things (session data for example) to disc during execution, so the uwsgi process, which runs the web2py code, has to be the owner of the directories that contain the framework. Note that uwsgi now opened a socket we called "/tmp/uwsgi.sock" About other options consult the uwsgi manual or "uwsgi -h". 5b) You can omit the xml file and pass all the info via command line, doing that is easy, so consult the uwsgi docs :) II. Setting up cherokee (0.99.37 in my case). 1. Install it, run cherokee-admin, go to localhost:9090 2. Open "Information Sources" and create a new one with these parameters: Nick: web2py Connection: /tmp/uwsgi.sock Interpreter: uwsgi26 -s /tmp/uwsgi.sock -C -x /path/to/config.xml The interpreter line is why it is a good idea to have your web2py source owned by www-data or the Cherokee server's user - when cherokee runs it, you can be sure that owners of the sources and process match. And of course put the correct path in. 3. Go to "Virtual Servers" and edit the default one, or you can create a new one, but make sure you give it a domain name to avoid conflict (not really sure what happens when they conflict). 4. Go to the "Behavior" section and edit the "Default" behavior. 5. Set the "Handler" to uWSGI and on the bottom set the information source to "web2py" 6. Pick "Hard restart" from the dropdown on the left and click "Save". TO PREVENT HEADACHE READ THIS: I seem to get inconsistent results with these restarts, so if you're doing production it seems to me that one should restart the server manualy (via /etc/init.d/cherokee restart, that is). Or maybe I should RTFM. 6. Go to localhost and BAM! (or at least I hope its a bam). veeery easy if all goes smooth. "But wait, what about url rewriting?" was my thought, and this caused much confusion, so I'll add a section on that. III. Doing some redirection (I'll give few examples due to poor knowledge of regex). Lets redirect "localhost/" to "/myapp/cntrlr/index" 1. Go back to the "Behavior" section of your server. 2. Add a new rule and set it's type to "Regular Expression" and set the regular expression to "^/$", this simply matches "localhost/" or "localhost", nothing more, nothing less. 3. Go to the "Handler" section and set the rule to "Redirect" with these parameters Type: Internal Regular Expression: (yes, blank) Substitution: /myapp/cntrlr/index The regular expression is blank because for this scenario we did all the matching while defining a new behavior, you can combine the two in creative ways. That's about all. Your imagination should take care of the rest. I, for example, put my static files separately from the framework by creating a behavior that points to "/static" and picking "static files" as the handler. Thanks to Massimo DiPierro for web2py and Phyo Arkar for his cherokee howto. I'm not much of a writer so feel free to ask for clarifications. -- 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: Haiti Response - web2py/JQuery Coders & Testers Requested
Can you post a list of specific tasks that need to be completed? Massimo On Jan 14, 3:28 pm, Tim McNamara wrote: > A message for those people who would like to assist with the Haitian > earthquake response in a technical capacity. Please assist with SahanaPy's > deployment for orgs responding to the Haitian earthquake. > > *Motto of story* > Visit #sahana in irc freenode. > > *Objective* > We are building a registry of response orgs and their activities > here:http://is.gd/6h2IQ > > *Requests* > If you have JQuery ot web2py experience, please > visithttp://trac.sahanapy.org/wiki/Haiti. > If you would like to donate time for data entry or end-user/manual testing > please lurk at #sahana on irc freenode. > > *In Wellington now or will be over the weekend?* > For people in Wellington and would like to meetup over the weekend to help, > please ping me on Twitter or identi.ca @timClicks. > > Your time & expertise is really appreciated. Thank you. > > Tim McNamara > @timClicks -- 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: Haiti Response - web2py/JQuery Coders & Testers Requested
On Jan 14, 10:15 pm, mdipierro wrote: > Can you post a list of specific tasks that need to be completed? Hi Massimo, it's here: > > If you have JQuery ot web2py experience, please visit > > http://trac.sahanapy.org/wiki/Haiti. The best use of your skills would be this one: * Change Password Reset to take users to a password reset page instead of just emailing a new password? * More secure * Upstream in Web2Py Best Wishes, Fran. -- 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: Haiti Response - web2py/JQuery Coders & Testers Requested
Wes James sent me a patch for that some time ago but I lost it. I will try retrieve and apply immediately (assuming I find it or he resends it to me) Massimo On Jan 14, 4:20 pm, Fran wrote: > On Jan 14, 10:15 pm, mdipierro wrote: > > > Can you post a list of specific tasks that need to be completed? > > Hi Massimo, it's here: > > > > If you have JQuery ot web2py experience, please > > > visithttp://trac.sahanapy.org/wiki/Haiti. > > The best use of your skills would be this one: > * Change Password Reset to take users to a password reset page > instead of just emailing a new password? > * More secure > * Upstream in Web2Py > > Best Wishes, > Fran. -- 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.
Re: [web2py] Re: Auth on GAE silently fails to login
yes I can login successfully using Welcome so that does help narrow it down. I start the skeleton build tomorrow! all the best 2010/1/14 mdipierro > Can you register and login in the Welcome app? that should be the > first test. > > On Jan 14, 3:43 pm, Carl wrote: > > I went into each corner of my app on dev_appserver and then uploaded to > GAE > > but this didn't change the login behaviour. > > > > Let me rebuild my app part by part from a skeleton and find the smallest > app > > that breaks. If I don't figure it out from that I can send you the app > that > > works and the app that breaks. > > > > My first task of tomorrow! > > > > 2010/1/14 mdipierro > > > > > Did you ever try register and login locally with dev-appserver before > > > uploading on GAE? Perhaps some index is missing and by running > > > locally, it would re-create the missing index. > > > Anyway, the behavior is strange and I do not fully understand it. > > > Could you email me the app? > > > > > On Jan 14, 12:42 pm, Carl wrote: > > > > Trying to login after several "counter" calls resets the count. > > > > > > 2010/1/14 Carl > > > > > > > I added a function for counter... it works on GAE (and it works > locally > > > > > too) > > > > > > > 2010/1/14 mdipierro > > > > > > >> Do your sessions work? > > > > > > >> can you try a simple counter? > > > > > > >> def counter(): return dict(c=session.c=(session.c or 0)+1) > > > > > > >> On Jan 14, 11:50 am, Carl wrote: > > > > >> > Registering a new user... I can see a new row in GAE's data > viewer > > > but > > > > >> > once created I don't get automatically logged in (which does > happen > > > > >> > locally). When I then try a login with these new user > credentials I > > > > >> > get the same silent fail. > > > > > > >> > On Jan 14, 5:32 pm, mdipierro wrote: > > > > > > >> > > Can you please run a test to better identify the problem. Can > you > > > > >> > > register a new user and try login as the new user? Same > problem? > > > > > > >> > > On Jan 14, 11:01 am, Carl wrote: > > > > > > >> > > > def user(): > > > > >> > > > return dict(form=auth()) > > > > > > >> > > > Locally using SQLite or dev_appserver I can login to my > > > application. > > > > >> > > > When I upload to GAE logging in silently fail, I am > redirected > > > from > > > > >> > > > init/default/user/login to init/default/index and no jquery > > > flash > > > > >> > > > message appears. No log entries are added to GAE. > > > > > > >> > > > In Web2py 1.67.2 login worked. Now in Web2py 1.74.5 it does > not. > > > > >> Sorry > > > > >> > > > for the large gap between version... releases were thick and > > > fast at > > > > >> > > > the end of '09! :) > > > > > > >> > > > Has anyone has this experience? Any pointers? > > > > > > >> > > > Functions that don't require a login session execute and > return > > > fine > > > > >> > > > on GAE. > > > > > > >> -- > > > > >> 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. > > > > > -- > > > 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. > > > > > > -- > 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. > > > > -- 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] authentication / authorization error or a bug???
Hello: I have a problem, I do not know if this is a bug or I'm making something wrong!!! I add this: auth=Auth(globals(),self.db) auth.define_tables() mail=Mail() # mailer mail.settings.server='localhost:25'# your SMTP server mail.settings.sender='y...@gmail.com' # your email mail.settings.login=None # your credentials or None 'username:password' auth.settings.mailer=mail# for user email verification auth.settings.registration_requires_verification = False auth.settings.registration_requires_approval = True auth.messages.verify_email = 'Click on the link http://.../user/verify_email/%(key)s to verify your email' Everything works fine, the problem is when I change the registration_requires_verification to True: auth.settings.registration_requires_verification = True And when I try to register a new user I received this error: Traceback (most recent call last): File "/home/web2py/gluon/restricted.py", line 173, in restricted exec ccode in environment File "/home/web2py/applications/t4/controllers/default.py", line 243, in File "/home/web2py/gluon/globals.py", line 96, in self._caller = lambda f: f() File "/home/web2py/applications/t4/controllers/default.py", line 4, in user return dict(form = t2.auth()) File "/home/web2py/gluon/tools.py", line 698, in __call__ return self.register() File "/home/web2py/gluon/tools.py", line 1167, in register % dict(key=key)): File "/home/web2py/gluon/tools.py", line 258, in send payload['Subject'] = subject.decode(encoding).encode('utf-8') AttributeError: 'lazyT' object has no attribute 'decode' Maybe I'm making something wrong but, I check all my code and I can't find why of this error. Thank you for all your help!!! Best Regards, Victor. -- 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: Several File Upload Using Ajax... Any Example available by any chance ?
I would also find this useful - an example that uploads 0-N files with a button to add additional upload inputs. On Jan 15, 5:12 am, Yannick wrote: > gmail was just an example... Just to explain what I meant... > I basically looking for an example to upload several file at once > (Compatible under https) on web2py platform... > > On Jan 14, 12:27 am, Thadeus Burgess wrote: > > > > > Gmail attachment files uses a flash solution :) > > > It is even noted about the fact flash is required in the settings tab. > > > -Thadeus > > > On Wed, Jan 13, 2010 at 8:33 PM, Yannick wrote: > > > Hello mate, > > > I just wonder if there is an example of several upload file (all at > > > once a little bit like gmail attachment files) with Web2py ? > > > If you know some example... Please let me know... > > > > Cheers, > > > Yannick P. > > > > -- > > > 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. -- 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: authentication / authorization error or a bug???
It is a bug but it is strange this has never shoed up before. Fixing in trunk. On Jan 14, 4:51 pm, "b-global.net" wrote: > Hello: > > I have a problem, I do not know if this is a bug or I'm making > something wrong!!! I add this: > > auth=Auth(globals(),self.db) > auth.define_tables() > mail=Mail() # mailer > mail.settings.server='localhost:25' # your SMTP server > mail.settings.sender='@gmail.com' # your email > mail.settings.login=None # your credentials or None > 'username:password' > auth.settings.mailer=mail # for user email > verification > auth.settings.registration_requires_verification = False > auth.settings.registration_requires_approval = True > auth.messages.verify_email = 'Click on the > linkhttp://.../user/verify_email/%(key)sto verify your email' > > Everything works fine, the problem is when I change the > registration_requires_verification to True: > > auth.settings.registration_requires_verification = True > > And when I try to register a new user I received this error: > > Traceback (most recent call last): > File "/home/web2py/gluon/restricted.py", line 173, in restricted > exec ccode in environment > File "/home/web2py/applications/t4/controllers/default.py", line > 243, in > File "/home/web2py/gluon/globals.py", line 96, in > self._caller = lambda f: f() > File "/home/web2py/applications/t4/controllers/default.py", line 4, > in user > return dict(form = t2.auth()) > File "/home/web2py/gluon/tools.py", line 698, in __call__ > return self.register() > File "/home/web2py/gluon/tools.py", line 1167, in register > % dict(key=key)): > File "/home/web2py/gluon/tools.py", line 258, in send > payload['Subject'] = subject.decode(encoding).encode('utf-8') > AttributeError: 'lazyT' object has no attribute 'decode' > > Maybe I'm making something wrong but, I check all my code and I can't > find why of this error. > > Thank you for all your help!!! > > Best Regards, > > Victor. -- 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.
Re: [web2py] Re: Haiti Response - web2py/JQuery Coders & Testers Requested
Here's the thread: http://groups.google.com/group/web2py/browse_thread/thread/f43363e7c398f0a4/324ad7226080aa8e you had some concerns about my implementation using an extra key field. -wes On Thu, Jan 14, 2010 at 3:41 PM, mdipierro wrote: > Wes James sent me a patch for that some time ago but I lost it. I will > try retrieve and apply immediately (assuming I find it or he resends > it to me) > > Massimo > > On Jan 14, 4:20 pm, Fran wrote: >> On Jan 14, 10:15 pm, mdipierro wrote: >> >> > Can you post a list of specific tasks that need to be completed? >> >> Hi Massimo, it's here: >> >> > > If you have JQuery ot web2py experience, please >> > > visithttp://trac.sahanapy.org/wiki/Haiti. >> >> The best use of your skills would be this one: >> * Change Password Reset to take users to a password reset page >> instead of just emailing a new password? >> * More secure >> * Upstream in Web2Py >> >> Best Wishes, >> Fran. > > -- > 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. > > > > -- 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: Haiti Response - web2py/JQuery Coders & Testers Requested
working on it Thanks. On Jan 14, 5:13 pm, Wes James wrote: > Here's the thread: > > http://groups.google.com/group/web2py/browse_thread/thread/f43363e7c3... > > you had some concerns about my implementation using an extra key field. > > -wes > > On Thu, Jan 14, 2010 at 3:41 PM, mdipierro wrote: > > Wes James sent me a patch for that some time ago but I lost it. I will > > try retrieve and apply immediately (assuming I find it or he resends > > it to me) > > > Massimo > > > On Jan 14, 4:20 pm, Fran wrote: > >> On Jan 14, 10:15 pm, mdipierro wrote: > > >> > Can you post a list of specific tasks that need to be completed? > > >> Hi Massimo, it's here: > > >> > > If you have JQuery ot web2py experience, please > >> > > visithttp://trac.sahanapy.org/wiki/Haiti. > > >> The best use of your skills would be this one: > >> * Change Password Reset to take users to a password reset page > >> instead of just emailing a new password? > >> * More secure > >> * Upstream in Web2Py > > >> Best Wishes, > >> Fran. > > > -- > > 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: authentication / authorization error or a bug???
Thank you Massimo, for all your help!!! Can I help to fix this bug? Also, can I use other email function/class with Auth ? Thank you. Best Regards, Victor -- 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: Anybody going to PyCon?
On Jan 12, 8:02 pm, mdipierro wrote: > I know thay have Financial Assistantships but I guess they are mostly > for students. > They have different rates for hobbists and professionals. The main > discount was for early registration but the deadline has passed. Financial Assistance is _not_ just for students, but it did close a while back (see http://us.pycon.org/2010/registration/financial-aid/) If you have questions about rates for unemployed, and you are seriously considering going to Atlanta, send me a query on pycon- r...@python.org _after you register_ (before you pay). Also, be sure to check out the room sharing page here: http://us.pycon.org/2010/registration/room_sharing/ Regards, Yarko > > I am not going. I am just curious if anybody from our group will be > there. > > Massimo > > On Jan 12, 6:51 pm, Kent Borg wrote: > > > mdipierro wrote: > > > Anybody going toPyCon? > > > Is there a special rate for unemployed folks? > > > -kb -- 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: authentication / authorization error or a bug???
It is already fixed in trunk because of other changes the trunk needs some testing. It would be of great help if you could test if this problem is gone and auth still works. On Jan 14, 5:38 pm, "b-global.net" wrote: > Thank you Massimo, for all your help!!! > > Can I help to fix this bug? > > Also, can I use other email function/class with Auth ? > > Thank you. > > Best Regards, > > Victor -- 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: Haiti Response - web2py/JQuery Coders & Testers Requested
OK. This is done. The solution is very much based on Wes James patch. I took the time to clean up tools.py so I hope I did not introduce new bugs but it is possible. Now bare this me. The convention is a bit complex but we want: - keep backward compatibility - allow people to use the new reset_password if they so choose without change in views - allow people to keep the old functionality if they so choose So now we have two functions: retrieve_password (old) and reset_password (new) retrieve_password emails you a new password, reset_password emails you a token that allows you to change the password when you change it. If you made your own controllers actions you can swap one for the other in your code. reset_password needs to be configured in db.py: auth.messages.reset_password = 'Click on the link http://.../user/reset_password?key=%(key)s to reset your password' If you only use the scaffolding user() action and you set auth.settings.reset_password_requires_verification = True then retrieve_password gets disabled and mapped into reset_password. You can use http:///user/retrieve_password http:///user/reset_password and they will behave the same. This means that other than the settings you will not need to edit your views or menus to change the default behavior. Until this goes in stable this behavior may be subject to chance depending on the feedback I get from users. Please check it and check if Auth is still working fine. This could go in stable as soon as tomorrow if people tells me it is ok. Massimo On Jan 14, 4:20 pm, Fran wrote: > On Jan 14, 10:15 pm, mdipierro wrote: > > > Can you post a list of specific tasks that need to be completed? > > Hi Massimo, it's here: > > > > If you have JQuery ot web2py experience, please > > > visithttp://trac.sahanapy.org/wiki/Haiti. > > The best use of your skills would be this one: > * Change Password Reset to take users to a password reset page > instead of just emailing a new password? > * More secure > * Upstream in Web2Py > > Best Wishes, > Fran. -- 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] Help, What this mean?
I follow this: http://www.web2py.com/AlterEgo/default/show/239 Installing web2py with MySQL on a bare CentOS 5 machine Because we work with Red Hat Enterprise Linux 5. When I run web2py. I see this: web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2010 Version 1.74.6 (2010-01-13 11:12:48) Database drivers available: pysqlite2, MySQL, PostgreSQL Starting cron... please visit: http://127.0.0.1:7713 use "kill -SIGTERM 6581" to shutdown the web2py server But when I try to http://localhost:7713/ I got this Error ticket for "welcome" Ticket 127.0.0.1.2010-01-14.13-39-00.faf5f883-e4f2-48d2-96b6- c1a697eafdfb Error traceback Traceback (most recent call last): File "/home/drayco/web2py/gluon/main.py", line 478, in wsgibase serve_controller(request, response, session) File "/home/drayco/web2py/gluon/main.py", line 178, in serve_controller environment = build_environment(request, response, session) File "/home/drayco/web2py/gluon/compileapp.py", line 248, in build_environment environment['cache'] = Cache(request) File "/home/drayco/web2py/gluon/cache.py", line 358, in __init__ self.disk = CacheOnDisk(request) File "/home/drayco/web2py/gluon/cache.py", line 238, in __init__ storage = shelve.open(self.shelve_name) File "/usr/local/lib/python2.5/shelve.py", line 225, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/usr/local/lib/python2.5/shelve.py", line 209, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/usr/local/lib/python2.5/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/usr/local/lib/python2.5/dbhash.py", line 16, in open return bsddb.hashopen(file, flag, mode) File "/usr/local/lib/python2.5/bsddb/__init__.py", line 310, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') Can any help me? What this mean? -- 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: Help, What this mean?
Never seen this before. which web2py version? Can you try delete everything in the cache folder of your application? On Jan 14, 7:16 pm, drayco wrote: > I follow this: > > http://www.web2py.com/AlterEgo/default/show/239 > Installing web2py with MySQL on a bare CentOS 5 machine > > Because we work with Red Hat Enterprise Linux 5. > > When I run web2py. I see this: > > web2py Enterprise Web Framework > Created by Massimo Di Pierro, Copyright 2007-2010 > Version 1.74.6 (2010-01-13 11:12:48) > Database drivers available: pysqlite2, MySQL, PostgreSQL > Starting cron... > please visit: > http://127.0.0.1:7713 > use "kill -SIGTERM 6581" to shutdown the web2py server > > But when I try tohttp://localhost:7713/ > > I got this > > Error ticket for "welcome" > Ticket 127.0.0.1.2010-01-14.13-39-00.faf5f883-e4f2-48d2-96b6- > c1a697eafdfb > > Error traceback > > Traceback (most recent call last): > File "/home/drayco/web2py/gluon/main.py", line 478, in wsgibase > serve_controller(request, response, session) > File "/home/drayco/web2py/gluon/main.py", line 178, in > serve_controller > environment = build_environment(request, response, session) > File "/home/drayco/web2py/gluon/compileapp.py", line 248, in > build_environment > environment['cache'] = Cache(request) > File "/home/drayco/web2py/gluon/cache.py", line 358, in __init__ > self.disk = CacheOnDisk(request) > File "/home/drayco/web2py/gluon/cache.py", line 238, in __init__ > storage = shelve.open(self.shelve_name) > File "/usr/local/lib/python2.5/shelve.py", line 225, in open > return DbfilenameShelf(filename, flag, protocol, writeback) > File "/usr/local/lib/python2.5/shelve.py", line 209, in __init__ > Shelf.__init__(self, anydbm.open(filename, flag), protocol, > writeback) > File "/usr/local/lib/python2.5/anydbm.py", line 83, in open > return mod.open(file, flag, mode) > File "/usr/local/lib/python2.5/dbhash.py", line 16, in open > return bsddb.hashopen(file, flag, mode) > File "/usr/local/lib/python2.5/bsddb/__init__.py", line 310, in > hashopen > d.open(file, db.DB_HASH, flags, mode) > DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit > (100) exceeded') > > Can any help me? What this mean? -- 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: Help, What this mean?
I slightly changes the behavior in trunk about his. The problem is corrupted cache file. So instead of failing, it will now just log the failure to open the file. You will get an error only if you actually try to use the cache.disk and the file is corrupted. We still need to understand how this can happen. My guess is this can happen if a request takes too long and the web server happens to kill a thread while it is writing on cache.disk. On Jan 14, 7:19 pm, mdipierro wrote: > Never seen this before. which web2py version? > > Can you try delete everything in the cache folder of your application? > > On Jan 14, 7:16 pm, drayco wrote: > > > I follow this: > > >http://www.web2py.com/AlterEgo/default/show/239 > > Installing web2py with MySQL on a bare CentOS 5 machine > > > Because we work with Red Hat Enterprise Linux 5. > > > When I run web2py. I see this: > > > web2py Enterprise Web Framework > > Created by Massimo Di Pierro, Copyright 2007-2010 > > Version 1.74.6 (2010-01-13 11:12:48) > > Database drivers available: pysqlite2, MySQL, PostgreSQL > > Starting cron... > > please visit: > > http://127.0.0.1:7713 > > use "kill -SIGTERM 6581" to shutdown the web2py server > > > But when I try tohttp://localhost:7713/ > > > I got this > > > Error ticket for "welcome" > > Ticket 127.0.0.1.2010-01-14.13-39-00.faf5f883-e4f2-48d2-96b6- > > c1a697eafdfb > > > Error traceback > > > Traceback (most recent call last): > > File "/home/drayco/web2py/gluon/main.py", line 478, in wsgibase > > serve_controller(request, response, session) > > File "/home/drayco/web2py/gluon/main.py", line 178, in > > serve_controller > > environment = build_environment(request, response, session) > > File "/home/drayco/web2py/gluon/compileapp.py", line 248, in > > build_environment > > environment['cache'] = Cache(request) > > File "/home/drayco/web2py/gluon/cache.py", line 358, in __init__ > > self.disk = CacheOnDisk(request) > > File "/home/drayco/web2py/gluon/cache.py", line 238, in __init__ > > storage = shelve.open(self.shelve_name) > > File "/usr/local/lib/python2.5/shelve.py", line 225, in open > > return DbfilenameShelf(filename, flag, protocol, writeback) > > File "/usr/local/lib/python2.5/shelve.py", line 209, in __init__ > > Shelf.__init__(self, anydbm.open(filename, flag), protocol, > > writeback) > > File "/usr/local/lib/python2.5/anydbm.py", line 83, in open > > return mod.open(file, flag, mode) > > File "/usr/local/lib/python2.5/dbhash.py", line 16, in open > > return bsddb.hashopen(file, flag, mode) > > File "/usr/local/lib/python2.5/bsddb/__init__.py", line 310, in > > hashopen > > d.open(file, db.DB_HASH, flags, mode) > > DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit > > (100) exceeded') > > > Can any help me? What this mean? > > -- 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: Anybody going to PyCon?
You probably will not see that at pycon. All web2py talks have been rejected. On Jan 13, 10:11 pm, Jeff Bauer wrote: > If work will let up long enough, I hope to attend ... the > reason I couldn't take advantage of pre-registration discount. > Assuming I'll be there (60%+), I'd like to see what other > people are doing with web2py. > > -Jeff > > On 01/12/2010 06:20 PM, mdipierro wrote: > > > Anybody going to PyCon? > > -- 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.
Re: [web2py] Re: Haiti Response - web2py/JQuery Coders & Testers Requested
I tried this. Got it to send me a link: Click on the link http://127.0.0.1:8000/app/default/user/reset_password?key=1263524904-9fbb5bd1-f0cd-4a1c-ace7-7febaf37e09f to reset your password I click on the link and then it takes me back to the reset password page. (what's the best way to change this topic so it reflects the discussion?) -wes On Thu, Jan 14, 2010 at 5:52 PM, mdipierro wrote: > OK. This is done. The solution is very much based on Wes James patch. > I took the time to clean up tools.py so I hope I did not introduce new > bugs but it is possible. > > Now bare this me. The convention is a bit complex but we want: > > - keep backward compatibility > - allow people to use the new reset_password if they so choose without > change in views > - allow people to keep the old functionality if they so choose > > So now we have two functions: > > retrieve_password (old) and reset_password (new) > > retrieve_password emails you a new password, reset_password emails you > a token that allows you to change the password when you change it. If > you made your own controllers actions you can swap one for the other > in your code. > > reset_password needs to be configured in db.py: > > auth.messages.reset_password = > 'Click on the link http://.../user/reset_password?key=%(key)s to > reset your password' > > If you only use the scaffolding user() action and you set > > auth.settings.reset_password_requires_verification = True > > then retrieve_password gets disabled and mapped into reset_password. > You can use > > http:///user/retrieve_password > http:///user/reset_password > > and they will behave the same. This means that other than the settings > you will not need to edit your views or menus to change the default > behavior. > > Until this goes in stable this behavior may be subject to chance > depending on the feedback I get from users. > > Please check it and check if Auth is still working fine. > > This could go in stable as soon as tomorrow if people tells me it is > ok. > > Massimo > -- 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] Application with hyphen in name not working
Hi, I just installed a new application into Web2Py (haiti-py), but I got "Invalid Request" when I tried to run the application. It also didn't appear on the list of applications on http://127.0.0.1:8000/admin/default/site. However when I took out the hyphen it worked fine. I'm using Windows XP, firefox and running Web2Py from the command line. Not a massive problem, but though someone might like to know about it. Cheers Michael -- 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: Application with hyphen in name not working
hyphens are not allowed in web2py urls. if you call your app haiti_py, you should be able to access it as haiti-py Massimo On Jan 14, 9:27 pm, Michael Howden wrote: > Hi, > I just installed a new application into Web2Py (haiti-py), but I got > "Invalid Request" when I tried to run the application. It also didn't > appear on the list of applications onhttp://127.0.0.1:8000/admin/default/site. > > However when I took out the hyphen it worked fine. > > I'm using Windows XP, firefox and running Web2Py from the command > line. > > Not a massive problem, but though someone might like to know about it. > > Cheers > > Michael -- 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: Haiti Response - web2py/JQuery Coders & Testers Requested
I suggest we move the discussion to another thread and we stop this one. Feel free to open another thread. If will not be able to fix the redirect problem tonight. If you find a fix, plese send it to me or I will fix it tomorrow. Massimo On Jan 14, 9:13 pm, Wes James wrote: > I tried this. Got it to send me a link: > > Click on the link > > http://127.0.0.1:8000/app/default/user/reset_password?key=1263524904-... > > to reset your password > > I click on the link and then it takes me back to the reset password page. > > (what's the best way to change this topic so it reflects the discussion?) > > -wes > > On Thu, Jan 14, 2010 at 5:52 PM, mdipierro wrote: > > OK. This is done. The solution is very much based on Wes James patch. > > I took the time to clean up tools.py so I hope I did not introduce new > > bugs but it is possible. > > > Now bare this me. The convention is a bit complex but we want: > > > - keep backward compatibility > > - allow people to use the new reset_password if they so choose without > > change in views > > - allow people to keep the old functionality if they so choose > > > So now we have two functions: > > > retrieve_password (old) and reset_password (new) > > > retrieve_password emails you a new password, reset_password emails you > > a token that allows you to change the password when you change it. If > > you made your own controllers actions you can swap one for the other > > in your code. > > > reset_password needs to be configured in db.py: > > > auth.messages.reset_password = > > 'Click on the linkhttp://.../user/reset_password?key=%(key)sto > > reset your password' > > > If you only use the scaffolding user() action and you set > > > auth.settings.reset_password_requires_verification = True > > > then retrieve_password gets disabled and mapped into reset_password. > > You can use > > > http:///user/retrieve_password > > http:///user/reset_password > > > and they will behave the same. This means that other than the settings > > you will not need to edit your views or menus to change the default > > behavior. > > > Until this goes in stable this behavior may be subject to chance > > depending on the feedback I get from users. > > > Please check it and check if Auth is still working fine. > > > This could go in stable as soon as tomorrow if people tells me it is > > ok. > > > Massimo > > -- 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: Anybody going to PyCon?
Hi All, PyCon Asia Pacific is happening soon in Singapore. http://apac.pycon.org Massimo, I came to know yesterday that you are on the Programme Team. So, are you planning to come down to SG in June? Submitting any papers? http://pycon.sit.rp.sg/organizing-committee-1 Yesterday at the PUGS, there was a call for Tutorials or Papers. I am planning to propose a tutorial on Web2Py. Appreciate any insghts before I commit to the organizers or PyCon-APAC Regards Anand On Jan 15, 9:33 am, mdipierro wrote: > You probably will not see that at pycon. All web2py talks have been > rejected. > > On Jan 13, 10:11 pm, Jeff Bauer wrote: > > > If work will let up long enough, I hope to attend ... the > > reason I couldn't take advantage of pre-registration discount. > > Assuming I'll be there (60%+), I'd like to see what other > > people are doing with web2py. > > > -Jeff > > > On 01/12/2010 06:20 PM, mdipierro wrote: > > > > Anybody going to PyCon? -- 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: Anybody going to PyCon?
I doubt I will be able to attend but I do not know yet for sure. Massimo On Jan 14, 11:08 pm, Anand Vaidya wrote: > Hi All, > > PyCon Asia Pacific is happening soon in Singapore.http://apac.pycon.org > > Massimo, > > I came to know yesterday that you are on the Programme Team. So, are > you planning to come down to SG in June? Submitting any > papers?http://pycon.sit.rp.sg/organizing-committee-1 > > Yesterday at the PUGS, there was a call for Tutorials or Papers. I am > planning to propose a tutorial on Web2Py. Appreciate any insghts > before I commit to the organizers or PyCon-APAC > > Regards > Anand > > On Jan 15, 9:33 am, mdipierro wrote: > > > You probably will not see that at pycon. All web2py talks have been > > rejected. > > > On Jan 13, 10:11 pm, Jeff Bauer wrote: > > > > If work will let up long enough, I hope to attend ... the > > > reason I couldn't take advantage of pre-registration discount. > > > Assuming I'll be there (60%+), I'd like to see what other > > > people are doing with web2py. > > > > -Jeff > > > > On 01/12/2010 06:20 PM, mdipierro wrote: > > > > > Anybody going to PyCon? > > -- 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: Large datasets
WebGrid can handle large datasets as it limits the query by the page size if the datasource is a Set or Table(s). The performance hit will come in when the filter row is enabled since each filter is a query for all distinct values in a field. I would try disabling the filter row with: grid.enabled_rows.remove('filter') On Jan 14, 9:12 am, Johann Spies wrote: > Is web2py suitable if I want to work with large datasets? > > I am currently developing a database and want to use web2py to make it > available to the client. > > Up to now I was using the shell and appadmin interfaces to the databasis. > > When trying out thewebgrid-slice > fromhttp://www.web2pyslices.com/main/slices/take_slice/39and also the > "Quick Table Management Snippet" > fromhttp://www.web2pyslices.com/main/slices/take_slice/42to develop an > interface to one of the tables containing about 168800 records python > used up all the resources on my computer (more than 3.4G of memory) > and I had to kill the process. > > In both cases I referred to the table as the datasource. > > What I do not understand is that in the appadmin interface I do not > have the same problem. > > How do I prevent web2py loading whole dataset into memory? After all > what is the use of a sql database if the everything is loaded into > RAM? > > Regards > Johann -- 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: Help, What this mean?
which web2py version? 1.7.6 Can you try delete everything in the cache folder of your application? No, I just Install and I try to run it for the first time I try to use the embeded web server I reviewed the folder web2py/applications/welcome/database/ and it is empty Maybe the lib for sqlite doesn't work well Some test that I can do? On 14 ene, 19:31, mdipierro wrote: > I slightly changes the behavior in trunk about his. > > The problem is corrupted cache file. So instead of failing, it will > now just log the failure to open the file. You will get an error only > if you actually try to use the cache.disk and the file is corrupted. > > We still need to understand how this can happen. My guess is this can > happen if a request takes too long and the web server happens to kill > a thread while it is writing on cache.disk. > > On Jan 14, 7:19 pm, mdipierro wrote: > > > Never seen this before. which web2py version? > > > Can you try delete everything in the cache folder of your application? > > > On Jan 14, 7:16 pm, drayco wrote: > > > > I follow this: > > > >http://www.web2py.com/AlterEgo/default/show/239 > > > Installing web2py with MySQL on a bare CentOS 5 machine > > > > Because we work with Red Hat Enterprise Linux 5. > > > > When I run web2py. I see this: > > > > web2py Enterprise Web Framework > > > Created by Massimo Di Pierro, Copyright 2007-2010 > > > Version 1.74.6 (2010-01-13 11:12:48) > > > Database drivers available: pysqlite2, MySQL, PostgreSQL > > > Starting cron... > > > please visit: > > > http://127.0.0.1:7713 > > > use "kill -SIGTERM 6581" to shutdown the web2py server > > > > But when I try tohttp://localhost:7713/ > > > > I got this > > > > Error ticket for "welcome" > > > Ticket 127.0.0.1.2010-01-14.13-39-00.faf5f883-e4f2-48d2-96b6- > > > c1a697eafdfb > > > > Error traceback > > > > Traceback (most recent call last): > > > File "/home/drayco/web2py/gluon/main.py", line 478, in wsgibase > > > serve_controller(request, response, session) > > > File "/home/drayco/web2py/gluon/main.py", line 178, in > > > serve_controller > > > environment = build_environment(request, response, session) > > > File "/home/drayco/web2py/gluon/compileapp.py", line 248, in > > > build_environment > > > environment['cache'] = Cache(request) > > > File "/home/drayco/web2py/gluon/cache.py", line 358, in __init__ > > > self.disk = CacheOnDisk(request) > > > File "/home/drayco/web2py/gluon/cache.py", line 238, in __init__ > > > storage = shelve.open(self.shelve_name) > > > File "/usr/local/lib/python2.5/shelve.py", line 225, in open > > > return DbfilenameShelf(filename, flag, protocol, writeback) > > > File "/usr/local/lib/python2.5/shelve.py", line 209, in __init__ > > > Shelf.__init__(self, anydbm.open(filename, flag), protocol, > > > writeback) > > > File "/usr/local/lib/python2.5/anydbm.py", line 83, in open > > > return mod.open(file, flag, mode) > > > File "/usr/local/lib/python2.5/dbhash.py", line 16, in open > > > return bsddb.hashopen(file, flag, mode) > > > File "/usr/local/lib/python2.5/bsddb/__init__.py", line 310, in > > > hashopen > > > d.open(file, db.DB_HASH, flags, mode) > > > DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit > > > (100) exceeded') > > > > Can any help me? What this mean? -- 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: Anybody going to PyCon?
Do they ever give reasons for the talks being rejected? Just curious. On Jan 14, 9:28 pm, mdipierro wrote: > I doubt I will be able to attend but I do not know yet for sure. > > Massimo > > On Jan 14, 11:08 pm, Anand Vaidya wrote: > > > > > Hi All, > > > PyCon Asia Pacific is happening soon in Singapore.http://apac.pycon.org > > > Massimo, > > > I came to know yesterday that you are on the Programme Team. So, are > > you planning to come down to SG in June? Submitting any > > papers?http://pycon.sit.rp.sg/organizing-committee-1 > > > Yesterday at the PUGS, there was a call for Tutorials or Papers. I am > > planning to propose a tutorial on Web2Py. Appreciate any insghts > > before I commit to the organizers or PyCon-APAC > > > Regards > > Anand > > > On Jan 15, 9:33 am, mdipierro wrote: > > > > You probably will not see that at pycon. All web2py talks have been > > > rejected. > > > > On Jan 13, 10:11 pm, Jeff Bauer wrote: > > > > > If work will let up long enough, I hope to attend ... the > > > > reason I couldn't take advantage of pre-registration discount. > > > > Assuming I'll be there (60%+), I'd like to see what other > > > > people are doing with web2py. > > > > > -Jeff > > > > > On 01/12/2010 06:20 PM, mdipierro wrote: > > > > > > Anybody going to PyCon? -- 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: Anybody going to PyCon?
Wow very Django heavy. That's disappointing. On Jan 14, 10:27 pm, mikech wrote: > Do they ever give reasons for the talks being rejected? Just curious. > > On Jan 14, 9:28 pm, mdipierro wrote: > > > > > I doubt I will be able to attend but I do not know yet for sure. > > > Massimo > > > On Jan 14, 11:08 pm, Anand Vaidya wrote: > > > > Hi All, > > > > PyCon Asia Pacific is happening soon in Singapore.http://apac.pycon.org > > > > Massimo, > > > > I came to know yesterday that you are on the Programme Team. So, are > > > you planning to come down to SG in June? Submitting any > > > papers?http://pycon.sit.rp.sg/organizing-committee-1 > > > > Yesterday at the PUGS, there was a call for Tutorials or Papers. I am > > > planning to propose a tutorial on Web2Py. Appreciate any insghts > > > before I commit to the organizers or PyCon-APAC > > > > Regards > > > Anand > > > > On Jan 15, 9:33 am, mdipierro wrote: > > > > > You probably will not see that at pycon. All web2py talks have been > > > > rejected. > > > > > On Jan 13, 10:11 pm, Jeff Bauer wrote: > > > > > > If work will let up long enough, I hope to attend ... the > > > > > reason I couldn't take advantage of pre-registration discount. > > > > > Assuming I'll be there (60%+), I'd like to see what other > > > > > people are doing with web2py. > > > > > > -Jeff > > > > > > On 01/12/2010 06:20 PM, mdipierro wrote: > > > > > > > Anybody going to PyCon? -- 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: Large datasets
On RDBS, i have code: rows = db(db.cat.id>0).select(orderby=db.cat.name,limitby=(1,10)) but on GAE: rows = db(db.cat.id>0).select() rows = rows.sort(lambda row:row.name) rows = rows[1:10] It spend long time in a large datasets. Is there some other way i can use to make the performance? Regards, Toan. On Jan 15, 12:30 pm, "mr.freeze" wrote: > WebGrid can handle large datasets as it limits the query by the page > size if the datasource is a Set or Table(s). The performance hit will > come in when the filter row is enabled since each filter is a query > for all distinct values in a field. I would try disabling the filter > row with: > > grid.enabled_rows.remove('filter') > > On Jan 14, 9:12 am, Johann Spies wrote: > > > > > Is web2py suitable if I want to work with large datasets? > > > I am currently developing a database and want to use web2py to make it > > available to the client. > > > Up to now I was using the shell and appadmin interfaces to the databasis. > > > When trying out thewebgrid-slice > > fromhttp://www.web2pyslices.com/main/slices/take_slice/39andalso the > > "Quick Table Management Snippet" > > fromhttp://www.web2pyslices.com/main/slices/take_slice/42todevelop an > > interface to one of the tables containing about 168800 records python > > used up all the resources on my computer (more than 3.4G of memory) > > and I had to kill the process. > > > In both cases I referred to the table as the datasource. > > > What I do not understand is that in the appadmin interface I do not > > have the same problem. > > > How do I prevent web2py loading whole dataset into memory? After all > > what is the use of a sql database if the everything is loaded into > > RAM? > > > Regards > > Johann -- 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: Large datasets
This rows = db(db.cat.id>0).select(orderby=db.cat.name,limitby=(1,10)) works on GAE and it is fast. mind that you should start counting at 0, not 1. On Jan 15, 12:44 am, toan75 wrote: > On RDBS, i have code: > rows = db(db.cat.id>0).select(orderby=db.cat.name,limitby=(1,10)) > but on GAE: > rows = db(db.cat.id>0).select() > rows = rows.sort(lambda row:row.name) > rows = rows[1:10] > It spend long time in a large datasets. > Is there some other way i can use to make the performance? > > Regards, > Toan. > > On Jan 15, 12:30 pm, "mr.freeze" wrote: > > > WebGrid can handle large datasets as it limits the query by the page > > size if the datasource is a Set or Table(s). The performance hit will > > come in when the filter row is enabled since each filter is a query > > for all distinct values in a field. I would try disabling the filter > > row with: > > > grid.enabled_rows.remove('filter') > > > On Jan 14, 9:12 am, Johann Spies wrote: > > > > Is web2py suitable if I want to work with large datasets? > > > > I am currently developing a database and want to use web2py to make it > > > available to the client. > > > > Up to now I was using the shell and appadmin interfaces to the databasis. > > > > When trying out thewebgrid-slice > > > fromhttp://www.web2pyslices.com/main/slices/take_slice/39andalsothe > > > "Quick Table Management Snippet" > > > fromhttp://www.web2pyslices.com/main/slices/take_slice/42todevelopan > > > interface to one of the tables containing about 168800 records python > > > used up all the resources on my computer (more than 3.4G of memory) > > > and I had to kill the process. > > > > In both cases I referred to the table as the datasource. > > > > What I do not understand is that in the appadmin interface I do not > > > have the same problem. > > > > How do I prevent web2py loading whole dataset into memory? After all > > > what is the use of a sql database if the everything is loaded into > > > RAM? > > > > Regards > > > Johann > > -- 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: Postgres EXEPTION in web2py
This is to mean, what is called is a database function which has no return value but raises an exception when sth is wrong (don't ask how). So, I want to return the error message as it appears inside the database function, in place of using the try/except option in python. Can I? -- 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] jQuery 1.4 out
http://jquery14.com/day-01/jquery-14 cool! -- 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.