[web2py:10088] Re: ORM to abstractly collect all data in database
Hi Ed, It seems to me that the 'table' object is the small problem: div=DIV() for table_db in db.tables: div.append(H2(table_db)) table=TABLE() table.append(TR(*[TH(field) for field in db[table_db].fields])) for row in db().select(db[table_db].ALL): table.append(TR(*[TD(row[field]) for field in db[table_db].fields])) div.append(table) return div Vidul On Oct 11, 8:16 am, Ed <[EMAIL PROTECTED]> wrote: > Thanks Massimo, > > I tried the code you suggest and received the following error: > > table.append(TR(*[TH(field) for field in db[table].fields])) > KeyError: > > Any idea why? > > Ed > > On Oct 1, 8:13 pm, mdipierro <[EMAIL PROTECTED]> wrote: > > > > > You can but your implementation is not the way to do it. If you have > > html in strings you are doing it wrong. > > Here is how you do it in a view: > > > {{for table in db.tables:}} > > {{=table}} > > {{=db().select(db[table].ALL)}} > > {{pass}} > > > or more exlicitly: > > > {{for table in db.tables:}} > > {{=table}} > > > > {{for field in db[table].fields:}}{{=field}} > > {{for row in db().select(db[table].ALL):}} > > {{for field in db[table].fields:}}{{=row[field]}} > > {{pass}} > > > > {{pass}} > > > this is how you do the same in a controller > > > div=DIV() > > for table in db.tables: > > div.append(H2(table)) > > table=TABLE() > > table.append(TR(*[TH(field) for field in db[table].fields])) > > for row in db().select(db[table].ALL): > > table.append(TR(*[TD(row[field] for field in > > db[table].fields])) > > div.append(table) > > return div > > > On Oct 1, 6:57 pm, JorgeRpo <[EMAIL PROTECTED]> wrote: > > > > why dont you use the template syntax? > > > > Ed wrote: > > > > Hi, > > > > > I want to be able to access, using theORMbut not executesql(), all > > > > the data within my database without knowing the names of the tables or > > > > fields. Essentially, I want code that looks something like this > > > > > for table in MyDb.tables: > > > > html += "" + str(table) + "" # works! > > > > > html += "" > > > > > html += "" > > > > for field in table.fields: # doesn't work > > > > html += "" + str(field.name) + ":" + > > > > "str(field.value)" + "" > > > > html += "" > > > > > for row in table.rows: # doesn't work > > > > html += "" > > > > > for cell in row.cells: > > > > html += "" + str(cell.field.name) + ":" + > > > > "str(cell.field.value)" + "" > > > > > html += "" > > > > > html += "" > > > > > Is that possible (and legal) in Web2py? > > > > > Thanks, > > > > Ed --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:10336] Re: web2py cookbook anyone?
Hi Pystar, Great idea (the best web framework should have such book)! Can I help in some way? Do you think that it will be adequate if the examples resemble the ones from the other MVC cookbooks, because thus we'll make the migration to WEB2PY easier? On Oct 17, 4:31 am, Pystar <[EMAIL PROTECTED]> wrote: > I am compiling a collection of web2py code snippets from this group > and from other sources into an open source web2py cookbook. It will be > released under a GPL license and will be available for download for > free. Any thoughts on this? I have already started work and my email > add is aitoehigie[AT] gmail.com if you wish to send my any code > snippets or suggestions. > Thanks guys. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:11639] Re: web2py 1.48 is OUT
Hi Massimo, Great work as usual. However there is a strange problem when this version runs on GAE: ''' Traceback (most recent call last): File "/base/data/home/apps/krasimira-webspace/1.1/gluon/main.py", line 220, in wsgibase session._try_store_in_db(request,response) File "/base/data/home/apps/krasimira-webspace/1.1/gluon/globals.py", line 194, in _try_store_in_db record_id=table.insert(**dd) File "/base/data/home/apps/krasimira-webspace/1.1/gluon/contrib/ gql.py", line 188, in insert tmp=self._tableobj(**fields) File "/base/python_lib/versions/1/google/appengine/ext/db/ __init__.py", line 555, in __init__ prop.__set__(self, value) File "/base/python_lib/versions/1/google/appengine/ext/db/ __init__.py", line 372, in __set__ value = self.validate(value) File "/base/python_lib/versions/1/google/appengine/ext/db/ __init__.py", line 1757, in validate 'to a Blob instance (%s)' % (self.name, err)) BadValueError: Property session_data must be convertible to a Blob instance (Blob() argument should be str instance, not unicode) ''' The problem disappeared when I downgraded to version 1.44 (I haven't tried 1.47). I guess it is some configuration issue? Thank you, Vidul On Nov 10, 8:31 pm, mdipierro <[EMAIL PROTECTED]> wrote: > I posted web2py 1.48. Many many many small changes. faster and better > than ever. > Please give it a try and check if any of your apps break. > > Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:11965] Re: web2py foundation
Hi Massimo, Splendid idea! I am in. This project will encourage more and more newcomers (I have no doubt). Vidul On Nov 14, 11:01 pm, mdipierro <[EMAIL PROTECTED]> wrote: > Actually I was thinking about something similar but also different. > > I want to create an association of users, not a foundation. The > purpose of the association would be: > > 1) promote the use of free software in general (not just web2py) > 2) select the best open software that works with web2py (cherokee, > linux, postgresql, etc.) > 3) certify members as experts in web2py and in those other software > technologies selected by the members > 4) provide a portal where members (and member companies) can host > their profile and be contacted > 5) help members work together to compete with large consulting > companies for jobs. > 6) help members with legal issues when dealing with clients > 7) maintain a database of projects completed by the members and > accessible to members only > > I want us to compete with this: > > http://www-935.ibm.com/services/us/gbs/bus/html/bcs_index.html > > not with Plone or other small Python projects. > > Think about it. There are more than 600 people on this list, growing > exponentially. We already distributed all over the world. We are all > very skilled people. We are unified by the love for the same > technologies. We do have a better product than the competition. We > only need more organization. Why do we need an employer? In > manufacturing there is a need for capital in order to buy the "means > of production". Thus investors provide capital and get shares of the > revenue in return. We do not need "means of production", we have > laptops, we do not need an office, we do not need investments, and we > do not need to share our profit. We just need to be recognized as > leaders in our field and attract clients. I think we can do that. > > Who is in? > > There are legal issues to be resolved. The web site will be up soon > for people to sign up, take a quiz, and become members. > > Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:11966] Re: SQLFORM, visible data in fields but without update form
I guess Jędrzej means "readony fields". On Nov 17, 3:00 pm, billf <[EMAIL PROTECTED]> wrote: > I'm sorry I don't understand your requirements. > > When you say: "I would like to create SQLFORM with inserts data to db, > but I would > like to see values from database there", which "values from database" > are you referring to"? > > Previous inserted records? then pass a list of records as in the > recipes() method of tutorial > > Values to be used in dropdown lists? then use IS_IN_DB in the model > > Something else? please specify. > > When you say: "I have one "template page" in database ( text, html, > relations, etc... ) ", what does that mean? Do you have a record in a > database table that holds text,html,relations,etc? > > On Nov 17, 12:44 pm, pigmej <[EMAIL PROTECTED]> wrote: > > > > > No, In cookbook there are different things. > > > I'll have something different. > > I have one "template page" in database ( text, html, relations > > etc... ) > > Now i would like to create new page based on this template, without > > selecting many values again ( checkboxes etc ). > > > If I generate SQLFORM() with "values" from database, it generates > > update form, without values from database it generates new empty form. > > > On 16 Lis, 22:46, billf <[EMAIL PROTECTED]> wrote: > > > > Try working through the tutorial in > > > >http://mdp.cti.depaul.edu/examples/static/cookbook.pdf > > > > It provides code examples that probably cover your needs. > > > > On Nov 16, 8:14 pm, Jędrzej Nowak <[EMAIL PROTECTED]> wrote: > > > > > So, I would like to create SQLFORM with inserts data to db, but I would > > > > like to see values from database there. > > > > > I would like to made some kind of template for adding records. > > > > > Is it possible to made with SQLFORM, or must I use my own form (custom > > > > one) > > > > > -- > > > > Pozdrawiam, > > > > Jędrzej Nowak --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:13465] Email problem with T3 on GAE
I am trying to use T3 email sending on GAE with no luck (T3 keeps on saying "unable to send email"). Did anyone try this setup? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:13477] Re: Email problem with T3 on GAE
yes I tried with different settings (with and without authentication/ with smtp.gmail.com:587 and different smtp server). I guess it is the well known GAE problem that prevents smtplib because some low-level socket functions? On Dec 12, 7:30 pm, mdipierro wrote: > did you edit the settings? You are supposed to configure your smtp > server. If you use gmail you need to setup auth params. > > massimo > > On Dec 12, 10:10 am, Vidul Petrov wrote: > > > > > I am trying to use T3 email sending on GAE with no luck (T3 keeps on > > saying "unable to send email"). Did anyone try this setup? > > > Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:13480] Re: print function
redirect(URL(r=request,c='myPrint',f='myPrint',args=[myDict])) # and not f='lprProvv' On Dec 12, 8:03 pm, pmate wrote: > Hi, > using pyrtf i created a new controller called printings.py. > In it i have a function: > def myPrint(): > myDict = request.args[0] > ... > ... > return q.dumps(doc) > > from my default controller i want to call that function passing to it > a dictionary. After it finishes printing i want to get back to my > controller. > How can i do that? > > i tried from default controller to call that function in this way: > redirect(URL(r=request,c='printings',f='lprProvv',args=[myDict])) > > but i get no result: "Invalid request" > > where am i wrong? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py] SQLFORM submission issue
Hi all, I am trying to use a form which does not redirect after its acceptance. However after the submit the new form does not pass through: if form.accepts(request.vars, session): ... elsif form.errors: ... unless the page is reloaded. Is this the expected behavior?
[web2py] Re: SQLFORM submission issue
It was my error, which have nothing to do with Web2py. There is no such issue. On Nov 5, 12:36 am, Vidul Petrov wrote: > Hi all, > > I am trying to use a form which does not redirect after its > acceptance. > However after the submit the new form does not pass through: > > if form.accepts(request.vars, session): > ... > elsif form.errors: > ... > unless the page is reloaded. > Is this the expected behavior?
[web2py] Re: powerTable plugin - video demonstration
Brilliant plugin! Thank you. On Jan 5, 6:20 am, Bruno Rocha wrote: > Video about powerTable on Vimeo (no audio)http://vimeo.com/18447603 > > -- > Bruno Rochahttp://about.me/rochacbruno/bio
[web2py:30388] Re: init app
Hi, Just create the file "routes.py" (there is an example file called "routes.example.py" that can be copied). Then edit the routes_in like this: routes_in = ( ('/', '/records/default/index'), ) That's it. On Sep 8, 12:52 pm, Carlos Aboim wrote: > Hi everyone, > I know if I call my app init that will be the default app. > > But can I have the same default app with a name choosen my be?? > > Not welcome or init, perhaps records > > thanks > Carlos Aboim --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:30389] Lighttpd setup
Hi all, I didn't manage to configure Web2py with this web server (each step was followed and the only result was directory listing, of course when enabled). Here is the configuration file: server.modules = ( "mod_fastcgi", "mod_rewrite" ) ... server.document-root = "/tmp/web2py/" ... fastcgi.server = ( ".fcgi" => ("localhost" => ("min-procs" => 1, "socket" => "/tmp/fcgi.sock" ))) ... Of course I start fcgihandler.py before the restart of lighttp. Any ideas? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:30804] app.yaml default configuration
Hi, I noticed that app.yaml could be improved to include by default the following files in the "skip_files" section: skip_files: | ... (applications/init/errors/.*)| (applications/admin/errors/.*)| (applications/init/sessions/.*)| (applications/admin/sessions/.*)| ... )$ Does this make any sense? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:31103] onvalidation problem
Hi all, There is a problem with "onvalidation" - it works only after redirect unless the form object is explicitly given: onvalidation = assign_some_value_to_a_var(form) Is this a bug or the new behavior of "onvalidation"? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:31104] Re: app.yaml default configuration
Thank you, Massimo. I forgot to mention the "uploads" directory, GAE does not use the filesystem, which makes it useless. On Sep 12, 5:20 pm, mdipierro wrote: > true. uploading to trunk > > On Sep 12, 4:22 am, Vidul Petrov wrote: > > > > > Hi, > > > I noticed thatapp.yamlcould be improved to include by default the > > following files in the "skip_files" section: > > > skip_files: | > > ... > > > (applications/init/errors/.*)| > > (applications/admin/errors/.*)| > > (applications/init/sessions/.*)| > > (applications/admin/sessions/.*)| > > > ... > > )$ > > > Does this make any sense? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:31126] Re: onvalidation problem
For example: # this works: def create_image(): ... if form.accepts(request.vars, session, onvalidation = assign_estate_id(form)): # this does not work until the "delete_image" method redirects to the "create_image" method: if form.accepts(request.vars, session, onvalidation = assign_estate_id): def delete_image(): if db(db.image.id==request.args(0)).delete(): session.flash = T('The image was successfully deleted.') redirect(URL(r=request, f='create_image')) I know that this is not the case with relational databases, but I am using GAE for this application. On Sep 16, 4:05 pm, mdipierro wrote: > Can you show an example of what you mean? I do not think what you say > is the case. > > On Sep 16, 5:22 am, Vidul Petrov wrote: > > > > > Hi all, > > > There is a problem with "onvalidation" - it works only after redirect > > unless the form object is explicitly given: > > > onvalidation = assign_some_value_to_a_var(form) > > > Is this a bug or the new behavior of "onvalidation"? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:31131] Re: onvalidation problem
It's not a GAE issue. The controller's code: # coding: utf8 # ## This is a samples controller ## - index is the default action of any application ## - user is required for authentication and authorization ## - download is for downloading files uploaded in the db (does streaming) ## - call exposes all registered services (none by default) # def index(): session.estate_id = False estates = db(db.estate.id>0).select(orderby=~db.estate.price) return dict(estates=estates) def assign_estate_id(form): form.vars.estate_id = session.estate_id #...@auth.requires_login() def create_estate(): form = SQLFORM(db.estate) if form.accepts(request.vars, session): response.flash = T('The estate was successfully created.') return dict(form=form) #...@auth.requires_login() def edit_estate(): if len(request.args): records = db(db.estate.id==request.args[0]).select() if len(request.args) and len(records): url = URL(r=request, f='create_image') link = URL(r=request, f='index') form = SQLFORM(db.estate, records[0], deletable=False) if form.accepts(request.vars, session): session.flash = T('The estate were successfully edit.') redirect(URL(r=request,args=request.args)) else: redirect(URL(r=request, f='index')) return dict(form=form, estate=records[0]) #...@auth.requires_login() def delete_estate(): if db(db.estate.id==request.args(0)).delete(): session.flash = T('The estate was successfully deleted.') redirect(URL(r=request, f='index')) #...@auth.requires_login() def create_image(): estates = None if not session.estate_id: estates = db(db.estate.id==request.vars.estate_id).select() try: session.estate_id = estates[0].id except: session.flash = T('Please choose a valid estate') redirect(URL(r=request, f='index')) form = SQLFORM(db.image) if form.accepts(request.vars, session, onvalidation = assign_estate_id(form)): response.flash = T('The images were successfully uploaded.') elif form.errors: response.flash = T('Erros occured during the upload process') if not estates: estates = db(db.estate.id==session.estate_id).select() images = db(db.image.estate_id==session.estate_id).select (orderby=db.image.priority) return dict(form=form, images=images, estate=estates[0]) #...@auth.requires_login() def delete_image(): if db(db.image.id==request.args(0)).delete(): session.flash = T('The image was successfully deleted.') redirect(URL(r=request, f='create_image')) #...@auth.requires_login() def edit_image(): if len(request.args): records = db(db.image.id==request.args[0]).select() if len(request.args) and len(records): url = URL(r=request, f='create_image') link = URL(r=request, f='index') form = SQLFORM(db.image, records[0], deletable=False) if form.accepts(request.vars, session, onvalidation = assign_estate_id): session.flash = T('The images were successfully edit.') redirect(URL(r=request,args=request.args)) else: redirect(URL(r=request, f='create_image')) return dict(form=form, image=records[0]) On Sep 16, 9:51 pm, mdipierro wrote: > I need to see the assign_estate_id source and the full body of > controller actions. > I do not think this is a bug, I think this a workflow issue. > > Or are you saying it behaves differently on GAE and non-GAE? > > Massimo > > On Sep 16, 1:32 pm, Vidul Petrov wrote: > > > > > For example: > > > # this works: > > def create_image(): > > ... > > if form.accepts(request.vars, session, > > onvalidation = assign_estate_id(form)): > > > # this does not work until the "delete_image" method redirects to the > > "create_image" method: > > if form.accepts(request.vars, session, > > onvalidation = assign_estate_id): > > > def delete_image(): > > if db(db.image.id==request.args(0)).delete(): > > session.flash = T('The image was successfully deleted.') > > > redirect(URL(r=request, f='create_image')) > > > I know that this is not the case with relational databases, but I am > > using GAE for this application. > > > On Sep 16, 4:05 pm, mdipierro wrote: > > > > Can you show an
[web2py:31422] Web2py prosperity
Hi all, Does it make any sense if I start a website like http://jobs.rubynow.com/ or http://jobs.perl.org/ (the original one actually)? Web2py allows cheap web-hosting like GAE, so we should leave the competition in the dust. Or I am wrong? Plus that Web2py is stable and full-featured MVC (unlike the Rails and personal home page clowns' homework). If you have any arguments arguments against my opinion that can be proven - please share, this will make me switch to the infamous MVCs (Rails, Mason, etc) again. Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:31570] Re: Web2py prosperity
Hi Richard, My aim is to focus on Web2py jobs, it incredibly stable MVC, but still no real examples. I am on my way to build a new AI system (the back-end in Python (of course) and the front-end in Web2py) which will probably change the whole development process. My point is that an MVC like Wbe2py should imply a totally automated building blocks. Most of the developers will be angry with me, because (according to them) the software development is an art. Wrong. The software development is a craft, a very old one, hence everything can be automated. It's final time for the next step - total automation (again - I am speaking about the building blocks, not about the terminators). There are (IMHO) only two niches, that will stay alive - the system administration and the graphic/industrial design. I'll do my best to create the website about Web2py jobs ASAP. Regards, Vidul On Sep 22, 3:21 am, Richard wrote: > hi Vidul, > > do you intend to use a subdomain of web2py.com (eg jobs.web2py.com), > or something independant? > > I only remember 3 threads over the last year advertising web2py work, > so I hope there is increased demand in the future. > Do you think this jobs site could include something like > djangopeople.net where web2py developers can create a profile? I put > my own profile on djangopeople.net and receive an email every few > months, usually from a company in my city. > > Richard > > On Sep 22, 6:18 am, Vidul Petrov wrote: > > > > > Hi all, > > > Does it make any sense if I start a website likehttp://jobs.rubynow.com/ > > orhttp://jobs.perl.org/(theoriginal one actually)? > > > Web2py allows cheap web-hosting like GAE, so we should leave the > > competition in the dust. Or I am wrong? > > Plus that Web2py is stable and full-featured MVC (unlike the Rails and > > personal home page clowns' homework). > > If you have any arguments arguments against my opinion that can be > > proven - please share, this will make me switch to the infamous MVCs > > (Rails, Mason, etc) again. > > > Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32179] change password bug on GAE
Hi all, I am getting the following error on GAE while trying to change the password (all other methods work): In FILE: /base/data/home/apps/spain-estates/1.336749493957536875/ applications/init/controllers/default.py Traceback (most recent call last): File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ restricted.py", line 178, in restricted exec ccode in environment File "/base/data/home/apps/spain-estates/1.336749493957536875/ applications/init/controllers/default.py:user", line 182, in File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ globals.py", line 102, in self._caller = lambda f: f() File "/base/data/home/apps/spain-estates/1.336749493957536875/ applications/init/controllers/default.py:user", line 156, in user File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ tools.py", line 489, in __call__ return self.change_password() File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ tools.py", line 1244, in change_password self.messages.mismatched_password)])) File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ sqlhtml.py", line 866, in factory return SQLFORM(SQLDB(None).define_table('no_table', *fields), File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ sql.py", line 674, in __init__ os.mkdir(self._folder) AttributeError: 'module' object has no attribute 'mkdir' A temporary fix (only for GAE): 672,674c672,674 < if self._folder: < if not os.path.exists(self._folder): < os.mkdir(self._folder) --- > #if self._folder: > #if not os.path.exists(self._folder): > #os.mkdir(self._folder) Any idea what is confusing Web2py to think that it is not 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 web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32195] Re: change password bug on GAE
Yes, my model is untouched: if request.env.web2py_runtime_gae:# if running on Google App Engine db = DAL('gae') # connect to Google BigTable session.connect(request, response, db=db) # and store sessions and tickets there ### or use the following lines to store sessions in Memcache # from gluon.contrib.memdb import MEMDB # from google.appengine.api.memcache import Client # session.connect(request, response, db=MEMDB(Client()) else: # else use a normal relational database db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB ## if no need for session # session.forget() Everything works except this method. On Oct 4, 3:24 pm, mdipierro wrote: > You are right. It seems to think it is not on GAE. > > Do you have this in your model? > > if request.env.web2py_runtime_gae: > db = DAL('gae') > session.connect(request, response, db=db) > else: > db = DAL('sqlite://storage.sqlite') > > On Oct 4, 2:33 am, Vidul Petrov wrote: > > > > > Hi all, > > > I am getting the following error on GAE while trying to change the > > password (all other methods work): > > > In FILE: /base/data/home/apps/spain-estates/1.336749493957536875/ > > applications/init/controllers/default.py > > > Traceback (most recent call last): > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > restricted.py", line 178, in restricted > > exec ccode in environment > > File "/base/data/home/apps/spain-estates/1.336749493957536875/ > > applications/init/controllers/default.py:user", line 182, in > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > globals.py", line 102, in > > self._caller = lambda f: f() > > File "/base/data/home/apps/spain-estates/1.336749493957536875/ > > applications/init/controllers/default.py:user", line 156, in user > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > tools.py", line 489, in __call__ > > return self.change_password() > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > tools.py", line 1244, in change_password > > self.messages.mismatched_password)])) > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > sqlhtml.py", line 866, in factory > > return SQLFORM(SQLDB(None).define_table('no_table', *fields), > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > sql.py", line 674, in __init__ > > os.mkdir(self._folder) > > AttributeError: 'module' object has no attribute 'mkdir' > > > A temporary fix (only for GAE): > > > 672,674c672,674 > > < if self._folder: > > < if not os.path.exists(self._folder): > > < os.mkdir(self._folder) > > --- > > > > # if self._folder: > > > # if not os.path.exists(self._folder): > > > # os.mkdir(self._folder) > > > Any idea what is confusing Web2py to think that it is not 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 web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:32203] Re: change password bug on GAE
If the database directory is uploaded the issue is gone. Thank you for the help. On Oct 4, 5:04 pm, mdipierro wrote: > It is not working because you are not uploading the database folder > for your applications. The database folder is supposed to be there and > be empty. Did you edit the app.yaml file to prevent upload? If not > than there is a bug in the default app.yaml file. > > Massimo > > On Oct 4, 8:27 am, Vidul Petrov wrote: > > > > > Yes, my model is untouched: > > > if request.env.web2py_runtime_gae: # if running on Google > > App Engine > > db = DAL('gae') # connect to Google > > BigTable > > session.connect(request, response, db=db) # and store sessions and > > tickets there > > ### or use the following lines to store sessions in Memcache > > # from gluon.contrib.memdb import MEMDB > > # from google.appengine.api.memcache import Client > > # session.connect(request, response, db=MEMDB(Client()) > > else: # else use a normal > > relational database > > db = DAL('sqlite://storage.sqlite') # if not, use SQLite or > > other DB > > ## if no need for session > > # session.forget() > > > Everything works except this method. > > > On Oct 4, 3:24 pm, mdipierro wrote: > > > > You are right. It seems to think it is not on GAE. > > > > Do you have this in your model? > > > > if request.env.web2py_runtime_gae: > > > db = DAL('gae') > > > session.connect(request, response, db=db) > > > else: > > > db = DAL('sqlite://storage.sqlite') > > > > On Oct 4, 2:33 am, Vidul Petrov wrote: > > > > > Hi all, > > > > > I am getting the following error on GAE while trying to change the > > > > password (all other methods work): > > > > > In FILE: /base/data/home/apps/spain-estates/1.336749493957536875/ > > > > applications/init/controllers/default.py > > > > > Traceback (most recent call last): > > > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > > > restricted.py", line 178, in restricted > > > > exec ccode in environment > > > > File "/base/data/home/apps/spain-estates/1.336749493957536875/ > > > > applications/init/controllers/default.py:user", line 182, in > > > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > > > globals.py", line 102, in > > > > self._caller = lambda f: f() > > > > File "/base/data/home/apps/spain-estates/1.336749493957536875/ > > > > applications/init/controllers/default.py:user", line 156, in user > > > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > > > tools.py", line 489, in __call__ > > > > return self.change_password() > > > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > > > tools.py", line 1244, in change_password > > > > self.messages.mismatched_password)])) > > > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > > > sqlhtml.py", line 866, in factory > > > > return SQLFORM(SQLDB(None).define_table('no_table', *fields), > > > > File "/base/data/home/apps/spain-estates/1.336749493957536875/gluon/ > > > > sql.py", line 674, in __init__ > > > > os.mkdir(self._folder) > > > > AttributeError: 'module' object has no attribute 'mkdir' > > > > > A temporary fix (only for GAE): > > > > > 672,674c672,674 > > > > < if self._folder: > > > > < if not os.path.exists(self._folder): > > > > < os.mkdir(self._folder) > > > > --- > > > > > > # if self._folder: > > > > > # if not os.path.exists(self._folder): > > > > > # os.mkdir(self._folder) > > > > > Any idea what is confusing Web2py to think that it is not 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 web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:33057] Re: The first page on App Engine
I didn't manage to reproduce this issue, everything works fine. Here is my ENV - User-agent: appcfg_py/1.2.3 Linux/2.6.28-15-generic Python/2.5.4.final.0 Please paste the content of index.html. On Oct 17, 12:48 am, BearXu wrote: > I modified the init/default/index as > redirect(URL(a='myapp',c='default',f='index')) > it is ok in the web2py server when i visithttp://localhost:8080/, it will > automatically redirect to the myapp/default/index > > But when I use dev_server 1.2.7 to test it in Windows, Python 2.5 > visithttp://localhost:8080/ > the error is: > Internal errorTicket issued: unrecoverable > > 2009/10/16 mdipierro > > > > > > > what does it mean fail? what is the error? what is the app? what > > version of python? what id the version of appserver? what is the os? > > > On Oct 16, 3:17 pm, BearXu wrote: > > > it also fail on dev_server > > > > 2009/10/16 BearXu > > > > > Suppose I have an app named 'myapp' and I delete the 'welcome' app and > > buid > > > > a new app named 'init' putting redirect in its index func.It pass the > > test > > > > local but fail on GAE. > > > > Can anybody help? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:34972] Re: Join web2py wave
I got "Internal Error" while trying http://wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2521w%252BDPsJaggYA On Nov 4, 8:54 am, hcvst wrote: > http://wavedirectory.appspot.com/init/default/wave?w=googlewave.com%2... > > A public wave to discuss wave development on web2py. > > HC --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:35909] Re: Howto to make your own layouts
This is great! Are there any manuals about the new plugin system? On Nov 9, 8:11 pm, mdipierro wrote: > I would love to see some layouts using it. > Could you send me some exmaples? > > On Nov 9, 12:07 pm, Vasile Ermicioi wrote: > > > > > Since web2py already have jquery included why not using jquery UI css > > framework > > ?http://jqueryui.pbworks.com/jQuery-UI-CSS-Frameworkhttp://jqueryui.co... > > > On Mon, Nov 9, 2009 at 7:06 PM, david bain wrote: > > > Massimo, > > > This is very useful. An excellent start to the plugin system. > > > > On Mon, Nov 9, 2009 at 11:55 AM, mdipierro wrote: > > > >> Assuming the 408 layouts inhttp://web2py.com/layoutsarenot enough > > >> you can use this: > > > >>http://code.google.com/p/web2py/source/browse/trunk/scripts/layout_ma... > > > >> It would be nice if somebody where to start a business of hosting > > >> web2py layouts. ;-) > > > >> Massimo > > > > -- > > > SplashStart - Professional Websites. Starting Now. > > >http://www.splashstart.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 -~--~~~~--~~--~--~---
[web2py] Re: infoworld put web2py in the top of python frameworks
Congratulations! It was high time for such recognition :-) On Aug 10, 2:28 pm, Martín Mulone wrote: > http://www.infoworld.com/d/application-development/pillars-python-six... > > -- > http://martin.tecnodoc.com.ar
[web2py] question about DAL and many objects for the same database
Could it be an issue if there are many DAL objects for the same database (the RDBMS in usage is Postgres)?
[web2py] Re: update=request.now not working
Yes, unfortunately this is broken in stable. On Aug 24, 11:14 pm, Massimo Di Pierro wrote: > Is this broken in stable? > > On Aug 24, 1:17 pm, JimK wrote: > > > > > > > > > Aha! This was driving me crazy yesterday! > > > Thanks for looking into the issue. > > > Jim > > > On Aug 23, 8:21 pm, Massimo Di Pierro > > wrote: > > > > oops...fixed in trunk. Please check it. > > > > On Aug 23, 7:31 pm, pbreit wrote: > > > > > I believe this change is > > > > responsible:http://code.google.com/p/web2py/source/detail?r=8b75dd7c4554c3fd1e5f7...
[web2py:25196] Re: Announcing my first web2py app
Thank you, samwyse! On Jun 27, 4:47 am, samwyse wrote: > On your fist page: "We firmly beleive" => "We firmly believe" > I'd fix it ASAP. > > On Jun 26, 10:11 am, Vidul wrote: > > > > > Congratulations! > > > Though a lot simpler than yours, here is my first WEB2PY application > > (runs on GAE)https://loadinfo-net.appspot.com > > > On Jun 26, 5:51 pm, weheh wrote: > > > > Oh, I forgot, sorry. The website ishttp://www.spinyc.com. I guess I > > > didn't include the URL because it would seem like a tease. The > > > reservations system is only available to club members who are logged > > > in. So tehre's not much to see. Sorry! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25199] Re: Announcing my first web2py app
Hi Massimo, Thank you very much! The images in the "about" page are fixed. Regards, Vidul On Jun 26, 7:20 pm, mdipierro wrote: > Hi Vidul, > > since this is a consulting company, let me know if you want to be > listed as an "affiliated company" on the web2py site, i.e. a company > that does web2py support. > > The images in page:https://loadinfo-net.appspot.com/init/default/about > are hard to see because they are white. > > Massimo > > On Jun 26, 10:11 am, Vidul wrote: > > > > > Congratulations! > > > Though a lot simpler than yours, here is my first WEB2PY application > > (runs on GAE)https://loadinfo-net.appspot.com > > > On Jun 26, 5:51 pm, weheh wrote: > > > > Oh, I forgot, sorry. The website ishttp://www.spinyc.com. I guess I > > > didn't include the URL because it would seem like a tease. The > > > reservations system is only available to club members who are logged > > > in. So tehre's not much to see. Sorry! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25489] DAL Validators and Widgets confusion
Hi, While testing some of the exmaples from the latest manual, the IS_IN_SET() validator confused me: db.define_table("person", SQLField("gender", notnull=True), SQLField("desserts", notnull=True)) db.person.gender.requires = IS_IN_SET(("Male","Female")) db.person.gender.widget = SQLFORM.widgets.radio.widget db.person.desserts.requires = IS_IN_SET(("Profiteroles","Tiramisu"), multiple=False) db.person.desserts.widget = SQLFORM.widgets.checkboxes.widget The validation is passed even if I choose no gender and no desserts. Is this a normal behavior? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25503] Re: DAL Validators and Widgets confusion
Thank you, Fran, The same result - it does not matter if the argument is a list or a tuple. The problem is that I cannot make the validation work when no element is chosen. On Jul 2, 6:53 pm, Fran wrote: > On Jul 2, 3:29 pm, Vidul Petrov wrote: > > > db.person.gender.requires = IS_IN_SET(("Male","Female")) > > IS_IN_SET(['Male', 'Female']) > > F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25505] Re: DAL Validators and Widgets confusion
My point is that the widgets bypass the validators. On Jul 2, 6:53 pm, Fran wrote: > On Jul 2, 3:29 pm, Vidul Petrov wrote: > > > db.person.gender.requires = IS_IN_SET(("Male","Female")) > > IS_IN_SET(['Male', 'Female']) > > F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25514] Re: DAL Validators and Widgets confusion
Thank you, Massimo! Is the problem in sqlhtml.py (class OptionsWidget) ? On Jul 2, 8:55 pm, mdipierro wrote: > Yes there is a problem. This will probably not be fixed today but > within the week. > > Massimo > > On Jul 2, 11:21 am, Vidul Petrov wrote: > > > > > My point is that the widgets bypass the validators. > > > On Jul 2, 6:53 pm, Fran wrote: > > > > On Jul 2, 3:29 pm, Vidul Petrov wrote: > > > > > db.person.gender.requires = IS_IN_SET(("Male","Female")) > > > > IS_IN_SET(['Male', 'Female']) > > > > F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25540] Menu and "active" CSS class
Hi, Given that I have a menu like: response.menu = [ ['Home', request.function=='index', URL(request.application,'default','index'), []], ['New Post', request.function=='create', URL(request.application,'default','create'), []], ] the "active" link does not work unless I copy this addition from an older SVN revision in "html.py": diff -a gluon/html.py ~/web2py-read-only/gluon/html.py 1270,1273c1270 < if active: < li = LI(A(name, _href=link, _class="active")) < else: < li = LI(A(name, _href=link)) --- > li = LI(A(name, _href=link)) I am wondering why this addition was removed, probably there is a better way to implement the menu? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25616] GAE error
Hi, Anybody any idea about the following error (it appears only in one method)? E 07-04 12:21AM 09.771 Traceback (most recent call last): File "/base/data/home/apps/loadinfo-net/2.334535432559265741/gluon/ restricted.py", line 98, in restricted exec ccode in environment File "/base/data/home/apps/loadinfo-net/2.334535432559265741/ applications/init/views/default/services.html", line 148, in File "/base/data/home/apps/loadinfo-net/2.334535432559265741/gluon/ languages.py", line 130, in __call__ write_dict(self.lang_file, self.t) File "/base/data/home/apps/loadinfo-net/2.334535432559265741/gluon/ languages.py", line 42, in write_dict f = open(filename, 'w') IOError: invalid mode: w I am pretty sure that's not WEB2PY error. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25617] Re: GAE error
Actually this happens only in the translation, when I removed some duplicated records the problem was fixed. Strange. On Jul 4, 10:32 am, Vidul Petrov wrote: > Hi, > > Anybody any idea about the following error (it appears only in one > method)? > > E 07-04 12:21AM 09.771 > Traceback (most recent call last): > File "/base/data/home/apps/loadinfo-net/2.334535432559265741/gluon/ > restricted.py", line 98, in restricted > exec ccode in environment > File "/base/data/home/apps/loadinfo-net/2.334535432559265741/ > applications/init/views/default/services.html", line 148, in > File "/base/data/home/apps/loadinfo-net/2.334535432559265741/gluon/ > languages.py", line 130, in __call__ > write_dict(self.lang_file, self.t) > File "/base/data/home/apps/loadinfo-net/2.334535432559265741/gluon/ > languages.py", line 42, in write_dict > f = open(filename, 'w') > IOError: invalid mode: w > > I am pretty sure that's not WEB2PY error. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25626] Re: No ticket issues ?
Hi, I saw no similar issues on NT 5.0 and above. Are you sure that it's an WEB2PY issue? On Jul 4, 5:46 pm, Fauché JM wrote: > Hello, > Since I install 1.65.0 (for windows) I can't read tickets issues ! > The link for ticket appear ,but when clicking on it, it call another > link for another ticket(admin one).on so on. > > Is it a bug ? Am I alone in this case? > Jean-Marc --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25660] Re: GAE error
That's true - it's web2py 1.59. Thank you. On Jul 4, 7:12 pm, mdipierro wrote: > On a second look. I think you may be using an old web2py or perhaps an > old gaehandler.py > > On Jul 4, 2:32 am, Vidul Petrov wrote: > > > > > Hi, > > > Anybody any idea about the following error (it appears only in one > > method)? > > > E 07-04 12:21AM 09.771 > > Traceback (most recent call last): > > File "/base/data/home/apps/loadinfo-net/2.334535432559265741/gluon/ > > restricted.py", line 98, in restricted > > exec ccode in environment > > File "/base/data/home/apps/loadinfo-net/2.334535432559265741/ > > applications/init/views/default/services.html", line 148, in > > File "/base/data/home/apps/loadinfo-net/2.334535432559265741/gluon/ > > languages.py", line 130, in __call__ > > write_dict(self.lang_file, self.t) > > File "/base/data/home/apps/loadinfo-net/2.334535432559265741/gluon/ > > languages.py", line 42, in write_dict > > f = open(filename, 'w') > > IOError: invalid mode: w > > > I am pretty sure that's not WEB2PY error. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:25999] Re: new chapters for the book CRUD and AUTH
That's splendid, Massimo! Thank you! On Jul 7, 3:09 am, Massimo Di Pierro wrote: > Here are two very very draft chapters for the second edition of the > book. > Chapter 7 has been amended to include CRUD > Chapter 8 has been added and discusses AUTH > > This is very draft because I just wrote, I did not not update/add > screenshots and I did not even read it back. This means it is will of > typos. > I will appreciate if you could help me proof read it and perhaps try > some of the examples. > > web2py_manual_7&8.pdf > 1317KViewDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26712] Re: The 80/20 rule
Hi Massimo, I fully agree, everything is very well said IMHO. Only one small addition - most of the MVC users have never even heard about most of the features (not to mention the rich set that WEB2PY offers). Do you think that a website for WEB2PY like jobs.perl.org and jobs.rubynow.com would help (probably some sample works should be shown there also)? Regards, Vidul On Jul 17, 5:49 am, mdipierro wrote: > Pareto (http://en.wikipedia.org/wiki/Pareto_principle) once said that > 80% of effects come from 20% of causes. For software we can re-phrase > as 80% of users use only 20% of features. > > These are not at all a scientific statements but you understand what > they mean. > > We can add more and more features to web2py with the effect that: > - web2py grows in complexity to the point that it becomes harder to > maintain > - web2py gets slower > - I spend all my time reviewing patches instead of improving > documentation > - You spend all your time thinking how to improve web2py instead of > building applications with it > - Many of these improvement will not buy us a significant number of > users. > > I am not trying to discourage people from submitting patches and I > very very much appreciate people who have done so. Most if not all the > patches that I have received were good and needed. I am sure I will > continue to receive excellent patches. > > Yet, when discussing the roadmap it has to be clear that the point > should not be adding new features. The goal should be locking existing > features: make sure they are well documented, make sure there are no > problems, make sure everything has tests. > > We also need a plugin system but that is not a new web2py feature. > That is a set of specifications and naming conventions for writing > models/views/controllers. It is possible that we may have to modify > admin as result of these specs (in order to apply/remove plugins). > > Finally, this community has to do a better job at outreach. You should > talk to your friends and blog about web2py. You must talk about the > applications you build with it. We do not lack developers. We lack > salesmen. This is not because we want to have more user but because > more users means web2py is tested more, there will be more web2py > jobs, and you (as early adopters) will have a better chance to sell > your web2py based solutions. > > Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:26718] Re: The 80/20 rule
I suggest a similar website (actually the latter is a total copy of the former), the work will be a motivation for many people to start learning WEB2PY. Also short intros to WEB2PY - probably what / how / when can be done (more or less a cookbook). And last but not least - how can anyone find a work with WEB2PY - there are no projects, no search and demand announced, at least not officially? On Jul 17, 6:24 am, mdipierro wrote: > I am not familiar with those web sites. What do you suggest? > > On Jul 16, 10:18 pm, Vidul Petrov wrote: > > > > > Hi Massimo, > > > I fully agree, everything is very well said IMHO. > > > Only one small addition - most of the MVC users have never even heard > > about most of the features (not to mention the rich set that WEB2PY > > offers). > > > Do you think that a website for WEB2PY like jobs.perl.org and > > jobs.rubynow.com would help (probably some sample works should be > > shown there also)? > > > Regards, > > Vidul > > > On Jul 17, 5:49 am, mdipierro wrote: > > > > Pareto (http://en.wikipedia.org/wiki/Pareto_principle) once said that > > > 80% of effects come from 20% of causes. For software we can re-phrase > > > as 80% of users use only 20% of features. > > > > These are not at all a scientific statements but you understand what > > > they mean. > > > > We can add more and more features to web2py with the effect that: > > > - web2py grows in complexity to the point that it becomes harder to > > > maintain > > > - web2py gets slower > > > - I spend all my time reviewing patches instead of improving > > > documentation > > > - You spend all your time thinking how to improve web2py instead of > > > building applications with it > > > - Many of these improvement will not buy us a significant number of > > > users. > > > > I am not trying to discourage people from submitting patches and I > > > very very much appreciate people who have done so. Most if not all the > > > patches that I have received were good and needed. I am sure I will > > > continue to receive excellent patches. > > > > Yet, when discussing the roadmap it has to be clear that the point > > > should not be adding new features. The goal should be locking existing > > > features: make sure they are well documented, make sure there are no > > > problems, make sure everything has tests. > > > > We also need a plugin system but that is not a new web2py feature. > > > That is a set of specifications and naming conventions for writing > > > models/views/controllers. It is possible that we may have to modify > > > admin as result of these specs (in order to apply/remove plugins). > > > > Finally, this community has to do a better job at outreach. You should > > > talk to your friends and blog about web2py. You must talk about the > > > applications you build with it. We do not lack developers. We lack > > > salesmen. This is not because we want to have more user but because > > > more users means web2py is tested more, there will be more web2py > > > jobs, and you (as early adopters) will have a better chance to sell > > > your web2py based solutions. > > > > Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27019] Does CRON work on GAE?
Probably this topic has been discussed in the past, but I wasn't able to find anything. The cron script works fine (it's implemented as a controller method) unless running in the GAE testing environment. The username in app.yml is web2py, the same goes for the username in "crontab" file. Thank you for the help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27215] Re: Does CRON work on GAE?
It turnes out that the GAE cron daemon does the same work if it comes to a method invocation (should be a valid URL). I.e. there is no need for conversion. The problem, as I see it, is the method protection, what I did is something like: # the GAE cron file: # /cron.yaml cron: - description: daily note addition url: /test/default/insert_a_note schedule: every 1 days # the default.py controller in init app # for some reasons Google uses this ip: valid_inner_ip = "0.1.0.1" def insert_a_note(): if request.env.remote_addr != valid_inner_ip: redirect(URL(r=request,f="index")) ... db.note.insert(name=some_new_name) ... That's all. On Jul 21, 1:16 pm, AchipA wrote: > Hm, if I understand correctly, we just need a smart crontab ->cron.yaml > converter then, right ? I can imagine other people needing > that too, so there might alredy be such things in the open, could > someone verify that ? > > On Jul 21, 11:58 am, Hans Donner wrote: > > > > >gaehas its own implemementation > > > -http://code.google.com/appengine/docs/python/config/cron.html > > -http://code.google.com/appengine/docs/python/config/queue.html > > -http://code.google.com/appengine/docs/python/taskqueue/ > > > perhaps some kind of remapping (like cache) can do the trick > > > On Tue, Jul 21, 2009 at 11:39, AchipA wrote: > > > >GAEis not supported at the moment, but only because I don't use it > > > and there was no particular interest in it so far. IfGAEhas no means > > > of startingcron-style or long running processes, softcronshould > > > stil work, provided someone implements a locking mechanism that works > > > withGAE. The current implementation uses file operations as they are > > > universal on all platforms (i.e. move file is atomic - that's what the > > > infamouscron.master is for). Now, AFAIK this would not work onGAE, > > > but if you give/write an example that would replace that conditional > > > in aGAE-friendly way it should be no fus to gaincrononGAEout of > > > the box. > > > > On Jul 21, 7:03 am, Vidul Petrov wrote: > > >> Probably this topic has been discussed in the past, but I wasn't able > > >> to find anything. > > >> Thecronscript works fine (it's implemented as a controller method) > > >> unless running in theGAEtesting environment. > > >> The username in app.yml is web2py, the same goes for the username in > > >> "crontab" file. > > > >> Thank you for the help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27216] Re: temporary table
The implementation of temporary tables is not MVC, but RDBMS specific. On Jul 23, 12:36 am, Fran wrote: > On Jul 22, 9:41 pm, rb wrote: > > > If you are using SQLite then you could create a db in memory and keep > > your temp table there. You can create the table outside of web2py and > > then in your SQLDB call you can add the parameter migrate=False to > > import the db into web2py. > > I guess you could achieve something similar by storing your temporary > data in either the Cache or the Session? > > F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27223] Re: temporary table
> That's why the question was asked: what do you need to do exactly? Do this: db._execute('CREATE TEMPORARY TABLE tmp (id INT)') # or whatever the SQL server's dialect requires On Jul 23, 7:42 am, Hans Donner wrote: > That's why the question was asked: what do you need to do exactly? > Perhaps a more elegant solution can be used. > > > > On Thu, Jul 23, 2009 at 03:10, Vidul Petrov wrote: > > > The implementation of temporary tables is not MVC, but RDBMS specific. > > > On Jul 23, 12:36 am, Fran wrote: > >> On Jul 22, 9:41 pm, rb wrote: > > >> > If you are using SQLite then you could create a db in memory and keep > >> > your temp table there. You can create the table outside of web2py and > >> > then in your SQLDB call you can add the parameter migrate=False to > >> > import the db into web2py. > > >> I guess you could achieve something similar by storing your temporary > >> data in either the Cache or the Session? > > >> F --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27371] Re: session.flash not working on auth password recovery
A temporary fix can be: session._flash (that's what I usually use). On Jun 12, 1:52 pm, "mr.freeze" wrote: > For some reason the session.flash doesn't work on an auth password > recovery (which should really be called a password reset I think). I > tried it with setting auth.messages.email_sent and without. I am > running from the latest source. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27372] username login and edit profile logic error?
Hi all, Just noticed that when username is used for login one can edit the profile and change the username to an existing one. Thus the account becomes unusable, because the system recognize only the original username. Any fix? Thank you for the help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27374] Re: username login and edit profile logic error?
My error - I forgot to add the proper validators for the "username" field, i.e.: t.username.requires = [IS_NOT_EMPTY(), IS_NOT_IN_DB(db, db.auth_user.username)] Apologies for the senseless post. On Jul 25, 3:07 pm, Vidul Petrov wrote: > Hi all, > > Just noticed that when username is used for login one can edit the > profile and change the username to an existing one. > Thus the account becomes unusable, because the system recognize only > the original username. > Any fix? > > Thank you for the help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27601] Yet another WEB2PY application
http://my-sticky-note.appspot.com/init/default/welcome (still missing the demo) Yes it's very small app, never-the-less the time went like this: - views / controllers / model: 5% (or less) - javascript / css: 95% I encountered only one small problem - some of the aith.messages do not appear in the flash, for example auth.messages.email_sent which was supposed to appear right after the registration. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:27640] Re: Yet another WEB2PY application
Thank you! You are right, the constrast of the text will be improved. On Jul 30, 6:47 pm, mdipierro wrote: > Very cool indeed! Congratulations. Perhaps you should add more > contract to the text, I find it hard to read, bur perhaps it is just > me. > > Massimo > > On Jul 30, 8:05 am, Tito Garrido wrote: > > > > > Very cool! I liked it! :) > > > On Thu, Jul 30, 2009 at 7:23 AM, Vidul Petrov wrote: > > > >http://my-sticky-note.appspot.com/init/default/welcome(stillmissing > > > the demo) > > > > Yes it's very small app, never-the-less the time went like this: > > > - views / controllers / model: 5% (or less) > > > - javascript / css: 95% > > > > I encountered only one small problem - some of the aith.messages do > > > not appear in the flash, for example auth.messages.email_sent which > > > was supposed to appear right after the registration. > > > -- > > > Linux User #387870 > > . > > _/_õ|__| > > ..º[ .-.___.-._| . . . . > > .__( o)__( o).:___ > > Sent from Campinas, SP, Brazil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py] Re: Oh, Reddit :(
It's a nice evidence, that Web2py does matter. Otherwise the idiots won't care to bark against this splendid technology. On Feb 8, 12:15 am, Anthony wrote: > http://www.reddit.com/r/Python/comments/fh4by/special_cases_arent_spe...
[web2py] Re: DAL new syntax RFC
I agree with Stefaan. However the ':' before a variable name notation looks like the Ruby symbols whose only purpose was improved performance (lightweight strings) but lead inevitably to confusion (IMHO). On Mar 4, 5:55 pm, Massimo Di Pierro wrote: > There are some new features in trunk: > > 1) > > I got tired of writing default='value',readable=False,writable=False > etc. > > So: > > Field(':name') is the same as > Field('name',readable=False,writable=False) > Field('.name') is the same as > Field('name',readable=True,writable=False) > Field('name=value') is the same as Field('name',default='value') > > and combinations: > > Field(':name=value') is the same as > Field('name',default='value',readable=True,writable=False) > > notice > > Field('name=') is the same as Field('name',default='') > > 2) > > db(db.table).select((db.table.field.length()+5).sum()) > > note operators length(), +5, sum() can be combined in more ways than > before.
[web2py:18325] Re: How to use raise HTTP(404, 'message') ?
I guess you're trying to "inspect" the input data: def raise404(): print request.args print request.vars ### raise an HTTP exceptpion in the same way: #raise HTTP(404, BEAUTIFY(request.args)) ### or # raise HTTP(404, BEAUTIFY(request.vars)) But nothing stop you to raise HTTP exception on any type ot http status code: raise HTTP(200, "'invalid' http status code") You can also have 3rd optional named argument in an HTTP exception. On Mar 18, 8:24 pm, Jim wrote: > I'm trying to do some checking on data input. Looking at the code in > gluon I see there's a raise function that should return a 404 or 400 > error code. I'm trying a fairly simple test: > > if ( prefix < 200 ): > print prefix # comment for production > raise HTTP(404, str(prefix) + "is Not a Valid > Prefix") > > I get the print statement on the terminal where I'm running web2py so > I know it's branching here but I don't see an error message from the > app as I would expect. > > I have > > from html import * > from http import * > > at the top of my function but it doesn't seem to make a difference if > they're there or not. > > I've stopped and restarted web2py. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18331] Re: Grab the full URL on error?
Hi, I guess you mean "request.env.http_referer"? On Mar 19, 12:20 am, ceej wrote: > Hey, > > I'm using the custom error routes and it get's the error code and the > ticket number, but is there a way to get the full URL of the page that > errored out? This would be really useful. > > Many thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18359] Re: Possible bug: cron doesn't work when deploy in a directory name with space inside
Hi Iceberg, Could it be an unescaped space in Popen class? If so, does this rough solution work (gluon/contrib/cron.py)? $diff cron.py cron_new.py 202c202 < proc = Popen([self.cmd], stdin=PIPE, stdout=PIPE, --- > proc = Popen([r'%s' % self.cmd], stdin=PIPE, stdout=PIPE, On Mar 19, 12:30 pm, Iceberg wrote: > Hi Achipa, > > I have an app based on web2py-win.zip 1.56.4's cron feature. I just > noticed that, if the whole web2py is deployed in a directory name with > space inside, such as C:\Program Files\web2py, the cron feature does > not work, instead I saw one line appeared on the console: > WARNING:root:WEB2PY CRON Call returned code 1: > > If I deploy it in C:\SOLID\web2py, everything runs smooth. > > So there might be some dir issue in cron's launcher. Please take a > look. Thanks in advance! > > Regards, > Iceberg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18616] Re: Database in web2py
You should use SQLDB to create a database connection. In your model (models/db.py most probably): SQLDB('mysql://username:passw...@localhost:3306/the_name_of_the_db') On Mar 25, 8:53 pm, dave_mcgee wrote: > Hi there. > > I have a MySQL database in my web2py environment. > > I wish for an external application to connect to it also to read > data.. What parameters should I use? I assume localhost is one but I > can't find any username/password information associated with my db --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18629] Re: web2py daemon script for archlinux
Hello Matt, I allowed myself some changes, mostly related to portability (the script is supposed to be "/usr/bin/web2py.py" or somewhere else in $PATH): #!/bin/bash prog=`basename $0` cd `pwd` chmod +x $prog function web2py_start { nohup ./$prog -a "" 2>/dev/null & if [ ! -z "`pgrep $prog`" ] then echo "WEB2PY has been started." fi } function web2py_stop { pid=`pgrep $prog | head -1` kill -15 `pgrep $prog | grep -v $$` 2>/dev/null if [ $pid -ne $$ ] then echo "WEB2PY has been stopped." fi } case "$1" in start) web2py_start ;; stop) web2py_stop ;; restart) web2py_stop web2py_start ;; *) echo "Usage: $prog [start|stop|restart]" ;; esac exit 0 Have a nice time with web2py! On Mar 25, 10:53 pm, "mgbeli...@gmail.com" wrote: > Hello all, > > I'm a web developer just getting my feet wet with web2py. I just > wrote my own daemon for web2py for the archlinux distribution which I > am using, so I though I'd share it in hopes that you'd bundle it with > the whole package. It's not tested on any other distro besides > archlinux, but my guess is it might work on slackware too. > > Thanks, > > Matt Belisle > > begin text: > #!/bin/bash > # This is the web2py daemon (web2pyd) for archlinux. It is > recommended that you save the web2py > # folder as /usr/lib/web2py, but if it's somewhere else just modify > the variable below. > # Author: Matt Belisle mgbeli...@gmail.com > > # Default folder > # WEB2PY_FOLDER="/your/custom/folder" > WEB2PY_FOLDER="/usr/lib/web2py" > > . /etc/rc.conf > . /etc/rc.d/functions > case "$1" in > start) > stat_busy "Starting web2py Daemon" > pkill -f web2py.py &> /dev/null > python ${WEB2PY_FOLDER}/web2py.py -a "" -P -p 8000 &> / > dev/null & > add_daemon web2pyd > stat_done > ;; > stop) > stat_busy "Stopping web2py Daemon" > pkill -f web2py.py &> /dev/null > rm_daemon web2pyd > stat_done > ;; > restart) > $0 stop > sleep 1 > $0 start > ;; > *) > echo "usage: $0 {start|stop|restart}" > esac > exit 0 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18639] Re: cache.ram Questions
Hi Iceberg, >From what I saw, the cache object is not unique, it's that the samle has "time_expire=5" and most probably you've loaded the page on the 2nd browser for more than 5 seconds. In addition a test made on two boxes with something like: def mycache(): import time t=cache.ram('time',lambda:time.ctime(),time_expire=100) return dict(time=t,link=A('click me',_href=URL(r=request))) proves that the same cache object is returned. But I am just guessing. On Mar 26, 6:02 am, Iceberg wrote: > On Mar26, 2:56am, Mark Larsen wrote: > > > > > Also is the cache object unique for each session? Does Web2py have any > > concept of a shared cache for all sessons? > > I share what I just test, and what I do not know, and hope some expert > can confirm them. > > Cache object seems unique for each session. I just open two different > browser (Chrome and IE, and hence two sessions) to visit same cache > sample (http://www.web2py.com/examples/cache_examples/cache_in_ram), > and see cache effect can work on two sessions. > > But I am still not sure, is the cache object unique for each > application, or are they share same namespace when in one web2py > process? In other words, do I need to use cache in this way in my > every application? > cache.ram('%s:key'%request.application, lambda: foo(), > time_expire=) > > By the way, if the cache object is unique for each application, what > is the proper way to share info between application if needed? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18650] Python auth decorator examples
Hi, All online examples about the auth object decorator usage seem like this (note ":" at the end): @auth.requires_login(): and this does not work, unless it's changed to: @auth.requires_login() --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18655] Re: Send Data Through JSON !
Hi Yannik, Probably something like: # the view: {{extend 'layout.html'}} Please click here. # the controller: def my_json(): try: argument=request.args[0] import gluon.contrib.simplejson as simple_json return simple_json.dumps(argument) except IndexError: return dict() On Mar 27, 4:33 am, Yannick wrote: > Hello Mate, > This is probably a really simple issue... I want to send data to an > action from the views using JSON and here is a sample of my code > > In the view: > *** > > $.getJSON('/AppName/default/ActionName', 'DATA2SEND2Action' , function > (datafromServer){ }); > > *** > > In the Controller (Here I'm trying to retrieve data sent from view > using 'request.args' ) > ** > def actionName: > argument = request.args[0] > .. > .. > .. > return argument > ** > > I got an error message complaining about the index... Here is the > error: > > File "/opt/web2py/applications/BU/controllers/default.py", line 99, in > actionName > argument = request.args[0] > IndexError: list index out of range > > PS: > I'm using Firebug to debug my JavaScript code and here is the request > link I got: > GEThttp://127.0.0.1:8000/AppName/default/actionName?DATA2SEND2Action > > DO you pleaz have any idea ? , I'm pretty sure I'm doing something not > really correct somewhere... > > Do you know a better way to communicate from Views to Action using > JSON with Web2Py? > > Please help ! > > Thanks for your attention, > Regards, > Yannick P. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18664] Re: Python auth decorator examples
Hi Michael, >From what I know till now: - about the ID - "session.auth.user.id" or just "auth.user.id" - about the username - it's usually the email address (see auth_user table), i.e. "auth.user.email". On Mar 27, 5:42 am, Michael wrote: > Yea I just noticed this also. > > Also, does anyone know how to get a user ID or session information? > > When a user log's in, in my template it would be nice to have the > users name greeted like > > Welcome, [session.userid] > > and also, using a current user-id as a default for a SQLFORM? > > thanks guys! > > On Mar 26, 7:39 pm, Vidul Petrov wrote: > > > > > Hi, > > > All online examples about the auth object decorator usage seem like > > this (note ":" at the end): > > > @auth.requires_login(): > > > and this does not work, unless it's changed to: > > > @auth.requires_login() --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18674] Re: Trouble with images
Hi Doug, Did you by any chance make the upload using FTP? My guess is that binary mode is not used, because I am pretty sure that WEB2PY has nothing to do with this problem. On Mar 27, 5:21 pm, Doug Cuthbertson wrote: > Has anyone else had this problem (uploading images)? Are there any > debug settings for web2py or log files it can generate to help > determine what's going wrong? If someone can point me in the right > direction, I'll be happy to try to analyze/debug my installation. > > Thanks, > Doug C. > > On Mar 26, 5:41 am, Doug Cuthbertson > wrote: > > > > > I've tested Firefox 3.0.7 and IE 7.0. > > > Regards, > > Doug C. > > > On Mar 25, 10:38 pm, mdipierro wrote: > > > > Which browser? Have you tried more than one? > > > > Massimo > > > > On Mar 25, 3:22 pm, Doug Cuthbertson > > > wrote: > > > > > Massimo, > > > > Yes, I'm uploading from the admin/default/design/TestBlog page. Here's > > > > what I've tried: > > > > > web2py: versions 1.58 and 1.59 binary and I even downloaded the source > > > > from SVN this afternoon and ran from that with no difference. > > > > > OS: Windows XP SP3 Home Edition, and W2K3 SP2. > > > > > I normally run from binary on a USB memory stick. Just for fun, I > > > > tried source on both the memory stick and from the hard drive on the > > > > W2K3 system (Python 2.5.4), with no improvement. > > > > > In all cases, I used the default web server (CherryPy, right?) > > > > onhttp://localhost:8000. > > > > > Regards, > > > > Doug C. > > > > > On Mar 25, 3:31 pm, mdipierro wrote: > > > > > > From your email I assume you are uploading the images via the admin/ > > > > > design page. > > > > > > Which version of web2py are you running? Which OS? binary or source? > > > > > Which web server? > > > > > > Massimo > > > > > > On Mar 25, 10:20 am, Doug Cuthbertson > > > > > wrote: > > > > > > > Massimo, > > > > > > Thanks for the reply. When I > > > > > > accesshttp://localhost:8000/TestBlog/static/image2.jpg > > > > > > I get an image of the text "http://localhost:8000/TestBlog/static/ > > > > > > image2.jpg". When I try other images I either get a corrupted > > > > > > version > > > > > > of the original image, or I get an image of the URL text. When I > > > > > > open > > > > > > the directory "E:\web2py\applications\TestBlog\static", the images > > > > > > (image1.jpg and image2.jpg in this case) are there, but either they > > > > > > cannot be displayed in an image viewer or they are displayed as a > > > > > > corrupted version of the original. > > > > > > > Regards, > > > > > > Doug C. > > > > > > > On Mar 25, 10:17 am, mdipierro wrote: > > > > > > > > Can you access > > > > > > > >http://localhost:8000/TestBlog/static/image2.jpg > > > > > > > > is it either a typo or the image is not there. > > > > > > > > Massimo > > > > > > > > On Mar 25, 6:24 am, Doug Cuthbertson > > > > > > > wrote: > > > > > > > > > Hi Folks, > > > > > > > > I'm new to web2py. I've worked through the recipe example in the > > > > > > > > cookbook and it worked like a champ! I really like being able to > > > > > > > > create all the parts of a web application via the browser. It > > > > > > > > means > > > > > > > > never having to open a console on the web server. Very nice. > > > > > > > > > Next, I tried following the instructions in "how to turn a > > > > > > > > static html > > > > > > > > page into a blog in 90 seconds" from the FAQ. All was going > > > > > > > > well, > > > > > > > > except that the image didn't display on the > > > > > > > > /TestBlog/default/hello > > > > > > > > web page. I've tried both versions 1.58 and 1.59 of web2py. > > > > > > > > Here's > > > > > > > > what the source view looks like from Firefox (Ctrl-U): > > > > > > > > > > > > > > > > > > > > > > > > > Welcome to My Blog > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Please say something here! > > > > > > > > > > > > > > > > > > > > > > > > > I uploaded a couple of images, so this shows the last attempt > > > > > > > > with > > > > > > > > "image2.jpg" as the src attribute. > > > > > > > > > Has anyone seen this kind of behavior before? > > > > > > > > > Thank you for any and all advice. > > > > > > > > > Regards, > > > > > > > > Doug C. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18701] Re: Can't display certain fields, and baffled as to why... And one other little question...
Hi Jason, tags = db().select(db.tag.ALL,orderby=db.tag.name) users = db().select(db.users.ALL,orderby=db.users.nickname) tags = db.tag users = db.users should be: tags = db().select(db.tag.ALL,orderby=db.tag.name) users = db().select(db.users.ALL,orderby=db.users.nickname) tag_counter=db(db.tag.id>0).count() user_counter=db(db.user.id>0).count() # or just the length of the lists: tag_counter=len(tags) user_counter=len(users) On Mar 28, 11:57 am, Jason Brower wrote: > It gives me an: > AttributeError: 'str' object has no attribute 'nickname' > on this line... > response.write(person.nickname) > but that all looks great... > What the heck am I missing here... > Second thing is the conditional I use in the view... I have "if > (users):", is that the best way to check if there is content in users > model? If not what would you recommend is the best way? > Bester Regards, > Jason > > --- > Information: > MODEL: > db.define_table('users', > SQLField('first_name', 'string', length=15), > SQLField('last_name', 'string', length=15), > SQLField('nickname', 'string', length=15), > SQLField('phone_number', 'string', length=15), > SQLField('email', 'string'), > SQLField('password', 'password'), > SQLField('company', 'string', length=25), > SQLField('position', 'string'), > SQLField('street', 'string'), > SQLField('city', 'string', length=30), > SQLField('postal_code', 'string', length=15), > SQLField('country', 'string', length=30), > SQLField('created', 'datetime', default=now, writable=False), > SQLField('registration_key', length=128, writable=False, > readable=False, default=''), > SQLField('avatar', 'upload')) > > CONTROLLER: > #Manage Users > def manage_users(): > happenings = db().select(db.happening.ALL,orderby=db.happening.name) > tags = db().select(db.tag.ALL,orderby=db.tag.name) > users = db().select(db.users.ALL,orderby=db.users.nickname) > tags = db.tag > users = db.users > return dict(tags=tags, users=users, happenings=happenings, > today=today) > > VIEW: > {{extend 'layout.html'}} > Users at your happening... > > > {{for happening in happenings:}} > > {{=happening.name}} > > {{pass}} > > > > {{if (users):}} > > {{for person in users:}} > > {{=person.nickname}} > > {{pass}} > > {{else:}} > You have no users yet... click here to create one. > {{pass}} > > > {{for tag in tags:}} > > {{=tag}} > > {{pass}} > > > > > {{=BEAUTIFY(response._vars)}} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18717] Re: web2py and ruby together
Hi weheh , 1) You should "initialize" (in the term of Ruby) a SQLTable object with "migrate" flag set to False (see db.define_table), thus WEB2PY will assume that you already has this table and will use it without trying to create it. 2) All WEB2PY needs in order to store the sessions data in a database: session.connect(request,response,db) This will create a table, following web2py_session_applicationname naming convention, with the following structure: `id` int(11) NOT NULL auto_increment, `locked` char(1) default NULL, `client_ip` varchar(64) default NULL, `created_datetime` datetime default NULL, `modified_datetime` datetime default NULL, `unique_key` varchar(64) default NULL, `session_data` longblob On Mar 29, 6:52 am, weheh wrote: > Sorry for being long-winded above. The questions, simply stated: > > 1) How does one get web2py to point to and run directly off an > existing db made and updated by a Ruby app? > 2) How does one get a web2py app to share authentication and session > information with a Ruby app? > > I imagine no magic is needed to do this, but I'd like to hear from the > more experienced users how they would approach this. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18719] Re: web2py and ruby together
The db storage of the sessions data is optional. By default it is stored in "app_name/sessions" directory. On Mar 29, 8:04 am, weheh wrote: > Thanks, Vidul. Do I need to store the session data in the db? Why > can't I just keep it session based? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18745] Re: I want to make my website live now...
Hi Jason, The startup script should be told to listen on all network interfaces: python web2py.py -i 0.0.0.0 On Mar 29, 10:36 pm, Jason Brower wrote: > I can't seem to connect to my site from other computers. Only from my > localhost addresss (127.0.0.1:8000). > I am using ubuntu linux 8.10. > If I try from my wifes computer and browse to 192.168.0.30:8000 it > doesn't work. But if I go to port 80 I get my apache webserver. > If I try to connect to my site from my ip, 192.168.0.24:8000 it doesn't > connect either. > Any ideas? > Regards, > Jason Brower --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18754] Re: Getting last item in a query?
If you don't need a list, but just the last record, use the return value from insert: last_id =db.table.insert(item="some item") On Mar 30, 2:00 am, TheDude wrote: > Wouldn't last = db().select(db.table.ALL, orderby=~db.table.id, limit= > (1,))[0] be better? Since this way only one row is being retrieved and > less overhead? > > On Mar 29, 5:26 pm, mdipierro wrote: > > > > > last = db().select(db.table.ALL).as_list()[-1] > > > On Mar 29, 3:42 pm, Michael wrote: > > > > I wasn't sure if when you do > > > > query = db().select(db.table.ALL) > > > > returns as an array of items? > > > > I am trying to get the last item added into the TABLE. I thought i > > > could do: > > > > query = db().select(db.table.ALL) > > > last = query[-1] > > > return dict(last=last) > > > > but I am getting the following error: > > > > Traceback (most recent call last): > > > File "gluon/restricted.py", line 98, in restricted > > > File "/Users/michaelnovia/Documents/web2py/web2py.app/Contents/ > > > Resources/applications/philosaraptor/controllers/default.py", line 24, > > > in > > > File "gluon/globals.py", line 75, in > > > File "/Users/michaelnovia/Documents/web2py/web2py.app/Contents/ > > > Resources/applications/philosaraptor/controllers/default.py", line 9, > > > in quote > > > File "gluon/sql.py", line 2036, in __getitem__ > > > SyntaxError: SQLRows: no such row --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18767] Re: Would this patch be useful?
I find this object (response.scripts) very useful, especially if it's able to manipulate different HTML elements, not only after page load (__call__ modification?): response.scripts("$('#post')", "onclick", "$('#post .comments').css ({'value', 'sm.th.'})") Probably this breaks the MVC views' rules, but in when it comes to Ajax I feel more comfortable when the presentation logic is in the controller. On Mar 30, 8:18 am, TheDude wrote: > This certainly breaks the MVC architecture, but it is valuable. I > think web2py should be about being able to expand as much as possible > without interfering the people who just want a small and easy > framework (it can be a small plant or a big tree). I do like the idea > of everything going into the same $().ready() function. > > After a bit of thinking about it, this would be no different (in terms > of usability and mvc structure) as saying something like > response.title = 'xxx' within the controller. I'm going to give this a > thumbs up, as long as it doesn't slow down the framework and I wont be > required to do it. ;) > > On Mar 30, 12:15 am, mdipierro wrote: > > > > > Some clarifications. > > Right now one can already do this in views by inserting somewhere: > > > > > $(document).ready(function() { do_something(); }); > > > > > Mr. Freeze's suggestions has pros and cons. In my opinion: > > > Pros: > > - it is more compact > > Cons: > > - moves into the controller something that (usually) belongs to the > > view. > > - if the script in quotes has a bug it may break web2py_ajax > > because everything would go in the same $(..).ready(function(){}). > > > I would like to hear more opinions about this. Perhaps some examples > > when this would be better than placing the code in the view. > > > Massimo > > > On Mar 29, 10:46 pm, Jason Brower wrote: > > > > Good question. > > > I like the idea as it gives us a nice place to put scripts and make them > > > apply to the views we want very easily. so +1 on that! > > > Regards, > > > Jason Brower > > > > On Sun, 2009-03-29 at 20:23 -0700, mr.freeze wrote: > > > > It's basically a new global list, response.scripts, that is rendered > > > > in the jQuery(document).ready function so you can inject javascript > > > > from the controller. Massimo mentioned that it may go against MVC > > > > separation standards and wanted me to put it out here to get a few > > > > opinions. Sample usage: > > > > > def index(): > > > > if not request.vars.name: > > > > response.scripts.append("$('#messages').text('Messages: Name > > > > Missing').css('color','red');") > > > > else: > > > > response.scripts.append("$('#messages').text('Messages: Hello > > > > " + request.vars.name + "');") > > > > return dict() > > > > > What do you think? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18802] Re: request for comments
I agree. On Mar 30, 7:28 pm, TheDude wrote: > Yes! I was disapointed to find out this wasn't the case and had to go > back into my db.py models and change it. +1 :) > > On Mar 30, 11:11 am, AchipA wrote: > > > > > +1 > > > On Mar 30, 4:37 pm, Kacper Krupa wrote: > > > > i also agree > > > > On Mar 30, 4:23 pm, Timothy Farrell wrote: > > > > > +1 > > > > > johann.scheibelho...@easytouch-edv.com wrote: > > > > > agree > > > > > > On Mar 30, 4:10 pm, mdipierro wrote: > > > > > >> Right now if you say: > > > > > >> db.table.field.writable=False > > > > > >> your field will be hidden to both custom forms and appadmin forms. I > > > > >> think appadmin forms should ignore these constraints and always > > > > >> display all fields. Do you agree? > > > > > >> Massimo > > > > > -- > > > > Timothy Farrell > > > > Computer Guy > > > > Statewide General Insurance Agency (www.swgen.com) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18892] Re: In cased you missed it
IMHO such lightweight applications/utilities would make WEB2PY the only so capable MVC player. In addition I'd like to request comments on, let's call it feature - now that Auth is in not an add-on, is there are a place for (optional) UNIX-like users/resources management? In short: each resource - every controler/action/etc. owned by a given user/group, otherwise an user/group "nobody" or "guest". Does this make any sense? On Apr 1, 6:29 am, Yarko Tymciurak wrote: > Not sure what you would want to port here; If I take this at face value, > here's what is currently documented (I've highlited what I thought might be > interesting from a web2py perspective). > In general, I think idea of having a package of light weight applications / > utilities is something both useful, and (at some level) something we're > doing w/ tools... auth, etc. > > - email confirmation > - This simple app is for cases where you don’t want to require an > email address to signup on your website but you do still want to > ask for an > email address and be able to confirm it for use in optional parts of > your > website > - timezones > - threaded comments > - with moderation > - ajax validation > - uses jquery > - flags > - This app lets users of your site flag content as inappropriate or > spam. > - pagination > - oembed > - notification > - mailer with a mail cue, this _might_ be interesting... > - dbtemplates > - robots > > > > On Tue, Mar 31, 2009 at 9:12 PM, mdipierro wrote: > > > Perhaps we should do it ourself for real. > > > On Mar 31, 7:11 pm, Yarko Tymciurak wrote: > > > Guys - this is a Joke (see also the "fued between pinax and > > > django") > > > see: http://www.ponyransom.com/ > > > > and: http://www.pinaxenvy.com/ > > > > On Tue, Mar 31, 2009 at 6:28 PM, mdipierro > > wrote: > > > > >http://twitter.com/jtauber/status/1420954914 > > > > > James. Are you here? > > > > > Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18899] Re: In cased you missed it
Thank you, Massimo. One more question - a role can have many groups and vice versa, an user can belong to many groups and vice versa? On Apr 1, 7:16 am, mdipierro wrote: > This is already in Auth. Auth actually does more than unix-like group > based access control. It does Role based access control (group based > is a particular case). > > gid=auth.add_group(role='Manager') > auth.add_membership(gid, auth.user.id) > auth.add_permission(gid,'call function f') > > @auth.requires_permission('call function f') > def f(): return 1 > > On Mar 31, 11:01 pm, Vidul Petrov wrote: > > > > > IMHO such lightweight applications/utilities would make WEB2PY the > > only so capable MVC player. > > In addition I'd like to request comments on, let's call it feature - > > now that Auth is in not an add-on, is there are a place for (optional) > > UNIX-like users/resources management? > > In short: each resource - every controler/action/etc. owned by a given > > user/group, otherwise an user/group "nobody" or "guest". > > > Does this make any sense? > > > On Apr 1, 6:29 am, Yarko Tymciurak wrote: > > > > Not sure what you would want to port here; If I take this at face value, > > > here's what is currently documented (I've highlited what I thought might > > > be > > > interesting from a web2py perspective). > > > In general, I think idea of having a package of light weight applications > > > / > > > utilities is something both useful, and (at some level) something we're > > > doing w/ tools... auth, etc. > > > > - email confirmation > > > - This simple app is for cases where you don’t want to require an > > > email address to signup on your website but you do still want to > > > ask for an > > > email address and be able to confirm it for use in optional parts > > > of your > > > website > > > - timezones > > > - threaded comments > > > - with moderation > > > - ajax validation > > > - uses jquery > > > - flags > > > - This app lets users of your site flag content as inappropriate or > > > spam. > > > - pagination > > > - oembed > > > - notification > > > - mailer with a mail cue, this _might_ be interesting... > > > - dbtemplates > > > - robots > > > > On Tue, Mar 31, 2009 at 9:12 PM, mdipierro > > > wrote: > > > > > Perhaps we should do it ourself for real. > > > > > On Mar 31, 7:11 pm, Yarko Tymciurak wrote: > > > > > Guys - this is a Joke (see also the "fued between pinax and > > > > > django") > > > > > see: http://www.ponyransom.com/ > > > > > > and: http://www.pinaxenvy.com/ > > > > > > On Tue, Mar 31, 2009 at 6:28 PM, mdipierro > > > > wrote: > > > > > > >http://twitter.com/jtauber/status/1420954914 > > > > > > > James. Are you here? > > > > > > > Massimo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18966] Re: auth and views?
2) controller "default.py" def user(): if request.args: response.view='user/default.html' return dict(form=auth()) (to customize the view) view "user/default.html" {{extend 'layout.html'}} {{=form}} On Apr 2, 6:44 am, TheDude wrote: > 3) > def login(): return auth.login() > # create view "default/login.html" > def register(): return auth.register() > # create view "default/register.html" > etc etc > I tried this method but no luck. It doesnt even show any kind of file > (not even generic.html) It just shows the HTML of the form. Any ideas > why? > > On Apr 1, 11:06 pm, Yarko Tymciurak wrote: > > > > > On Wed, Apr 1, 2009 at 9:56 PM, mdipierro wrote: > > > > You have 3 options (assuming default.py controller) > > > > 1) > > > def user(): return auth() > > > # create a single view called default/user.html for all urls > > > > 2) > > > def user(): > > > if request.args: response.view='user/%s.html' % request.args[0] > > > return auth() > > > # create individual views 'default/user/login.html' etc. > > > > 3) > > > def login(): return auth.login() > > > # create view "default/login.html" > > > def register(): return auth.register() > > > # create view "default/register.html" > > > etc etc > > > by the way, if you are going to do special stuff, your code will probably be > > more explicit / readable w/ (3). > > > > Massimo > > > > On Apr 1, 9:26 pm, TheDude wrote: > > > > I've tried using Web2Py's auth system and then tried creating the > > > > following views: > > > > user/register.html > > > > user/create.html > > > > default/user/register.html > > > > default/user/create.html > > > > auth/create.html > > > > auth/register.html > > > > > None of them worked, how do you allow views for /default/user/ > > > > register ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:18968] Re: auth and views?
Very useful feature (from my point of view) is that you can define only one template outside the actions - response.view='%s/ default.html' % request.controller - and it becomes the default one for all actions in a given controller. On Apr 2, 10:54 am, Kacper Krupa wrote: > 3) > def login(): return auth.login() > # create view "default/login.html" > def register(): return auth.register() > # create view "default/register.html" > etc etc > > function should returns dict objects (then the templates are loaded > afaik). So: def login(): dict(form=auth.login()) etc. > > On Apr 2, 6:54 am, Vidul Petrov wrote: > > > > > 2) > > > controller "default.py" > > > def user(): > > if request.args: > > response.view='user/default.html' > > return dict(form=auth()) > > > (to customize the view) > > > view "user/default.html" > > > {{extend 'layout.html'}} > > > {{=form}} > > > On Apr 2, 6:44 am, TheDude wrote: > > > > 3) > > > def login(): return auth.login() > > > # create view "default/login.html" > > > def register(): return auth.register() > > > # create view "default/register.html" > > > etc etc > > > I tried this method but no luck. It doesnt even show any kind of file > > > (not even generic.html) It just shows the HTML of the form. Any ideas > > > why? > > > > On Apr 1, 11:06 pm, Yarko Tymciurak wrote: > > > > > On Wed, Apr 1, 2009 at 9:56 PM, mdipierro > > > > wrote: > > > > > > You have 3 options (assuming default.py controller) > > > > > > 1) > > > > > def user(): return auth() > > > > > # create a single view called default/user.html for all urls > > > > > > 2) > > > > > def user(): > > > > > if request.args: response.view='user/%s.html' % request.args[0] > > > > > return auth() > > > > > # create individual views 'default/user/login.html' etc. > > > > > > 3) > > > > > def login(): return auth.login() > > > > > # create view "default/login.html" > > > > > def register(): return auth.register() > > > > > # create view "default/register.html" > > > > > etc etc > > > > > by the way, if you are going to do special stuff, your code will > > > > probably be > > > > more explicit / readable w/ (3). > > > > > > Massimo > > > > > > On Apr 1, 9:26 pm, TheDude wrote: > > > > > > I've tried using Web2Py's auth system and then tried creating the > > > > > > following views: > > > > > > user/register.html > > > > > > user/create.html > > > > > > default/user/register.html > > > > > > default/user/create.html > > > > > > auth/create.html > > > > > > auth/register.html > > > > > > > None of them worked, how do you allow views for > > > > > > /default/user/ > > > > > > register ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19014] Error message css style
Hi, I cannot find a way to resize the error message, the recaptcha is 500px and the other input fields are only 210px, so the error message becomes 500px and I want it to be 210px for all but recaptcha. Any ideas? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19021] Re: Error message css style
Finally managed to change the error messages format - file: "gluon/html.py" class:INPUT method: xml On Apr 3, 5:33 pm, Vidul Petrov wrote: > Hi, > > I cannot find a way to resize the error message, the recaptcha is > 500px and the other input fields are only 210px, so the error message > becomes 500px and I want it to be 210px for all but recaptcha. Any > ideas? > > Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19030] Re: Error message css style
return DIV.xml(self) + TABLE(TR(TD(self.errors[name], _class='error' , errors=None, _id='%s__error' % name))).xml() and in the css file: td.error { min-width: ... } I also tried with SPAN (much better effect IMHO), but (of course) IE didn't make the right alignment (in contrast to Opera, FF, Safari, Konqueror). On Apr 3, 7:11 pm, Yarko Tymciurak wrote: > On Fri, Apr 3, 2009 at 10:36 AM, Vidul Petrov wrote: > > > Finally managed to change the error messages format - > > file: "gluon/html.py" > > class:INPUT > > method: xml > > which uses div.errors, so were you able to change format in > static/style.css? > Or did you do something else? > > Just wondering... > > > > > > > On Apr 3, 5:33 pm, Vidul Petrov wrote: > > > Hi, > > > > I cannot find a way to resize the error message, the recaptcha is > > > 500px and the other input fields are only 210px, so the error message > > > becomes 500px and I want it to be 210px for all but recaptcha. Any > > > ideas? > > > > Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19091] reponse.flash and auth.messages problem
The problem is that the following two lines work fine (are copied in response.flash), auth.messages.logged_out = 'You have been logged out successfully' auth.messages.logged_in = 'You have been logged in successfully' but these do not appear anywhere (while trying "user/profile" and "user/profile"): auth.messages.profile_updated = 'Your profile have been udated successfully' auth.messages.password_changed = 'Your password has been changed successfully' Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19094] Re: reponse.flash and auth.messages problem
Thank you, I tried, but I subclassing doesn't fix the problem. >From "tools.py" - session.flash = self.messages.profile_updated Probably some problem with session.flash? On Apr 4, 7:16 pm, TheDude wrote: > Vidul. > Take a look at this page:http://mdp.cti.depaul.edu/examples/default/tools > > Under "Custom Authentication" > > On Apr 4, 12:06 pm, Vidul Petrov wrote: > > > > > The problem is that the following two lines work fine (are copied in > > response.flash), > > > auth.messages.logged_out = 'You have been logged out successfully' > > auth.messages.logged_in = 'You have been logged in successfully' > > > but these do not appear anywhere (while trying "user/profile" and > > "user/profile"): > > > auth.messages.profile_updated = 'Your profile have been udated > > successfully' > > auth.messages.password_changed = 'Your password has been changed > > successfully' > > > Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19101] Re: reponse.flash and auth.messages problem
I copied the content of this line (956) in the previous post. session.flash = self.messages.profile_updated print session.flash # the right string is sent to stdout Could it be session.flash problem? On Apr 4, 7:39 pm, mdipierro wrote: > Look in tools.py line 956. > > On Apr 4, 11:06 am, Vidul Petrov wrote: > > > > > The problem is that the following two lines work fine (are copied in > > response.flash), > > > auth.messages.logged_out = 'You have been logged out successfully' > > auth.messages.logged_in = 'You have been logged in successfully' > > > but these do not appear anywhere (while trying "user/profile" and > > "user/profile"): > > > auth.messages.profile_updated = 'Your profile have been udated > > successfully' > > auth.messages.password_changed = 'Your password has been changed > > successfully' > > > Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19103] Re: reponse.flash and auth.messages problem
With this ugly fix: session._flash = self.messages.profile_updated # tools.py, added on line 957 if session._flash: response.flash = session._flash # some controller it works. At some point session.flash has been overwritten? On Apr 4, 7:54 pm, Vidul Petrov wrote: > I copied the content of this line (956) in the previous post. > > session.flash = self.messages.profile_updated > print session.flash # the right string is sent to stdout > > Could it be session.flash problem? > > On Apr 4, 7:39 pm, mdipierro wrote: > > > > > Look in tools.py line 956. > > > On Apr 4, 11:06 am, Vidul Petrov wrote: > > > > The problem is that the following two lines work fine (are copied in > > > response.flash), > > > > auth.messages.logged_out = 'You have been logged out successfully' > > > auth.messages.logged_in = 'You have been logged in successfully' > > > > but these do not appear anywhere (while trying "user/profile" and > > > "user/profile"): > > > > auth.messages.profile_updated = 'Your profile have been udated > > > successfully' > > > auth.messages.password_changed = 'Your password has been changed > > > successfully' > > > > Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19134] Re: Controller & sub-folders
> it is such an important feature for organizing a large project... Because? The controller itself provides a namespace, not the filesystem. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19149] Re: IS_URL & error_message
Hi, You may want to try a quick fix (not sure that's ok, but it seems to work): # file validators.py # line 1306 try: subMethod = eval('IS_' + str(self.mode).upper() + '_URL (allowed_schemes=self.allowed_schemes, prepend_scheme=self.prepend_scheme,error_message="' + self.error_message + '")' imho it's not a bug, it's just IS_HTTP_URL error_message attribute, which is returned from IS_URL, and it has value "invalid url!". On Apr 5, 10:50 am, ab wrote: > Hi > > I have problem with custom message on url field validation. I set > following rule in db.py > > db.mytable.url.requires=IS_URL(error_message='Must be URL') > > but validation always returns 'invalid url!' message . Custom > validation message working fine for other validators, like > IS_NOT_EMPTY or IS_DATE, I have problem only with IS_URL. I'm using > web2py 1.59 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19151] Re: Uploading Static File Folder
Hi, If I understand correctly the question - you can just copy your directories in "static" directory. On Apr 5, 5:52 pm, Monty808 wrote: > Hi, > > I am using an DHTMLX JavaScript library. I have to upload multiple > files and directories. > > For e.g. there is a separate folder for images etc... > > How do I deal with that? It is not clear on how to upload a folder > structure to the static section. > > Can I create folders in the static directory? > > Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19162] change_password problem on GAE
change_password works fine except on GAE: Traceback (most recent call last): File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ restricted.py", line 98, in restricted exec ccode in environment File "/base/data/home/apps/myapp/1.332577102462600463/applications/ init/controllers/default.py", line 117, in File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ globals.py", line 75, in self._caller = lambda f: f() File "/base/data/home/apps/myapp/1.332577102462600463/applications/ init/controllers/default.py", line 101, in user return dict(form=auth()) File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ tools.py", line 411, in __call__ return self.change_password() File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ tools.py", line 900, in change_password requires=[IS_EXPR('value==%s' % repr(pass1))])) File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ sqlhtml.py", line 658, in form_factory return SQLFORM(SQLDB(None).define_table('no_table', *fields), File "/base/data/home/apps/myapp/1.332577102462600463/gluon/sql.py", line 851, in define_table t = self[tablename] = SQLTable(self, tablename, *fields) File "/base/data/home/apps/myapp/1.332577102462600463/gluon/sql.py", line 1006, in __init__ 'define_table argument is not a SQLField' SyntaxError: define_table argument is not a SQLField Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19169] Re: change_password problem on GAE
It works now. Thank you! On Apr 5, 8:13 pm, mdipierro wrote: > I think I fixed it in trunk. Please give it a try. > > Massimo > > On Apr 5, 11:28 am, Vidul Petrov wrote: > > > > > change_password works fine except on GAE: > > > Traceback (most recent call last): > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > restricted.py", line 98, in restricted > > exec ccode in environment > > File "/base/data/home/apps/myapp/1.332577102462600463/applications/ > > init/controllers/default.py", line 117, in > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > globals.py", line 75, in > > self._caller = lambda f: f() > > File "/base/data/home/apps/myapp/1.332577102462600463/applications/ > > init/controllers/default.py", line 101, in user > > return dict(form=auth()) > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > tools.py", line 411, in __call__ > > return self.change_password() > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > tools.py", line 900, in change_password > > requires=[IS_EXPR('value==%s' % repr(pass1))])) > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > sqlhtml.py", line 658, in form_factory > > return SQLFORM(SQLDB(None).define_table('no_table', *fields), > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/sql.py", > > line 851, in define_table > > t = self[tablename] = SQLTable(self, tablename, *fields) > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/sql.py", > > line 1006, in __init__ > > 'define_table argument is not a SQLField' > > SyntaxError: define_table argument is not a SQLField > > > Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19170] Re: change_password problem on GAE
It works now. Thank you! On Apr 5, 8:13 pm, mdipierro wrote: > I think I fixed it in trunk. Please give it a try. > > Massimo > > On Apr 5, 11:28 am, Vidul Petrov wrote: > > > > > change_password works fine except on GAE: > > > Traceback (most recent call last): > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > restricted.py", line 98, in restricted > > exec ccode in environment > > File "/base/data/home/apps/myapp/1.332577102462600463/applications/ > > init/controllers/default.py", line 117, in > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > globals.py", line 75, in > > self._caller = lambda f: f() > > File "/base/data/home/apps/myapp/1.332577102462600463/applications/ > > init/controllers/default.py", line 101, in user > > return dict(form=auth()) > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > tools.py", line 411, in __call__ > > return self.change_password() > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > tools.py", line 900, in change_password > > requires=[IS_EXPR('value==%s' % repr(pass1))])) > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > sqlhtml.py", line 658, in form_factory > > return SQLFORM(SQLDB(None).define_table('no_table', *fields), > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/sql.py", > > line 851, in define_table > > t = self[tablename] = SQLTable(self, tablename, *fields) > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/sql.py", > > line 1006, in __init__ > > 'define_table argument is not a SQLField' > > SyntaxError: define_table argument is not a SQLField > > > Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19174] Re: change_password problem on GAE
I just saw another error - on form submit: Traceback (most recent call last): File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ restricted.py", line 98, in restricted exec ccode in environment File "/base/data/home/apps/myapp/1.332578716997575186/applications/ init/controllers/default.py", line 118, in File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ globals.py", line 75, in self._caller = lambda f: f() File "/base/data/home/apps/myapp/1.332578716997575186/applications/ init/controllers/default.py", line 102, in user return dict(form=auth()) File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ tools.py", line 412, in __call__ return self.change_password() File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ tools.py", line 902, in change_password onvalidation=onvalidation): File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ sqlhtml.py", line 476, in accepts onvalidation, File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ html.py", line 894, in accepts status = self._traverse(status) File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ html.py", line 290, in _traverse newstatus = c._traverse(status) and newstatus File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ html.py", line 290, in _traverse newstatus = c._traverse(status) and newstatus File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ html.py", line 290, in _traverse newstatus = c._traverse(status) and newstatus File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ html.py", line 290, in _traverse newstatus = c._traverse(status) and newstatus File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ html.py", line 296, in _traverse newstatus = self._validate() File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ html.py", line 707, in _validate (value, errors) = validator(value) File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ validators.py", line 266, in __call__ if self.dbset(field == value).count(): File "/base/data/home/apps/myapp/1.332578716997575186/gluon/contrib/ gql.py", line 632, in __call__ raise SyntaxError SyntaxError: None On Apr 5, 8:13 pm, mdipierro wrote: > I think I fixed it in trunk. Please give it a try. > > Massimo > > On Apr 5, 11:28 am, Vidul Petrov wrote: > > > > > change_password works fine except on GAE: > > > Traceback (most recent call last): > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > restricted.py", line 98, in restricted > > exec ccode in environment > > File "/base/data/home/apps/myapp/1.332577102462600463/applications/ > > init/controllers/default.py", line 117, in > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > globals.py", line 75, in > > self._caller = lambda f: f() > > File "/base/data/home/apps/myapp/1.332577102462600463/applications/ > > init/controllers/default.py", line 101, in user > > return dict(form=auth()) > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > tools.py", line 411, in __call__ > > return self.change_password() > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > tools.py", line 900, in change_password > > requires=[IS_EXPR('value==%s' % repr(pass1))])) > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > sqlhtml.py", line 658, in form_factory > > return SQLFORM(SQLDB(None).define_table('no_table', *fields), > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/sql.py", > > line 851, in define_table > > t = self[tablename] = SQLTable(self, tablename, *fields) > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/sql.py", > > line 1006, in __init__ > > 'define_table argument is not a SQLField' > > SyntaxError: define_table argument is not a SQLField > > > Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19180] Re: change_password problem on GAE
Perfect, thank you, Massimo. On Apr 5, 10:10 pm, mdipierro wrote: > Fixed in trunk. Please give it a try. > > Massimo > > On Apr 5, 1:21 pm, Vidul Petrov wrote: > > > > > I just saw another error - on form submit: > > > Traceback (most recent call last): > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > restricted.py", line 98, in restricted > > exec ccode in environment > > File "/base/data/home/apps/myapp/1.332578716997575186/applications/ > > init/controllers/default.py", line 118, in > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > globals.py", line 75, in > > self._caller = lambda f: f() > > File "/base/data/home/apps/myapp/1.332578716997575186/applications/ > > init/controllers/default.py", line 102, in user > > return dict(form=auth()) > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > tools.py", line 412, in __call__ > > return self.change_password() > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > tools.py", line 902, in change_password > > onvalidation=onvalidation): > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > sqlhtml.py", line 476, in accepts > > onvalidation, > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > html.py", line 894, in accepts > > status = self._traverse(status) > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > html.py", line 290, in _traverse > > newstatus = c._traverse(status) and newstatus > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > html.py", line 290, in _traverse > > newstatus = c._traverse(status) and newstatus > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > html.py", line 290, in _traverse > > newstatus = c._traverse(status) and newstatus > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > html.py", line 290, in _traverse > > newstatus = c._traverse(status) and newstatus > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > html.py", line 296, in _traverse > > newstatus = self._validate() > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > html.py", line 707, in _validate > > (value, errors) = validator(value) > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/ > > validators.py", line 266, in __call__ > > if self.dbset(field == value).count(): > > File "/base/data/home/apps/myapp/1.332578716997575186/gluon/contrib/ > > gql.py", line 632, in __call__ > > raise SyntaxError > > SyntaxError: None > > > On Apr 5, 8:13 pm, mdipierro wrote: > > > > I think I fixed it in trunk. Please give it a try. > > > > Massimo > > > > On Apr 5, 11:28 am, Vidul Petrov wrote: > > > > > change_password works fine except on GAE: > > > > > Traceback (most recent call last): > > > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > > > restricted.py", line 98, in restricted > > > > exec ccode in environment > > > > File "/base/data/home/apps/myapp/1.332577102462600463/applications/ > > > > init/controllers/default.py", line 117, in > > > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > > > globals.py", line 75, in > > > > self._caller = lambda f: f() > > > > File "/base/data/home/apps/myapp/1.332577102462600463/applications/ > > > > init/controllers/default.py", line 101, in user > > > > return dict(form=auth()) > > > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > > > tools.py", line 411, in __call__ > > > > return self.change_password() > > > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > > > tools.py", line 900, in change_password > > > > requires=[IS_EXPR('value==%s' % repr(pass1))])) > > > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/ > > > > sqlhtml.py", line 658, in form_factory > > > > return SQLFORM(SQLDB(None).define_table('no_table', *fields), > > > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/sql.py", > > > > line 851, in define_table > > > > t = self[tablename] = SQLTable(self, tablename, *fields) > > > > File "/base/data/home/apps/myapp/1.332577102462600463/gluon/sql.py", > > > > line 1006, in __init__ > > > > 'define_table argument is not a SQLField' > > > > SyntaxError: define_table argument is not a SQLField > > > > > Any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19207] Re: Possible Bug with Auth API on Web2Py ???
Hi Yannick, I see no problem with the following validation: db.auth_user.email.requires=[IS_EMAIL(),IS_NOT_IN_DB (db,'auth_user.email')] On Apr 6, 5:36 am, Yannick wrote: > Hello mate, > For some reasons when using a custom form with two forms in the same > view the validation is not properly done. Here is an example with two > forms (Login and Register) in the same view. > The validation for the "Email" on the register form is not correct; > the user is able to register several users with the same email even if > this is set when the table is define > (table.email.requires = [IS_EMAIL(), > IS_NOT_IN_DB(db, '%s.email' > % > self.settings.table_user._tablename)])... > > This problem occur ONLY when there are two forms on the same view... > There is no problem on Email validation when we only have one form. > > Below is the sample of the controller and view: > > #Controller > ### > def logreg(): > loginform = auth.login(next="profile") > regform = auth.register(next="login") > > if regform.accepts(request.vars, formname='register'): > pass > > if loginform.accepts(request.vars,formname='login'): > pass > return dict(regform = regform, loginform = loginform) > > #View > ### > > # Register Form > > > type="text" value=" {{=regform.latest.first_name}}" /> > > type="text" value="{{=regform.latest.last_name}}" /> > > value="{{=regform.latest.email}}" /> > > value="{{=regform.latest.password}}"/> > > > > {{=regform.hidden_fields()}} > > > # Login Form > > > type="text" value="{{=loginform.latest.email}}" / > > name="password" type="password" value="{{=loginform.latest.password}}"/ > > > {{=loginform.hidden_fields()}} > > # > > Did anyone already had the same issue ? > > Thanks for your attention, > Yannick P. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19232] Re: Coooooool!
This is splendid! I am wondering - is jDiv able to show/hide some text/image, indicating the processing activity? On Apr 6, 9:31 am, "Zoom.Quiet" wrote: > On Mon, Apr 6, 2009 at 14:09, mdipierro wrote: > > > I just changed the layout > > >http://www.web2py.com/events/default/index > >http://www.web2py.com/examples/static/web2py.app.events.tar > > > try: > > - click on "form" > > - type a= 2 [enter] > > - type b= 3 [enter] > > > - click on "post a message" > > - type something and see the "list messages" open up automatically > > > - click on "register" and "login" and "logout" > > > - click on watch the movie! > > > - move jDivs (the windows) around. > > > - look at the source code on default.py > > > Isn't this cool? > > 囧rz... > web os ... > > > Pros? Cons? Suggestions for improvement? > > > Massimo > > --http://zoomquiet.org > '''过程改进乃是催生可促生靠谱的人的组织!''' > 金山常年招聘Py/C++人才!http://bit.ly/UoTV简历直投俺就成;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19238] GAE problem "Unable to send email"
The mail object works great except on GAE, the configuration is: mail.settings.server='smtp.gmail.com:587' mail.settings.sender='my_usern...@gmail.com' mail.settings.login='my_username:my_password' Anybody with the same problem? Could it be some GAE issue? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19249] Re: GAE problem "Unable to send email"
Hi Chrism, Thank you for the help. The problem is not on dev_server, but on appengine itself. Though I tried many different (valid) user accounts (including the GAE project's administrator email) there is no result - "Unable to send email". On Apr 6, 3:52 pm, murray3 wrote: > Vidul, > I spent some time looking into this problem, here is my post and > Massimo's solution. > > http://groups.google.com/group/web2py/browse_thread/thread/da75fe0570... > > regards > Chrism > > On Apr 6, 9:35 am, Vidul Petrov wrote: > > > > > The mail object works great except on GAE, the configuration is: > > > mail.settings.server='smtp.gmail.com:587' > > mail.settings.sender='my_usern...@gmail.com' > > mail.settings.login='my_username:my_password' > > > Anybody with the same problem? Could it be some GAE issue? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:19270] Re: GAE problem "Unable to send email"
Thank you, Massimo. It works fine now, but the sender (GAE limitation) can be only the registered admin account. Also mail.settings.server should be (as written in the docs) 'gae'. On Apr 6, 6:01 pm, mdipierro wrote: > On google > > mail.settings.login='my_username:my_password' > > should be > > mail.settings.login='my_usern...@gmail.com:my_password' > > On Apr 6, 8:09 am, Vidul Petrov wrote: > > > > > Hi Chrism, > > > Thank you for the help. > > > The problem is not on dev_server, but on appengine itself. > > Though I tried many different (valid) user accounts (including the GAE > > project's administrator email) there is no result - "Unable to send > > email". > > > On Apr 6, 3:52 pm, murray3 wrote: > > > > Vidul, > > > I spent some time looking into this problem, here is my post and > > > Massimo's solution. > > > >http://groups.google.com/group/web2py/browse_thread/thread/da75fe0570... > > > > regards > > > Chrism > > > > On Apr 6, 9:35 am, Vidul Petrov wrote: > > > > > The mail object works great except on GAE, the configuration is: > > > > > mail.settings.server='smtp.gmail.com:587' > > > > mail.settings.sender='my_usern...@gmail.com' > > > > mail.settings.login='my_username:my_password' > > > > > Anybody with the same problem? Could it be some GAE issue? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:20500] Re: Documentation
Yes the book is wonderful, the only problem I met is the format - pdf, it would be very useful if the book is in chm format, so that search and index tabs are available. I tried with different psd2chm converters, but they didn't work as expected. On Apr 24, 11:11 pm, JohnMc wrote: > I note that I am not the only newbie on the group. And not the only > one struggling with some of the finer points of web2py. (I have the > book, its great for starters.) Thing is as I watch the discussion the > docs for most of the details are out there. > > Is there some kind soul that could do a table of contents beyond the > book? Maybe by -- > > DAL > FORMS > Views > Javascript > High value internals. > > Essentially the AlterEgo, plus other docs just assembled in a > directory tree by subject. The epydocs are great but are kind of like > taking a sip from a firehose on full for somebody just starting out. > > Merely a suggestion. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:/] Translation in model
Hi, The translation seems not to work in models: db.contact.sender_name.requires = [IS_LENGTH(1,error_message=T('the name is too long'))] Anybody had a similar problem? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:20659] Re: Translation in model
Version 1.59 (2009-03-16 13:10:16) with slight modifications in "tools.py". On Apr 27, 9:16 pm, mdipierro wrote: > which version (date)? > > On Apr 27, 11:57 am, Vidul Petrov wrote: > > > > > Hi, > > > The translation seems not to work in models: > > > db.contact.sender_name.requires = [IS_LENGTH(1,error_message=T('the > > name is too long'))] > > > Anybody had a similar problem? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:20661] Re: Translation in model
The strings are in the language file, but they are not being translated if they come from models. On Apr 27, 9:20 pm, Vidul Petrov wrote: > Version 1.59 (2009-03-16 13:10:16) with slight modifications in > "tools.py". > > On Apr 27, 9:16 pm, mdipierro wrote: > > > > > which version (date)? > > > On Apr 27, 11:57 am, Vidul Petrov wrote: > > > > Hi, > > > > The translation seems not to work in models: > > > > db.contact.sender_name.requires = [IS_LENGTH(1,error_message=T('the > > > name is too long'))] > > > > Anybody had a similar problem? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~--~~~~--~~--~--~---
[web2py:20663] Re: Translation in model
Just tried revision 854 of languages.py, probably a wrong usage in my model: T.current_languages=['en', 'en-en'] try: T.force(session.language or 'en-en') except: T.force('en') and in the controller: lang_struct = {'BG':'bg-bg','RU':'ru-ru','EN':'en-en'} def change_language(): lang = request.vars.language function = request.vars.function if lang_struct.has_key(lang): session.language = lang_struct[lang] T.force(session.language) # I am in doubt about the proper usage here return redirect(URL(r=request,c=request.controller,f=function)) ? Thank you. On Apr 27, 9:25 pm, mdipierro wrote: > We changed things in languages.py since. Can you try the trunk? > > Massimo > > On Apr 27, 1:23 pm, Vidul Petrov wrote: > > > > > The strings are in the language file, but they are not being > > translated if they come from models. > > > On Apr 27, 9:20 pm, Vidul Petrov wrote: > > > > Version 1.59 (2009-03-16 13:10:16) with slight modifications in > > > "tools.py". > > > > On Apr 27, 9:16 pm, mdipierro wrote: > > > > > which version (date)? > > > > > On Apr 27, 11:57 am, Vidul Petrov wrote: > > > > > > Hi, > > > > > > The translation seems not to work in models: > > > > > > db.contact.sender_name.requires = [IS_LENGTH(1,error_message=T('the > > > > > name is too long'))] > > > > > > Anybody had a similar problem? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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 -~--~~~~--~~--~--~---