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
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
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
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
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
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
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
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
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
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
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
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
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
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
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():
>
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
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
>
> .
>> 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
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.
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
> 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
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
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
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
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
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
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
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
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
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=
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?
--~--~-~--~---
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
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
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
--~--~-~--~~-
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
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
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
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
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
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
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
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
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'
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
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
--~--~-~--~~--
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
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*
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
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
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
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 (
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
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
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
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:
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
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.
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
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
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
>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
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
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
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_
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
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
66 matches
Mail list logo