[web2py] vCard and vEvent

2012-04-15 Thread Annet
In a web2py application I generate .vcf and .ics files using web2py's templating features. The problem is that all the code in {{}} results in empty lines, which is no problem on my Mac, but Google doesn't allow empty lines. For example, this: {{response.headers['Content-Disposition'] = 'attac

Re: [web2py] CMS/blog app suitable for web2py beginners

2012-04-15 Thread Chibuzo Ottih
Yeah, with instantpress, you can manage users, create tags and categories, publish articles in few seconds and more. It also has the ability to manage comments. To see more, I think you should download it and add it as an application to your web2py framework to see how it works. Most of your config

Re: [web2py] Overlapping periods

2012-04-15 Thread Rick
Thanks for the replies. Pbreit, you pointed the real issue -- what should I call the arguments (addperiodform.vars.id), that are passed from the goal function to the addingperiod function? from the controller file: def goal(): ...some code... addperiodform = SQLFORM(db.period, field

[web2py] smartgrid crashes when submitting a duplicate field value

2012-04-15 Thread weheh
If smartgrid is used to edit the values of fields in auth_user that are designated unique=True, smartgrid will crash when a duplicate value is entered. Here's a ticket trace. SQLite is the underlying db. Incidentally, this is my first go at grid and smartgrid and I'm very impressed. Kudos. Fi

Re: [web2py] Re: Multiselect form and many-to-many relationship

2012-04-15 Thread Chris Rowson
Heh, no worries. :-) I wonder, just out of interest, is there any great performance difference between searching for records containing region.id 'x' (as below) rather than returning all rows with region.id 'x' from a junction table? Chris On Sat, Apr 14, 2012 at 11:34 PM, villas wrote: > Oops

[web2py] Re: Vertical lines around database string values

2012-04-15 Thread Yarin
This went away, don't know why or how.. On Saturday, April 14, 2012 11:17:51 AM UTC-4, Yarin wrote: > > When inserting records with web2py's db class, my string values have > vertical bars surrounding them. I don't remember seeing this behavior > before. What's more, if i insert records through

[web2py] Re: vCard and vEvent

2012-04-15 Thread Anthony
> > In a web2py application I generate .vcf and .ics files using web2py's > templating features. The problem is that all the code in {{}} results in > empty lines, which is no problem on my Mac, but Google doesn't allow empty > lines. For example, this: > > {{response.headers['Content-Disposit

[web2py] Re: How to create a form from db.mytable, add checkboxes to each row and use form.custom.begin?

2012-04-15 Thread DenesL
Only SQLFORM has a custom attribute. You are using FORM.

[web2py] Re: how to access google spreadsheets using Oauth2 in web2py

2012-04-15 Thread Massimo Di Pierro
Look into gluon/contrib/login_methods/oauth2_auth.py there is sample code in there. On Saturday, 14 April 2012 09:33:51 UTC-5, SB wrote: > > how to access google spreadsheets using Oauth2 in web2py. Need help. >

[web2py] Re: Design of a minimal chat-like application in Web2py

2012-04-15 Thread Massimo Di Pierro
there is a chat in KPAX (in its own controller). Not very efficient because does not uses websockets but works. You may want to look also into gluon/contrib/comet_messaging.py On Friday, 13 April 2012 17:30:19 UTC-5, cyan wrote: > > > Hi group, > > I am trying to make a minimal multiuser chat-li

[web2py] Re: new feature in trunk: full auditing

2012-04-15 Thread Massimo Di Pierro
Fixed in trunk. On Saturday, 14 April 2012 23:10:18 UTC-5, tomt wrote: > > I discovered why the archive table wasn't being created, there is a typo > in gluon/tools.py at line 1293: > for table in tables: > if 'modifed_on' in table.fields(): > should be > for table in

[web2py] Re: smartgrid crashes when submitting a duplicate field value

2012-04-15 Thread Massimo Di Pierro
Please submit a google code ticket. On Sunday, 15 April 2012 06:09:19 UTC-5, weheh wrote: > > If smartgrid is used to edit the values of fields in auth_user that are > designated unique=True, smartgrid will crash when a duplicate value is > entered. Here's a ticket trace. SQLite is the underlyin

[web2py] Re: How to create a form from db.mytable, add checkboxes to each row and use form.custom.begin?

2012-04-15 Thread web2py_Superfan
Thanks a bunch DenesL, Do you know how I could use SQLFORM and have the checkboxes added to each row in the form? I couldn't figure that out. On Sunday, April 15, 2012 7:12:13 AM UTC-7, DenesL wrote: > > > Only SQLFORM has a custom attribute. > You are using FORM. > > >

[web2py] Re: How to create a form from db.mytable, add checkboxes to each row and use form.custom.begin?

2012-04-15 Thread web2py_Superfan
when I change FORM to SQLFORM i get error 'THEAD' object has no attribute 'writable' On Sunday, April 15, 2012 7:58:37 AM UTC-7, web2py_Superfan wrote: > > Thanks a bunch DenesL, Do you know how I could use SQLFORM and have the > checkboxes added to each row in the form? I couldn't figure th

Re: [web2py] Re: Multiselect form and many-to-many relationship

2012-04-15 Thread villas
Depends, but I think there would always be a difference in favour of normalized data because the data access is fully indexed. However, this difference may be almost negligible if your main table is less than say 10K records and your queries are simple. In my experience, where performance

[web2py] Re: How to create a form from db.mytable, add checkboxes to each row and use form.custom.begin?

2012-04-15 Thread DenesL
You can not just substitute FORM with SQLFORM. In your case it is better to stick with FORM and use element to access and modify the table inside the form. tbod=form.element('table tbody') # the body of the SQLTABLE tbod is a list of the table rows, so tbod[0] is the first TR and each TR is a li

[web2py] Re: How to create a form from db.mytable, add checkboxes to each row and use form.custom.begin?

2012-04-15 Thread web2py_Superfan
Thanks again, will give it a shot On Sunday, April 15, 2012 9:39:32 AM UTC-7, DenesL wrote: > > > You can not just substitute FORM with SQLFORM. > In your case it is better to stick with FORM and use element to access and > modify the table inside the form. > > tbod=form.element('table tbody') #

Re: [web2py] CPU 210%

2012-04-15 Thread Bruce Wade
I think it was the server. I rebuilt/installed from scratch OS etc.. the server last night and now it seems to be running without problems. I am slowing increasing the load to see how well it handles before moving it to the new site again. On Sat, Apr 14, 2012 at 8:13 PM, Bruno Rocha wrote: > We

[web2py] Anyone use Jmeter for load testing web2py before?

2012-04-15 Thread Bruce Wade
Hi, I want to load test my server to see how much it can handle while running my web2py app. I came across Jmeter has any used this or have a better suggestion? http://jmeter.apache.org/ -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.fitt

Re: [web2py] shared host deployment of my web2py site

2012-04-15 Thread Keith Edmunds
On Sun, 15 Apr 2012 07:36:19 +0100, doncoleon...@gmail.com said: > So you mean I should just click the 'configure' file? You need to do this from the command line. > And how do I add > the parameters, are u saying It's "you", not "u". You need a open a terminal window and type in the commands

Re: [web2py] Eclipse and autocomplete

2012-04-15 Thread cyan
I've just tried it out. Unzip the latest stable source code of web2py to a folder, say, "web2py_src". Go to Eclipse - Preferences - PyDev - 'Interpreter - Python' In the 'System PYTHONPATH' window, add 'web2py_src' to the path. So far, it seems autocomplete is working without doing all the impo

[web2py] routes.py

2012-04-15 Thread namfonos
got a problem with my routes routes_in = ( ('/asdf', '/aggat/default/rules'), ) routes_out = ( ('/aggat/default/rules', '/asdf'), ) isn't working, but i followed the same format on the web2py tutorial defining the base router works when i have that defined alone

[web2py] Re: DAL IMAP errors

2012-04-15 Thread Alan Etkin
Not fixed yet in trunk. There is a regex replacement proposal in the issue page by Massimo. El sábado, 14 de abril de 2012 22:44:41 UTC-3, pyhead escribió: > > > Hi web2py users, > > db = DAL('imap://') successfully logs in to the mail server, but fails > when the commonly used spaces or '.' are

[web2py]

2012-04-15 Thread Bruce Wade
Does web2py automatically save a cPickle in the database as gluon.storage? Because I saved ads with the web2py framework, however now when trying to load them with the old framework I get an error ImportError: No module named gluon.storage when I don't use gluon at all in that old framework. -- -

[web2py] Re:

2012-04-15 Thread Anthony
What exactly did you save in the database? On Sunday, April 15, 2012 8:10:50 PM UTC-4, Bruce Wade wrote: > > Does web2py automatically save a cPickle in the database as gluon.storage? > Because I saved ads with the web2py framework, however now when trying to > load them with the old framework I

Re: [web2py] Re:

2012-04-15 Thread Bruce Wade
ads = [] if random_ads: for index, url in enumerate(random_ads): ads.append({ 'index': index, 'id': url['id'], 'url': url['url'], 'valid': '',

Re: [web2py] Re:

2012-04-15 Thread Anthony
And what are the index, url['id'], and url['url'] objects? Are any of them storage objects? On Sunday, April 15, 2012 8:19:45 PM UTC-4, Bruce Wade wrote: > >ads = [] >if random_ads: > for index, url in enumerate(random_ads): > ads.append

Re: [web2py] Re:

2012-04-15 Thread Bruce Wade
url['id'] = integer url['url'] = string On Sun, Apr 15, 2012 at 7:03 PM, Anthony wrote: > And what are the index, url['id'], and url['url'] objects? Are any of them > storage objects? > > > On Sunday, April 15, 2012 8:19:45 PM UTC-4, Bruce Wade wrote: >> >>ads = [] >>if r

[web2py] Re: Add conditional sub-menu

2012-04-15 Thread Cliff
Omi, Sorry, my bad. Been away. Should be: sub_menu = [('Admin', False, URL('admin'), []), ] # Added empty list On Thursday, April 12, 2012 9:43:39 AM UTC-4, Omi Chiba wrote: > > Cliff, > > Thank you for sharing code but now I got a different error. Maybe it > cannot understand sub_menu

[web2py] Re: Browser back button: Reloading database results

2012-04-15 Thread Cliff
Good point. Also that is the rule of thumb for we applications. A request that can make a change to a resource should be a POST. A request to access a resource should be a GET. On Thursday, April 12, 2012 8:15:09 AM UTC-4, villas wrote: > > My conclusion is that it is better to submit search fo

[web2py] how to intercept password before encryption, if possible?

2012-04-15 Thread weheh
I'm building an administrative interface where only the admin can register new users. Upon registering a new user, the system will email login and initial temporary password to user. I'm using the auth_user table but with a customized form and create action. Is there a way to capture the passwor

Re: [web2py] Re: Add conditional sub-menu

2012-04-15 Thread Omi Chiba
Cliff, Thanks ! I'm on vacation but I will try when I come back but I'm sure it works !! On Sun, Apr 15, 2012 at 9:52 PM, Cliff wrote: > Omi, > > Sorry, my bad. Been away. > > Should be: > sub_menu = [('Admin', False, URL('admin'), []), ] # Added empty list > > On Thursday, April 12, 20

Re: [web2py] how to intercept password before encryption, if possible?

2012-04-15 Thread Bruce Wade
use request.vars.password to get unencrypted and form.vars.password for encrypted if you use requires CRYPT() On Sun, Apr 15, 2012 at 8:06 PM, weheh wrote: > I'm building an administrative interface where only the admin can register > new users. Upon registering a new user, the system will email

[web2py] Re: how to intercept password before encryption, if possible?

2012-04-15 Thread Matt Gorecki
In one of my applications, I create users by hand as well with a custom form. My flow goes something like this: 1. Fill out the Create User form. There are is no password field here. 2. In the function that processes the form, I generate a random, readable password at the beginning. 3. Before i

[web2py] Re: how to intercept password before encryption, if possible?

2012-04-15 Thread weheh
that makes sense. thanks! On Monday, April 16, 2012 11:39:52 AM UTC+8, Matt Gorecki wrote: > > In one of my applications, I create users by hand as well with a custom > form. My flow goes something like this: > > 1. Fill out the Create User form. There are is no password field here. > 2. In the

Re: [web2py] how to intercept password before encryption, if possible?

2012-04-15 Thread weheh
Thanks, Bruce. It's good to know where this is being stored. Actually, I like Matt's suggestion for auto-password generation. I'm doing this for a client and I assumed they wanted to choose the password, but Matt's approach makes more sense to me. On Monday, April 16, 2012 11:38:09 AM UTC+8, Br

[web2py] Re: DAL IMAP errors

2012-04-15 Thread Massimo Di Pierro
Will the proposed solution solve the problem? replace mailbox_name = mailbox.replace("[", "").replace("]", "").replace("/", "_") with mailbox_name = re.sub('[^_\w]','',re.sub('[/ ]','_',mailbox)) On Sunday, 15 April 2012 18:40:29 UTC-5, Alan Etkin wrote: > > Not fixed yet in trunk. There is

Re: [web2py] Re:

2012-04-15 Thread Anthony
I assume a Storage object got into some part of one of your ads objects somehow. How is the url object created? Aside from that insert code, is there any other code that updates the records? On Sunday, April 15, 2012 10:27:41 PM UTC-4, Bruce Wade wrote: > > url['id'] = integer > url['url'] = str

Re: [web2py] Re:

2012-04-15 Thread Bruce Wade
The code I showed you is exactly how ads are created and stored in the database. It is all through that code. The code that updates the code uses cPickle.loads and treats it like a python object updating the array then redumps it cPickle.dumps before saving. This is the exact same code I use in t

[web2py] Re: vCard and vEvent

2012-04-15 Thread Annet
Hi Anthony, Thanks for your reply. You could do: > > {{if organization:}}FN: {{=organization.name}} > ORG: {{=organization.name}}{{pass}} > > and you won't get any blank lines when there is an organization, but I > think you'll still get two blank lines when there is no organization. > This won

Re: [web2py] Re:

2012-04-15 Thread Anthony
> > The code I showed you is exactly how ads are created and stored in the > database. It is all through that code. The code doesn't show how the random_ads object and the url objects it contains are created. > The code that updates the code uses cPickle.loads and treats it like a > python

Re: [web2py] Re:

2012-04-15 Thread Anthony
You might also try inspecting the contents of some of the records. Do all records include a Storage object, or just some? What part of the dumped "ads" object is a Storage object? This may provide some clues. Anthony On Monday, April 16, 2012 1:27:19 AM UTC-4, Anthony wrote: > > The code I show

Re: [web2py] Re:

2012-04-15 Thread Bruce Wade
random ads web2py query: unseen_ads = unseen_ads_query.select(orderby='', limitby=(0,5)) return unseen_ads update is pretty much the exact same code as provided before, with the different it appends to the list of ads it got from the database. today_ads = self.db((self.db.viewedads.member_id == me

[web2py] Re: vCard and vEvent

2012-04-15 Thread Anthony
Sorry, my mistake -- there is no "context" argument. Just pass the dict as an unnamed argument, or pass each item as its own keyword argument: response.render(dict(organization=session.organization, ...)) or just: response.render(organization=session.organization, ...) Side note: you don't nee

Re: [web2py] Re:

2012-04-15 Thread Anthony
> > random_ads = self._get_random_urls(ad_ids_to_skip) > for new_ad in random_ads: > ad_details = { > 'index':start_index, > 'id':new_ad['id'], > 'url':new_ad['url'], > 'valid':'', >

[web2py] Re: vCard and vEvent

2012-04-15 Thread Annet
Hi Anthony, Thanks for your help, problem solved. Side note: you don't need the line continuation slash ("\") if what you're > continuing is in parentheses. > I appreciate the side node. Kind regards, Annet

Re: [web2py] heroku, web2py and gunicorn

2012-04-15 Thread Rahul
It gives me an error - *-bash-3.2$ python anyserver.py -s gunicorn -i 72.3.247.225 -p 9065* starting gunicorn on 72.3.247.225:9065... Traceback (most recent call last): File "anyserver.py", line 299, in main() File "anyserver.py", line 295, in main run(options.server,options.ip,optio