[web2py:13851] Performance question

2008-12-18 Thread SergeyPo
In case when I need to run many updates to database in long cycle, what is preferred for speed - to have one db.commit() at the end or commit() after every db update? E.g. for i in range(10): db(db.details.id==i).update(**dict([(destination_field, i)])) db.commit() or for i in rang

[web2py:13850] Re: Request for "Legend"

2008-12-18 Thread Iceberg
Agree with Yarko about at least we should emphasize TAG in document. And one more comment, when you talking about "section x.x", do you mean The Manual (http://www.amazon.com/Web2Py-Manual-Massimo-DiPierro/ dp/0470432322)? Just do not forget the users who only read the free online document. :P I

[web2py:13849] Re: Template Systems w web2py

2008-12-18 Thread mdipierro
not sure I understand. you can {{include 'othertemplate.html'}} {{def item(u)}}any html you like using {{=u}} and loops{{return}} then inlude it {{item(3)}} On Dec 18, 5:29 pm, mike wrote: > Are there any suggestions for template systems with web2py > > I would like to have an ability to have

[web2py:13848] Re: Template Systems w web2py

2008-12-18 Thread mdipierro
you can {{include 'othertemplate.html'}} you can also {{def item(u)}}{{=u}} {{item('http://www.google.com')}} On Dec 18, 5:29 pm, mike wrote: > Are there any suggestions for template systems with web2py > > I would like to have an ability to have small templates that can be > reused througo

[web2py:13847] Re: Chaning the Menu order

2008-12-18 Thread mdipierro
call them 1/Main 2/About 3/Contact Us On Dec 18, 3:20 pm, mike wrote: > In T3, is there a way to change the order of the menu items. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To

[web2py:13846] Re: t3 on launchpad, t2 will die

2008-12-18 Thread James Ashley
This is based on the way I understand T2 and T3. I haven't actually used them, so I could be totally off base here. On Dec 17, 1:38 pm, "Paul D. Eden" wrote: > +1 for adding a plugin system to web2py and making T2 a plugin. I'm going to +1 that as well. > > A standardised and documented plugi

[web2py:13845] Re: Request for "Legend"

2008-12-18 Thread Yarko Tymciurak
I think I agree with you on this - TAG could have a more prominent place in documents - it's not mentioned at the top of the section on HTML Helpers, and yet is the "catchall / make-your-own" it would be good to mention at the beginning of section 5.2 (separate from how you fall on "LEGEND" as

[web2py:13844] Re: Orderby: desc

2008-12-18 Thread Yarko Tymciurak
db().select(db.table.ALL, orderby=~db.table.desc) # the '~' makes the order descending; see P.146 in the book; On Thu, Dec 18, 2008 at 8:24 PM, Alexandre Miguel de Andrade Souza < alexandrema...@gmail.com> wrote: > Massimo, > > I buy the pdf book, but dont found how orderby in descendent order in

[web2py:13843] Design a Web Site for a Musician

2008-12-18 Thread Yarko Tymciurak
Jon Troast is amidwestern musician, relatively young-ish (30?), releases CD's (you can get one free by registering on his website), does house concerts (we liked him enough around here, we are asking him to come for a fund-raising concert series). Well, you might like the music - but that misses t

[web2py:13842] Pyjamas + web2py + twisted vs Django + Pinax

2008-12-18 Thread Tokyo Dan
I'm about to start programming a game in Python. The game will be a web-based board game with a social aspect, something like http://www.chesspark.com. I want the game to run in both browsers and as a desktop client. Therefore I'm wondering what python-based technologies I need. I know that Javas

[web2py:13841] Re: Request for "Legend"

2008-12-18 Thread Iceberg
It seems LEGEND does not qualify for either of the excluding criteria mentioned by Massimo. So I think it should be in. Denesl's solution is cool and helpful, I did not know that trick, really thanks! But, IMHO, TAG.LEGEND(...) is not intuitive to beginners of web2py. I mean, come on, who will go

[web2py:13840] Orderby: desc

2008-12-18 Thread Alexandre Miguel de Andrade Souza
Massimo, I buy the pdf book, but dont found how orderby in descendent order in DAL In sql; selet * from table order by table.field desc On Thu, Dec 18, 2008 at 4:59 PM, mdipierro wrote: > > simple way to block attackers on Linux > > 1) give sudo access to user running web2py to /sbin/iptable

[web2py:13839] Re: security tips

2008-12-18 Thread achipa
Careful with iptables, you can cut yourself off of your server (or the whole server off the net) that way real easy. Not to mention that you can cut off hotspots or whole ISP-s/campuses that use transparent proxies or NAT. Another reason not to do stuff this way is that on a busy site you will acc

