[web2py] Re: Error on LOAD() in trunk

2011-07-02 Thread LightOfMooN
ajax=False is very important for me, so, I like 1.96 more than 1.97 :) I use it at most interactive components, that can be displayed on the all pages of site. Just one example: def voting_viewlet(): if not session.has_key('finished_votings'): session.finished_votings = {} if

[web2py] How to create a new record in database without submit buttons

2011-07-02 Thread dorasan
Hello everyone. Could you tell me how to create a new record in database without submit buttons? I actually would like to do it by the onclick event. I know that I can call the ajax function like this. input name=name onClick=ajax('writing', ['title'], 'target') / But I dont know what I have

[web2py] Re: BUG: I think.

2011-07-02 Thread cjrh
On Jul 1, 8:34 pm, pbreit pbreitenb...@gmail.com wrote: I usually do extension='' What would extension=None do? It seems to make the most semantic sense, to me at least.

Re: [web2py] How to create a new record in database without submit buttons

2011-07-02 Thread cjrh
In the method called by the AJAX event, you don't need the form at all. You can just do a straight insert. You must pass the data to be inserted as part of the AJAX call, either via args, or post data or some other method on the URL. Then, inside writing(), just do a direct DB insert as

Re: [web2py] How to create a new record in database without submit buttons

2011-07-02 Thread portable dora
'Insert' method. That is what I wanted to know. Thank you so much!! 2011/7/2 cjrh caleb.hatti...@gmail.com In the method called by the AJAX event, you don't need the form at all. You can just do a straight insert. You must pass the data to be inserted as part of the AJAX call, either via

[web2py] Re: Multiple Domains, Subdomains, and Applications with SSL. Single web2py Instance on Apache

2011-07-02 Thread cjrh
If you format this post in markmin and email it to me, I'll add it to the book as an additional subsection after Apache setup.

Re: [web2py] Forcing SSL/HTTPS

2011-07-02 Thread cjrh
Added here: http://web2py.com/book/default/chapter/04#Cron Please verify that I got the details correct. Also, in future if you want something fixed in the book just email me directly and I'll get it done ASAP. My ability to follow the groups closely waxes and wanes relative to how busy I

[web2py] Re: Forcing SSL/HTTPS

2011-07-02 Thread cjrh
I have found that only the *new *Google Groups is working reliably. Using the old system has become very unreliable.

[web2py] Insert One to many related tables in GAE

2011-07-02 Thread José L .
Hi, I have a very simple case use that I'm not able to solve using GAE: I have a file with the content of two tables (cities and provinces). Cities have a db.provinces field, and when I start a new aplicacation I use to populate these tables using data from a module with this structure:

Re: [web2py] Insert One to many related tables in GAE

2011-07-02 Thread Vasile Ermicioi
GAE is a NoSQL database http://en.wikipedia.org/wiki/NoSQL but you can use a field where you can store a list of ids (one to many relation denormalized) http://web2py.com/book/default/chapter/06#Many-to-Many,-list:type,-and-contains

[web2py] regarding http://mdp.cti.depaul.edu/

2011-07-02 Thread Vineet
I was trying to see this link-- http://mdp.cti.depaul.edu/ Is this link broken? I could not access it.

Re: [web2py] Insert One to many related tables in GAE

2011-07-02 Thread José Luis Redrejo Rodríguez
2011/7/2 Vasile Ermicioi elff...@gmail.com: GAE is a NoSQL database http://en.wikipedia.org/wiki/NoSQL but you can use a field where you can store a list of ids (one to many relation denormalized) http://web2py.com/book/default/chapter/06#Many-to-Many,-list:type,-and-contains I know, but

[web2py] Re: Error on LOAD() in trunk

2011-07-02 Thread Massimo Di Pierro
Can you explain to me why you prefer ajax=False to ajax=True? What advantages do you expect? On Jul 2, 1:28 am, LightOfMooN vladsale...@yandex.ru wrote: ajax=False is very important for me, so, I like 1.96 more than 1.97 :) I use it at most interactive components, that can be displayed on the

[web2py] Re: regarding http://mdp.cti.depaul.edu/

2011-07-02 Thread Massimo Di Pierro
Where is that link? That was replaced by http://web2py.com more than 3 years ago. On Jul 2, 7:56 am, Vineet vineet.deod...@gmail.com wrote: I was trying to see this link--http://mdp.cti.depaul.edu/ Is this link broken? I could not access it.

[web2py] Re: BUG: I think.