[web2py:13838] Template Systems w web2py

2008-12-18 Thread mike
Are there any suggestions for template systems with web2py I would like to have an ability to have small templates that can be reused througout the main page. Ex. maybe have a file -> menuItem.html (would really like the ability to have separate files for different sub-templates) {{item}} Then

[web2py:13837] Re: security tips

2008-12-18 Thread pmate
Great post, Massimo! Thanks Paolo On 18 Dic, 19:59, mdipierro wrote: > simple way to block attackers on Linux > > 1) give sudo access to user running web2py to /sbin/iptables > 2) create a new app, let's call it "gatekeeper" with the following > default.py controller > >      def block(): >    

[web2py:13836] Re: SQLDB variable name as string

2008-12-18 Thread DenesL
I would love to use globals (or namespaces in general) but after reading about the problems of trying to obtain names in Python it seems a dead end and it is better to pursue alternate solutions. > So - if _I_ make a patch that lets you run a SHELL WHILE running the server > ... Souns interesti

[web2py:13835] Chaning the Menu order

2008-12-18 Thread mike
In T3, is there a way to change the order of the menu items. --~--~-~--~~~---~--~~ 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 fr

[web2py:13834] Re: SQLDB variable name as string

2008-12-18 Thread Yarko Tymciurak
> > . >> I can not remove all the names beginning with '_' since the variable >> name could be e.g. _DB > > > I think "first name" from reverse-sorted list of references in globals > would cover this (as I said earlier). > > that is, the internal references appear to be of the form _; rev

[web2py:13833] help with routes

2008-12-18 Thread mmstud
So im in a point of using routes to simplify my urls on my app, but since i have not done it before, i prefer to ask your advice. If i have understood correctly, i need to use web2py/routes.example.py -> routes.py and create mappings to routes_in. So far my application has a simple urls: domain.

[web2py:13832] Re: SQLDB variable name as string

2008-12-18 Thread Yarko Tymciurak
On Thu, Dec 18, 2008 at 2:49 PM, DenesL wrote: > > > Good - but you could extract from globals too... > > What? all this time you were making the case against globals (with > good reason). To clarify - my argument was against "first name" from globals; > > I can not remove all the names beginn

[web2py:13831] Re: SQLDB variable name as string

2008-12-18 Thread DenesL
> Good - but you could extract from globals too... What? all this time you were making the case against globals (with good reason). I can not remove all the names beginning with '_' since the variable name could be e.g. _DB > NOTE: if you're trying to do completion, and if we get an (ipython) sh

[web2py:13830] Re: SQLDB variable name as string

2008-12-18 Thread Yarko Tymciurak
Good - but you could extract from globals too... NOTE: if you're trying to do completion, and if we get an (ipython) shell optionally running along-side the normal admin server (I _think_ this is possible) then the environment should / could be dynamic. On Thu, Dec 18, 2008 at 2:02 PM, DenesL wr

[web2py:13829] Re: Question about DAL select

2008-12-18 Thread Chris Grindstaff
Thanks Massimo - That's a lot more straightforward - now back to learning. --~--~-~--~~~---~--~~ 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

[web2py:13828] Re: SQLDB variable name as string

2008-12-18 Thread DenesL
Since the models, controllers, etc. run every time there should not be much "garbage" in globals but for the sake of reliability I will require the db var name as a parameter instead. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[web2py:13827] Re: Question about DAL select

2008-12-18 Thread mdipierro
def who_went(): return dict(records=SQLTABLE(db((db.trip_who.trip==db.trip.id)& (db.who.id==db.trip_who.who)).select(orderby=db.trip.date| db.who.display))) On Dec 18, 12:55 pm, Chris Grindstaff wrote: > Hi all, > Just getting started here - I have a many to many relationship and I'm > try

[web2py:13826] Re: Unnecessary HTML code generated

2008-12-18 Thread mdipierro
you cannot do this > {{if is_admin:}} > {{extend 'adminLayout.html'}} > {{else:}} > {{extend 'layout.html'}} > {{pass}} because {{extend}} and {{include}} are not python commands but {{if...else...pass}} are. The former are resolved before the latter. You can do instead {{layout='admin

[web2py:13825] Question about DAL select

2008-12-18 Thread Chris Grindstaff
Hi all, Just getting started here - I have a many to many relationship and I'm trying to do a join. I have 3 tables: db.trip contains: date, name, etc db.who contains: first, last, display db.trip_who combines trips and users with SQLField('trip', db.trip), SQLField('who', db.who)) In my test con

[web2py:13824] Re: Unnecessary HTML code generated

2008-12-18 Thread mike
I get it when using T3. I did some modifications to the template, since then, I get this duplicate. Also, I made some changes to the header, this could be part of the issue: {{if is_admin:}} {{extend 'adminLayout.html'}} {{else:}} {{extend 'layout.html'}} {{pass}} instead off just loadi

[web2py:13823] security tips

2008-12-18 Thread mdipierro
simple way to block attackers on Linux 1) give sudo access to user running web2py to /sbin/iptables 2) create a new app, let's call it "gatekeeper" with the following default.py controller def block(): import os os.system('sudo iptables -I INPUT -s %s -j DROP' % request.cl

[web2py:13822] Re: Unnecessary HTML code generated

2008-12-18 Thread mdipierro
Sorry, I do not understand. How do you get this duplicate code? T3? Which page? Massimo On Dec 18, 12:22 pm, mike wrote: > Looking into the code that is generated, there is an extra html code > generated > > > > > > > > > Created by Michal Zak - Powered by href=

[web2py:13821] Unnecessary HTML code generated

2008-12-18 Thread mike
Looking into the code that is generated, there is an extra html code generated Created by Michal Zak - Powered by web2py This code is already part of the template, so its an unnecessary duplicate. Is there a way of removing this? --~--~-~--~---

[web2py:13820] Re: tip of the day: syntax highlighter

2008-12-18 Thread mdipierro
not really since pyments is out there and works well. Anyway, if we need to it is easy to add other languages. Massimo On Dec 18, 9:41 am, pedro wrote: > That's cool. > Is there plana to add others? > > > Do you know that web2py include a syntax highlighter for python, > > web2py, html, C/C++/J

[web2py:13819] Re: t3 on launchpad, t2 will die

2008-12-18 Thread mdipierro
good point. On Dec 18, 10:02 am, LEHMANN Gilles wrote: > Hello > > As a newbie in web2py and a "foreigner" I would propose a name like > w2pxxx or something like that. > > I have been studying web2py for few weeks now and I just very recently > found out the meaning of t2 and t3 ( for a while I

[web2py:13818] Re: close popup window on successful SQLFORM submit?

2008-12-18 Thread mdipierro
Try this: if form.accepts(): return HTML(BODY(SCRIPT('window.close()'))).xml () On Dec 18, 8:24 am, "richard.ree" wrote: > Can anyone suggest how I can close a popup window that shows a > SQLFORM, after a successful form.accepts()? Thanks in advance, > > -Rick --~--~-~--~~-

[web2py:13817] Re: t3 on launchpad, t2 will die

2008-12-18 Thread LEHMANN Gilles
Hello As a newbie in web2py and a "foreigner" I would propose a name like w2pxxx or something like that. I have been studying web2py for few weeks now and I just very recently found out the meaning of t2 and t3 ( for a while I was wondering if it has to do with "terms" in the year). It's quite d

[web2py:13816] Re: sync app email with t2.person email

2008-12-18 Thread mdipierro
You can pre populate a form by giving defaults to the fields. You can do this in the page itself. Massimo On Dec 18, 8:21 am, notabene wrote: > form=t2.create(db.test, onaccept=trigger) > As I understand 'onaccept' is an "after-insert" trigger. It does not > matter if I change form.vars in this

[web2py:13815] Re: Design considerations With WEB2PY

2008-12-18 Thread billf
I think these are fascinating articles. After over 20 years of applications development, I was convinced that stored procedures were the spawn of the devil. I was(am) convinced that 99% of the time people justify the tool they possess: if you're a DBA use SPs, if you're a programmer use code, if

[web2py:13814] Re: tip of the day: syntax highlighter

2008-12-18 Thread pedro
That's cool. Is there plana to add others? > Do you know that web2py include a syntax highlighter for python, > web2py, html, C/C++/Java? > > {{prg="for i in range(10): print i}} > {{=CODE(prg,language="python")}} > > language can be "python", "web2py", "html" (assumed embedded web2py), > "html_p

[web2py:13813] Re: T3: link from itemize-list to update page

2008-12-18 Thread Atanasius
Excuse me for being blind ;-) I tried to call the update page by its (in manage/pages) defined url name. After putting "wiki/" in front of the url name in the represent link expression it finally works fine. On 18 Dez., 11:56, mdipierro wrote: > t2 and self are the same object in t3. > > t2.act

[web2py:13812] close popup window on successful SQLFORM submit?

2008-12-18 Thread richard.ree
Can anyone suggest how I can close a popup window that shows a SQLFORM, after a successful form.accepts()? Thanks in advance, -Rick --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To po