2011-07-02 Thread Anthony
On Saturday, July 2, 2011 6:22:15 AM UTC-4, cjrh wrote: On Jul 1, 8:34 pm, pbreit pbreit...@gmail.com wrote: I usually do extension='' What would extension=None do? It seems to make the most semantic sense, to me at least. The code for URL does this: if extension is None and

Re: [web2py] How to create a new record in database without submit buttons

2011-07-02 Thread Anthony
Note, in that case, you won't be taking advantage of any of the built-in form processing, such as input validation and return/display of form errors. To get the validation, you could use the .validate_and_insert() method, but you'd still have to manually process and deal with the potential

Re: [web2py] Re: BUG: I think.

2011-07-02 Thread Jonathan Lundell
On Jul 2, 2011, at 7:41 AM, Anthony wrote: On Saturday, July 2, 2011 6:22:15 AM UTC-4, cjrh wrote: On Jul 1, 8:34 pm, pbreit pbreit...@gmail.com wrote: I usually do extension='' What would extension=None do? It seems to make the most semantic sense, to me at least. The code for URL

[web2py] Re: Error on LOAD() in trunk

2011-07-02 Thread LightOfMooN
With ajax=False I don't need some javascripts on every page. I can just add {{=LOAD('voting', 'voting_viewlet', ajax=False)[0][0]}} in layout.html, and on every page users can vote (for example), because ajax=False passed vars of current request to LOAD. And I liked it, because I can write some

[web2py] Re: Error on LOAD() in trunk

2011-07-02 Thread pbreit
I've just been using it as a way to compartmentalize code but without the extra request. For some things, the discrete load doesn't seem appropriate. If I lost Ajax=false, I would probably bring the code back into the calling view/controller. Which is not a huge deal for me. I'm also looking

Re: [web2py] Re: BUG: I think.

2011-07-02 Thread cjrh
On Saturday, 2 July 2011 16:57:11 UTC+2, Jonathan Lundell wrote: On Jul 2, 2011, at 7:41 AM, Anthony wrote: On Saturday, July 2, 2011 6:22:15 AM UTC-4, cjrh wrote: So, extension=None is saying that we're going to stick with the same extension as the current request, and if it happens to be

Re: [web2py] How to create a new record in database without submit buttons

2011-07-02 Thread portable dora
You were right Anthony. And I found what I exactly needed was 'Components' . I didn't want to refresh the entire page. But anyways, the fact that there is the insert method and it doesn't give me much to create a record from input forms, was new knowledge for me, so it was good to know about it.

Re: [web2py] Re: BUG: I think.

2011-07-02 Thread Jonathan Lundell
On Jul 2, 2011, at 9:37 AM, cjrh wrote: On Saturday, 2 July 2011 16:57:11 UTC+2, Jonathan Lundell wrote: On Jul 2, 2011, at 7:41 AM, Anthony wrote: On Saturday, July 2, 2011 6:22:15 AM UTC-4, cjrh wrote: So, extension=None is saying that we're going to stick with the same extension as the

Re: [web2py] Re: BUG: I think.

2011-07-02 Thread Anthony
Defaulting to 'html' is not what we want. In general, we don't want to see explict 'html' extensions in our urls. Instead, web2py is set up to interpret urls without extensions as 'html' view requests. If you explicitly pass 'html' to URL() as the extension, it will add it to the URL --

[web2py] Re: Error on LOAD() in trunk

2011-07-02 Thread pbreit
I don't know if this would work for you but you can compartmentalize view snippets and {{include}} them: {{include './html/item-box.html'}} I have zero desire to for JavaScript-less support.

Re: [web2py] Re: BUG: I think.

2011-07-02 Thread cjrh
(In reply to both JL and AB) The point regarding backwards compatibility is well-taken, I wouldn't want to mess with that at all. However, cognitive dissonance in code is a particular bugbear of mine. I am especially nervous (in general) of situations where one thing is used to

Re: [web2py] SQL UNIQUE IN WEB2PY : CONSTRAINT unique_test UNIQUE (num_part1, num_part2, num_part3, title)

2011-07-02 Thread Nick Arnett
On Fri, Jul 1, 2011 at 1:20 AM, Bruno Rocha rochacbr...@gmail.com wrote: Db.define_table('foo',Field('a'),Field('b'), Field('ab',unique=True, compute=lambda r: r.a + r.b)) This failed for me with sqlite and I see from other discussions that the same is true with Django - sqlite throws an error

[web2py] Re: Error on LOAD() in trunk