[web2py:13811] Re: sync app email with t2.person email

2008-12-18 Thread notabene
form=t2.create(db.test, onaccept=trigger) As I understand 'onaccept' is an "after-insert" trigger. It does not matter if I change form.vars in this trigger. Are there any models for "before-update" and "before-insert" in T3? (other than copying and modifiing code from T3.) How do i pre-populate

[web2py:13810] Re: character encoding problem when retrieving data from database

2008-12-18 Thread achipa
Massimo: I need blobs just to force a certain encoding on mysql when the actual data and the table encodings are mismatched, it doesn't stay blob after the conversion (=the second statement). mmstud: no problem, everybody answers in his area of expertise and that's why we have sinergy even if th

[web2py:13809] Re: jquery tips

2008-12-18 Thread Timothy Farrell
There's also the privacy/security aspect too. Anytime you leave it to Google to serve something for your site, suddenly Google knows how much traffic your site gets and from whom.  That's great marketing data.  Yahoo has served it's libraries for a long time and this is the primary concern I'

[web2py:13808] Re: Need some help with simple form submission

2008-12-18 Thread pedro
I was using version 1.43 which is from september. I updated to the new one and now it works fine. I don't know what was wrong, but the validation was not working properly even when it was serialized only once. Anyway, thanks for the help. Problem solved. On 18 Dec, 14:28, mdipierro wrote: > whi

[web2py:13807] tip of the day: syntax highlighter

2008-12-18 Thread mdipierro
Do you know that web2py include a syntax highlighter for python, web2py, html, C/C++/Java? {{prg="for i in range(10): print i}} {{=CODE(prg,language="python")}} language can be "python", "web2py", "html" (assumed embedded web2py), "html_plain", "c", or "cpp". Massimo --~--~-~--~~--

[web2py:13806] Re: character encoding problem when retrieving data from database

2008-12-18 Thread mmstud
On 18 joulu, 15:03, achipa wrote: > For mysql for *empty* tables this would be > > ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8; > > If you want to *keep* the data, it's a different story. The CONVERT TO > operation converts column values between the character sets. This is > not what you

[web2py:13805] Re: character encoding problem when retrieving data from database

2008-12-18 Thread mdipierro
care with Blobs. web2py for portability stores blobs base64 encoded (like mime) and expects data from the blob base64 encoded. If data was not stored in the blob by web2py you may not be able to retrieve it without a conversion. Massimo On Dec 18, 7:03 am, achipa wrote: > For mysql for *empty*

[web2py:13804] Re: Need some help with simple form submission

2008-12-18 Thread mdipierro
which version of web2py are you using. With some old versions there was a problem if you serialized the same form twice. Massimo On Dec 18, 7:06 am, pedro wrote: > I didn't notice that, i put fives out of mistake, but if i put for > examples 1's across the board, the problem subsists. The valid

[web2py:13803] Re: Request for "Legend"

2008-12-18 Thread mdipierro
We tried to list the most common ones excluding those that should not be used (like FONT) and those that can be mimicked by other tags using CSS. Not sure this qualifies a logic behind our choice. Definitively we do not want to have a comprehensive set of tags, in particular since TAG was implemen

[web2py:13802] Re: Need some help with simple form submission

2008-12-18 Thread pedro
I didn't notice that, i put fives out of mistake, but if i put for examples 1's across the board, the problem subsists. The validators are not not catching anything, but the form is not being accepted for some other reason. (...) Ok, I just noticed something rather strange is happening. I usuall

[web2py:13801] Re: character encoding problem when retrieving data from database

2008-12-18 Thread achipa
For mysql for *empty* tables this would be ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8; If you want to *keep* the data, it's a different story. The CONVERT TO operation converts column values between the character sets. This is not what you want if you have a column in one character set (

[web2py:13800] Re: character encoding problem when retrieving data from database

2008-12-18 Thread mmstud
Tables are not made by web2py... is it possible to change table encoding afterwards? Now schema description says: ENGINE=MyISAM AUTO_INCREMENT=387210 DEFAULT CHARSET=latin1 Yet another feature id like to see is from Pylons, which enables doing console like excecution of python command on browser

[web2py:13799] Re: character encoding problem when retrieving data from database

2008-12-18 Thread achipa
PHP not having problems does not mean it's doing things right, it might be just repeating the same error on retrieval and thus making things look ok when in fact they aren't. As I pointed it out in the, other thread you might get away with this but only as long as you don't have many utf characte

[web2py:13798] Re: character encoding problem when retrieving data from database

2008-12-18 Thread mmstud
Im using MySQL. Same data is retrieved correctly on php side and there are no problems showing it on ui. Using php's own serialize and unserialize method ofcource. Now on python side some of data seems be problematic. Actually the part of the data, which seems to be a problems is: "Philosophy By

[web2py:13797] Re: character encoding problem when retrieving data from database

2008-12-18 Thread achipa
What database backend are you using ? We have another topic hammering at this at the moment, so there might be development it is handled. Generally, if all is well, you should not be doing any encode/decode- ing (unless your data is broken in the first place). On Dec 18, 12:21 pm, mmstud wrote:

[web2py:13796] Re: mod_wsgi deployment question

2008-12-18 Thread achipa
Without checking it myself, I'd say you could use mod_rewrite for that (although it's not for the faint at heart). Have the WSGIScriptAlias set at /web2py/ and then with a mod_rewrite statement, point paths without static into /web2py/... and keep the static pointing at the right place. I do have

[web2py:13795] Re: Request for "Legend"

2008-12-18 Thread mmstud
What is the logic defining some html element classes and not defining some anyway? I have created my own library of html elements, that i use on web2py, which at least tries to follow standard html specification. -Marko On 17 joulu, 17:42, DenesL wrote: > You can create it using the TAG helper.

[web2py:13794] character encoding problem when retrieving data from database

2008-12-18 Thread mmstud
Hi, a lot of wuestions ahs risen after using web2py, if i just got time to write them here. One of the latest is, that id like to know, how to retrieve data with correct encoding from database. My situatio is, that i have a php serialized data field, which i want to get to web2py application. I h

[web2py:13793] Re: T3: link from itemize-list to update page

2008-12-18 Thread mdipierro
t2 and self are the same object in t3. t2.action(name,value) is the same as URL(r=request,f=name,args= [value]) so in your case the id shoudl appear in http:///firma_aktualisieren/ID where ID is a number. when t2 is instantiated is parses the URL and should store int (request.args[-1] in t2

[web2py:13792] Re: T3: link from itemize-list to update page

2008-12-18 Thread Atanasius
Hi Massimo! Thank you for your help. But it's the same again (invalid function) with no hint for any error ticket How is the row.id passed to the update page? Why do you use "t2.action" in this case? I thought I read that "t2" is represented by "self" in T3 (which also doesn't succeed) Ulrich P

[web2py:13791] Re: A new hosting chance for web2py

2008-12-18 Thread carlo
>From their FAQ they are in Torino and Rome and servers are at INET farm in Rome. Lucky man you just came to Italy when we got one of the largest snowfall in recent years! carlo On 18 Dic, 09:06, mdipierro wrote: > I like the image with the sheep. Do you know where they are located? > > Massim

[web2py:13790] Re: mod_wsgi deployment question

2008-12-18 Thread vince
thanks your config works fine. but those files under static still serving by web2py. -vince On Dec 18, 3:48 pm, Johanm wrote: > I got some help with this a week or so ago. I found the manual to be > more confusing than > helpful.http://groups.google.com/group/web2py/browse_thread/thread/f4197d

[web2py:13789] Re: jquery tips

2008-12-18 Thread Yarko Tymciurak
Hi Phyo! :-) I'm w/ you & Massimo on this; doesn't seem worth it. If a really big site sees advantage, you can always do this yourself. For default - I don't think so... what about my app while I'm on an airplane? On Thu, Dec 18, 2008 at 2:34 AM, Phyo Arkar wrote: > Not really; > There are

[web2py:13788] Re: Date

2008-12-18 Thread pmate
Do you mean in the view? I just left {{extend 'layout.html'}} i even tried to do: @import url(calendar-win2k-1.css); and set the id of the two input text as "date" and a javascript function like this one described here: http://www.dynarch.com/demos/jscalendar/doc/html/reference.html#node_sec_

[web2py:13787] Re: jquery tips

2008-12-18 Thread Phyo Arkar
Not really; There are Big latency sometime happens on google, at least from this country . if you host Jquery on google there is extra process of doing a DNS lookup too . and sometimes DNS servers are slow. And Hi all, i was been away from Web2py for a while. On Thu, Dec 18, 2008 at 7:50 AM, Joh

[web2py:13786] Re: A new hosting chance for web2py

2008-12-18 Thread mdipierro
I like the image with the sheep. Do you know where they are located? Massimo PS. I am in Italy right now. If anybody in abruzzo would like to go skiing send me a private email. On Dec 18, 1:56 am, carlo wrote: > Browsing various forums to search for python (and web2py) hosting > alternatives