2011-07-02 Thread LightOfMooN
Yes, I can include templates with {{include}}, but I can't process vars by that way. On 2 июл, 23:38, pbreit pbreitenb...@gmail.com wrote: I don't know if this would work for you but you can compartmentalize view snippets and {{include}} them: {{include './html/item-box.html'}} I have zero

[web2py] Re: Error on LOAD() in trunk

2011-07-02 Thread Anthony
I believe templates that you include will have access to the current request.vars. You should even be able to call functions from views (though they would have to return HTML or some objects your view can then handle). On Saturday, July 2, 2011 2:59:44 PM UTC-4, LightOfMooN wrote: Yes, I can

Re: [web2py] Re: BUG: I think.

2011-07-02 Thread Jonathan Lundell
On Jul 2, 2011, at 10:52 AM, cjrh wrote: The point regarding backwards compatibility is well-taken, I wouldn't want to mess with that at all. However, cognitive dissonance in code is a particular bugbear of mine. I am especially nervous (in general) of situations where one thing is used

[web2py] Best practice for inserting possible duplicates?

2011-07-02 Thread Nick Arnett
Getting more comfortable with Web2Py and there sure is a lot to like about it. I'm wondering what is considered best practice for inserting records that might already exist, when I also want to get the id of the record if it does exist. I haven't come across a shortcut for this. For now, I'm

[web2py] customizing instant press layout

2011-07-02 Thread Andrew Thompson
Greetings, I just installed Instant Press and am trying to figure out how to skin it. The views/layout.html says you should create views/layouts/xxx, but it's not real specific on what to name those files. I've tried views/layouts/layout.html and views/layouts/index.html, but neither seem to

[web2py] improvement of a multiselect update design

2011-07-02 Thread Nicolas Palumbo
At this moment I am doing this for a multiselect form page: db.py: db.define_table('instance',Field('app',db.application),Field('server',db.server),Field('type','string'),format=lambda r: '%s %s' % (db.application[r.app].name,db.server[r.server].hostname)) #table constraints:

[web2py] Re: Best practice for inserting possible duplicates?

2011-07-02 Thread Anthony
Be careful about using an 'except' without specifying specific exception types -- that code will attempt an insert regardless of the reason for the failure in the 'try' clause. Anthony On Saturday, July 2, 2011 6:05:46 PM UTC-4, Nick Arnett wrote: Getting more comfortable with Web2Py and

[web2py] Re: Error on LOAD() in trunk

2011-07-02 Thread pbreit
I also use LOAD(ajax=False) in emails and am not sure how well ajax=True would work in various email clients.

[web2py] Re: Dropdown field not being accepted

2011-07-02 Thread Happy Rob
Thanks for the ideas, I'm looking at the source code now. On Jul 1, 6:15 pm, Bruno Rocha rochacbr...@gmail.com wrote: Here is a modified versionhttps://bitbucket.org/rochacbruno/surveycloud Bug fixes Auth included No more cpuckle Powertables Smart reports http://zerp.ly/rochacbruno Em

[web2py] Unexpected 404s

2011-07-02 Thread pbreit
I'm getting some unexpected 404s. Is there any way to make sure any route caching is flushed? Any other ideas what might cause the problem? Nginx + uWSGI on Ubuntu.

[web2py] Re: Unexpected 404s

2011-07-02 Thread pbreit
False alarm. Missing view. Have missing views always generated 404s? I know the generics changed so missing views used to be rare.

Re: [web2py] Re: Best practice for inserting possible duplicates?

2011-07-02 Thread Nick Arnett
On Sat, Jul 2, 2011 at 7:39 PM, Anthony abasta...@gmail.com wrote: Be careful about using an 'except' without specifying specific exception types -- that code will attempt an insert regardless of the reason for the failure in the 'try' clause. I was wondering if someone would mention that...

[web2py] Re: Best practice for inserting possible duplicates?

2011-07-02 Thread Massimo Di Pierro
Do this instead try: urlID = db.web_page(url=url).id except (KeyError,TyepError): urlID = db.web_page.insert(url=url) or better row = db.web_page(url=url) urlID = row and row.id or db.web_page.insert(url=url) If db.web_page(url=url) fails with an OperationalError (database

[web2py] how to implement database tables with one level of indirection?

2011-07-02 Thread Luis Goncalves
Hello! How do I make a database table where the fields are defined by another table? For example, suppose some users of my system are event organizers, and they can define what fields would belong in a person's profile. Then, attendees of that event have to fill out a profile with those