[web2py:24476] Re: Sessions and flash

2009-06-18 Thread Trollkarlen
I think that can be hard because the user is in this case already logged in. The upload page requiers login, then it sends the files to a new page. So in this stage i dont have the login credentials (password). /R On Jun 19, 5:28 am, mdipierro wrote: > you can try using basic authentication.

[web2py:24474] Re: google page count

2009-06-18 Thread Álvaro Justen [Turicas]
The number here is 64.700 On Fri, Jun 19, 2009 at 12:54 AM, Richard wrote: > > I get 61,100 > > On Jun 19, 1:47 pm, mdipierro wrote: >> It is just me or >> >> http://www.google.com/#q=web2py&fp=1&cad=b >> >> today returns 536,000 vs 50,600 of yesterday and every day before that. > > > -- Ál

[web2py:24475] Re: reserved database words

2009-06-18 Thread Richard
using an '_' is a good idea - thanks Sam On Jun 19, 1:37 pm, mdipierro wrote: > the new DAL, possibly out by the end of the month will take care of > these situations I look forward to it! > > On Jun 18, 10:12 pm, samwyse wrote: > > > There are two possibilities.  First, use names that cont

[web2py:24473] Re: google page count

2009-06-18 Thread Richard
I get 61,100 On Jun 19, 1:47 pm, mdipierro wrote: > It is just me or > > http://www.google.com/#q=web2py&fp=1&cad=b > > today returns 536,000 vs 50,600 of yesterday and every day before that. --~--~-~--~~~---~--~~ You received this message because you are subscrib

[web2py:24472] google page count

2009-06-18 Thread mdipierro
It is just me or http://www.google.com/#q=web2py&fp=1&cad=b today returns 536,000 vs 50,600 of yesterday and every day before that. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To po

[web2py:24471] Re: little patch for gluon/sql.py

2009-06-18 Thread mdipierro
good point. thanks. On Jun 18, 8:12 pm, Сл wrote: > hello all > > Here is a patch for gluon/sql.py to fix the raise of exception when > executing directly an sql statement. > For example: > db.executesql("ALTER SEQUENCE table_id_seq RESTART WITH 1;") > > -

[web2py:24470] little patch for gluon/sql.py

2009-06-18 Thread 小谢
hello all Here is a patch for gluon/sql.py to fix the raise of exception when executing directly an sql statement. For example: db.executesql("ALTER SEQUENCE table_id_seq RESTART WITH 1;") --- sql.py 2009-05-25 11:48:49.0 +0800 +++ sql.py

[web2py:24469] Re: reserved database words

2009-06-18 Thread mdipierro
the new DAL, possibly out by the end of the month will take care of these situations On Jun 18, 10:12 pm, samwyse wrote: > There are two possibilities.  First, use names that contain an > underscore.  AFAIK, there aren't any reserved words that have them. > Second, SQL has some special quoting r

[web2py:24468] Re: auto-menu for development

2009-06-18 Thread mr.freeze
Good point. I don't think it should replace the existing menu, just handy for me while developing. On Jun 18, 10:35 pm, mdipierro wrote: > The problem is this would break for an that is bytecode compiled and > does not come with source. > > On Jun 18, 8:40 pm, "mr.freeze" wrote: > > > Here's a

[web2py:24467] Re: Strange behavior db( ... and ... and ...) vs. db( ... or ... or ...)

2009-06-18 Thread mdipierro
No it is not a dumb question. It is a unfortunate issue that and and or cannot be overloaded. On Jun 18, 10:05 pm, weheh wrote: > Achh! Dumb question. I think I need to get more sleep. --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

[web2py:24466] Re: community snippets site

2009-06-18 Thread mdipierro
It would be valuable. Massimo On Jun 18, 8:52 pm, "mr.freeze" wrote: > I am thinking about creating a community driven snippets site for > web2py users.  Is there something like this already besides Alter Ego? > I'm not looking to compete with anyone's efforts, just looking to fill > a need if

[web2py:24465] Re: auto-menu for development

2009-06-18 Thread mdipierro
The problem is this would break for an that is bytecode compiled and does not come with source. On Jun 18, 8:40 pm, "mr.freeze" wrote: > Here's a variation that creates menus for all controllers and their > functions (except appadmin): > > import os > from gluon.myregex import regex_expose > ctl

[web2py:24464] Re: How to output a ''?

2009-06-18 Thread mdipierro
you can. Some the gluon/sanitizer.py # from http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496942 # Title: Cross-site scripting (XSS) defense # Submitter: Josh Goldfoot (other recipes) # Last Updated: 2006/08/05 # Version no: 1.0 I would also email the author or I can do that. Massimo

[web2py:24463] Re: how to get validator details for a field?

2009-06-18 Thread mdipierro
not necessarily, it can be a list of one element. On Jun 18, 6:11 pm, Peter Etchells wrote: > thanks, that worked perfectly. > > Q2: is it correct that if there is only one validator for the field, > field.requires is not a list, but if >1 validator, it is? > > On Jun 19, 3:46 am, mdipierro wro

[web2py:24462] Re: Possible to render view template from db blob/text/string instead of file?

2009-06-18 Thread mdipierro
not easy to do now, but easy to add. I will add this to trunk tomorrow. Massimo On Jun 18, 4:30 pm, Ted G wrote: > I have an application in which I need to have the view rendered by a > controller be specified using a parameter to that controller. > > I believe I could do the following based on

[web2py:24461] Re: Sessions and flash

2009-06-18 Thread mdipierro
you can try using basic authentication. On Jun 18, 2:36 pm, Robert Marklund wrote: > Hi, > I have a flash uploader that don't send the session cookie to the upload > function. > And there for cant do auth. > > Is there any way i solve this ? > Perhaps with post or get data to send the session id

[web2py:24460] Re: select something as other from this

2009-06-18 Thread mdipierro
yes and no. You can do: morehits = db.mytable.myhits.sum() rows=db().select(db.mytable.mydate,morehits,groupby=db.mytable.mydate) for row in rows: print row.mytable.mydate, row._extra[morehits] but the morehits does not appear in the actual generated SQL because there is no need to. On Jun

[web2py:24459] Re: reserved database words

2009-06-18 Thread samwyse
There are two possibilities. First, use names that contain an underscore. AFAIK, there aren't any reserved words that have them. Second, SQL has some special quoting rules; character constants are supposed to be enclosed in single quotes, names may be enclosed in double quotes. In the latter ca

[web2py:24458] Re: Strange behavior db( ... and ... and ...) vs. db( ... or ... or ...)

2009-06-18 Thread weheh
Achh! Dumb question. I think I need to get more sleep. --~--~-~--~~~---~--~~ 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 thi

[web2py:24457] community snippets site

2009-06-18 Thread mr.freeze
I am thinking about creating a community driven snippets site for web2py users. Is there something like this already besides Alter Ego? I'm not looking to compete with anyone's efforts, just looking to fill a need if it exists and learn along the way. --~--~-~--~~~

[web2py:24456] Re: auto-menu for development

2009-06-18 Thread mr.freeze
Here's a variation that creates menus for all controllers and their functions (except appadmin): import os from gluon.myregex import regex_expose ctldir = os.path.join(request.folder,"controllers") ctls=os.listdir(ctldir) if 'appadmin.py' in ctls: ctls.remove('appadmin.py') response.menu = [] for

[web2py:24455] Re: reserved database words

2009-06-18 Thread Richard
I came across a reserved word list for mysql: http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html But it's not complete - the table name 'log' causes an error, but is not in the list. On Jun 19, 11:03 am, Richard wrote: > hi, > > I like to develop my web2py apps with sqlite and then migr

[web2py:24454] reserved database words

2009-06-18 Thread Richard
hi, I like to develop my web2py apps with sqlite and then migrate to mysql or postgres later. I often then find that some of the table or field names are reserved in the new database, which requires lots of renames. Does anyone have a strategy for dealing with this? Does there perhaps exist a li

[web2py:24453] Re: web2py.com down?

2009-06-18 Thread Yarko Tymciurak
look at http://en.wikipedia.org/wiki/Traceroute for lists of tools; if going to the ip address directly doesn't work for you (nslookup www.web2py.com), you can try to filter just http messages with wireshark to see what messages are going back / forth. I'm not having trouble - but I'm in the Chica

[web2py:24452] Re: How to output a ''?

2009-06-18 Thread Eddie Eyles
If this is of use to anyone, I've ended up with the following solution: {{ for line in (row.basic.comments or ' ').splitlines(): =P(line,_class='tablepara') pass }} Having multiple paragraphs like this enables CSS (such as indenting) to be

[web2py:24451] Re: How to output a ''?

2009-06-18 Thread Eddie Eyles
What's the correct procedure here? Should I be entering a bug report into Launchpad? Eddie On Jun 16, 5:34 am, mdipierro wrote: > hmmm. yes this is a bug with sanitize. > > On Jun 15, 8:50 pm, Eddie Eyles wrote: > > > Thanks one and all for your suggestions - very useful. > > I'm not especial

[web2py:24450] Re: web2py on Android Scripting Environment (ASE)

2009-06-18 Thread Yarko Tymciurak
On Thu, Jun 18, 2009 at 6:48 PM, Yarko Tymciurak wrote: > a few comments about this: > > It's in "alpha"; it looks like this cross-compiles Python for android... as > it does Lua (Beanshell, of course, is Java so it remains...) the python > interpreter will have to be setup in Java, and scripts

[web2py:24449] Re: web2py on Android Scripting Environment (ASE)

2009-06-18 Thread Yarko Tymciurak
a few comments about this: It's in "alpha"; it looks like this cross-compiles Python for android... as it does Lua (Beanshell, of course, is Java so it remains...) the python interpreter will have to be setup in Java, and scripts passed to it thru Java/Dalvik (as that's the user-level application

[web2py:24448] Re: web2py.com down?

2009-06-18 Thread Eddie Eyles
I'm getting a gateway timeout again, trying to open web2py.com. This after several days of no problems at all. Surprisingly, traceroute shows all nodes responding, all the way through to the web2py.com host. Does anyone know how to diagnose this kind of problem? Eddie On Jun 14, 10:04 pm, mdi

[web2py:24447] Re: how to get validator details for a field?

2009-06-18 Thread Peter Etchells
thanks, that worked perfectly. Q2: is it correct that if there is only one validator for the field, field.requires is not a list, but if >1 validator, it is? On Jun 19, 3:46 am, mdipierro wrote: > should be > > myfield=db['mytable'][field] >   if field.type=='integer': >     if isinstance(field

[web2py:24446] web2py on Android Scripting Environment (ASE)

2009-06-18 Thread Hasanat Kazmi
Google has officially released Android Scripting Environment (ASE) for Android phones. ASE supports Python. Has anyone tried to run web2py on ASE? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework"

[web2py:24445] Possible to render view template from db blob/text/string instead of file?

2009-06-18 Thread Ted G
I have an application in which I need to have the view rendered by a controller be specified using a parameter to that controller. I believe I could do the following based on what I've dug up in this forum: def index(): try: response.view='default/' + request.args[0] # eg. 'indexview2.ht

[web2py:24444] Sessions and flash

2009-06-18 Thread Robert Marklund
Hi, I have a flash uploader that don't send the session cookie to the upload function. And there for cant do auth. Is there any way i solve this ? Perhaps with post or get data to send the session id ? /R -- __ Robert Marklund Phone: +46 (0)46 19 36

[web2py:24443] select something as other from this

2009-06-18 Thread sebastian
Hi, is it possible to run this select using DAL ? select date,sum(hits) as morehits from report group by date (see the "as") thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To

[web2py:24442] Re: Ticket issued: welcome/127.0.0.1.2009-06-18....

2009-06-18 Thread Yarko Tymciurak
What is the content of the ticket? You should be able to see the ticket from (for example) http://localhost:8000/admin/default/design/welcome by clicking (upper right) the "ERRORS" tab, which should get you to http://localhost:8000/admin/default/errors/welcome Alternatively, you can look at the

[web2py:24441] Ticket issued: welcome/127.0.0.1.2009-06-18....

2009-06-18 Thread levi
I use ubuntu. When i go to http://127.0.0.1:8000/welcome/default/index i see this error: Ticket issued: welcome/127.0.0.1.2009-06-18.19-49-52.348dfb16- e853-452e-824c-83ba70f9be2c I reinstalled python2.5 but nothing changed. When i go to admin page there is no error. I can edit files, but i can n

[web2py:24440] Re: Access Javacript variable's value in Web2py Code From view

2009-06-18 Thread JohnMc
Little trick if you need to reference the same value later -- Using unique id's, jQuery makes it very easy to manipulate/reference the contents. Not exactly XHTML compliant however. On Jun 18, 11:00 am, Alexey Nezhdanov wrote: > On Thursday 18 June 2009 19:38:43 Yannick wrote: > > > Hello Mat

[web2py:24439] Re: Access Javacript variable's value in Web2py Code From view

2009-06-18 Thread Alexey Nezhdanov
On Thursday 18 June 2009 19:38:43 Yannick wrote: > Hello Mate, > I have a little problem here and not sure if it is even possible to do > so... > I was wondering if you know how to access javascript value in the > web2py python code from the view > > Here I'm trying to add a parameter to my UR

[web2py:24438] Re: Access Javacript variable's value in Web2py Code From view

2009-06-18 Thread mdipierro
I assume param is javascript variable, not a Python variable: ## var param = 'value' "{{URL(r=request,c='static',f='action')}}/"+param . ## On Jun 18, 10:38 am, Yannick wrote: > Hello Mate, > I have a little problem here and not sure if it is

[web2py:24437] Re: web2py 1.64.2 is OUT

2009-06-18 Thread mdipierro
OK. IS_STRONG it is. Uploading to trunk. On Jun 18, 9:25 am, samwyse wrote: > It returns a bool, right?  So I strongly vote for the 'IS_' prefix, > whatever else is decided.  As for the rest, I initially preferred > IS_STRONGPWD, because even when I saw the argument list I still didn't > know wh

[web2py:24436] Re: how to get validator details for a field?

2009-06-18 Thread mdipierro
should be myfield=db['mytable'][field] if field.type=='integer': if isinstance(field.requires[0],validator.IS_INT_IN_RANGE): minimum = field.requires[0].minimum maximum = field.requires[0].maximum On Jun 18, 2:16 am, Peter Etchells wrote: > Hi web2pyzeans > I want to be ab

[web2py:24435] Re: Strange behavior db( ... and ... and ...) vs. db( ... or ... or ...)

2009-06-18 Thread mdipierro
follow up query1 or query2 IS INVALID SYNTAX query1|query2 IS CORRECT "or" cannot be overwritten in Python so it is still valid but it does not do what you want. query1 or query2 ALWAYS returns just query1. Massimo On Jun 18, 10:43 am, mdipierro wrote: > query1 and query2 IS INVALID SYNTAX >

[web2py:24434] Re: Strange behavior db( ... and ... and ...) vs. db( ... or ... or ...)

2009-06-18 Thread mdipierro
query1 and query2 IS INVALID SYNTAX query1&query2 IS CORRECT "and" cannot be overwritten in Python so it is still valid but it does not do what you want. query1 and query2 ALWAYS returns just query2. Massimo On Jun 18, 8:58 am, weheh wrote: > I'm using web2py 1.64.1. I'm seeing a strange behav

[web2py:24433] Access Javacript variable's value in Web2py Code From view

2009-06-18 Thread Yannick
Hello Mate, I have a little problem here and not sure if it is even possible to do so... I was wondering if you know how to access javascript value in the web2py python code from the view Here I'm trying to add a parameter to my URL and the value of that param is a Javascript variable ##

[web2py:24432] Re: ldap authentication

2009-06-18 Thread Fran
On Jun 18, 2:11 pm, Johann Spies wrote: > > With patched version, like this (also sent by email to you & Massimo): > > auth.settings.login_methods=[ldap_auth(server='stbldap01.sun.ac.za', > > base_dn='ou=users,O=SU', mode='cn', secure=True] > Where should the brackets be closed?  I get >     auth

[web2py:24431] Re: web2py 1.64.2 is OUT

2009-06-18 Thread samwyse
It returns a bool, right? So I strongly vote for the 'IS_' prefix, whatever else is decided. As for the rest, I initially preferred IS_STRONGPWD, because even when I saw the argument list I still didn't know what it's purpose would be. But someone else in this thread said it could be usable for

[web2py:24430] Re: how to get validator details for a field?

2009-06-18 Thread mr.freeze
Maybe this?: import gluon.validators if isinstance(db.mytable.myfield.requires [0],gluon.validators.IS_INT_IN_RANGE): db.mytable.myfield.requires[0] = IS_INT_IN_RANGE(min=10, max=20) On Jun 18, 2:16 am, Peter Etchells wrote: > Hi web2pyzeans > I want to be able to access the type and para

[web2py:24429] Strange behavior db( ... and ... and ...) vs. db( ... or ... or ...)

2009-06-18 Thread weheh
I'm using web2py 1.64.1. I'm seeing a strange behavior in my query. I'm trying to isolate a record using a compound "and" clause ... very simple stuff: records = db( (db.x.a == i) and (db.x.b==0) and (db.x.c==None) and ...).select(db.x.ALL) But, it returns a whole bunch of records that have

[web2py:24428] Re: web2py 1.64.2 is OUT

2009-06-18 Thread Michal Jursa
Markus Gritsch wrote: > On Thu, Jun 18, 2009 at 1:04 AM, mr.freeze wrote: New IS_COMPLEX validator, thanks Mr. Freeze > > Well, IS_COMPLEX is not a good name since Python has a complex > datatype: e.g. 3+5j and one could assume it is tested for this. > > Markus I did so, until explained. R

[web2py:24427] Re: web2py 1.64.2 is OUT

2009-06-18 Thread DenesL
First of all, thanks for sharing the validator, it might come in handy in the future. I must agree on the name change and that now is the right time to do it. IS_STRONG() feels like a good choice since it will be checking password strength, which is a function of length, complexity and randomness

[web2py:24426] Re: web2py 1.64.2 is OUT

2009-06-18 Thread mr.freeze
Not necessarily for passwords but yes in most cases. I don't care what it is called, I just needed the functionality. How about IS_STRONG () ? On Jun 18, 8:06 am, AchipA wrote: > Why not just (IS_)STRONGPWD (or pwdstrength) ? That's what it is, > isn't it ? > > On Jun 18, 2:49 pm, "mr.freeze"

[web2py:24425] Re: ldap authentication

2009-06-18 Thread Johann Spies
2009/6/18 Fran > > On Jun 18, 11:24 am, Johann Spies wrote: > > How do I implement that in web2py? > > Current version: not possible. > > With patched version, like this (also sent by email to you & Massimo): > auth.settings.login_methods=[ldap_auth(server='stbldap01.sun.ac.za', > base_dn='ou=us

[web2py:24424] Re: how to get validator details for a field?

2009-06-18 Thread DenesL
Given db.table.field.requires=IS_INT_IN_RANGE(min,max) then db.table.field.requires.minimum is the min and db.table.field.requires.maximum is the max. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Fram

[web2py:24423] Re: web2py 1.64.2 is OUT

2009-06-18 Thread AchipA
Why not just (IS_)STRONGPWD (or pwdstrength) ? That's what it is, isn't it ? On Jun 18, 2:49 pm, "mr.freeze" wrote: > Sorry guys, didn't even think about the python complex number object. > > Perhaps just COMPLEXITY? So you could say: > db.mytable.passwd.requires=[COMPLEXITY(),CRYPT()] > > I too

[web2py:24422] Re: web2py 1.64.2 is OUT

2009-06-18 Thread mr.freeze
Sorry guys, didn't even think about the python complex number object. Perhaps just COMPLEXITY? So you could say: db.mytable.passwd.requires=[COMPLEXITY(),CRYPT()] I too doubt that anyone has put this into use except me. On Jun 18, 3:17 am, Iceberg wrote: > Interesting. > > I fully understand a

[web2py:24421] Re: 3D visualizations in the browser with web2py

2009-06-18 Thread Kuba Kucharski
I don't know why I thought I've seen smth in one of the screencast that suggest me "pro".. must have been my imagination anyway, time for an upgrade! ;) -- Kuba --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web

[web2py:24420] Re: ldap authentication

2009-06-18 Thread Fran
On Jun 18, 11:47 am, Fran wrote: > +            if secure: > +                con = ldap.initialize("ldap://"; + ldap_server + ":" + > str(ldap_port)) > +            else: > +                con = ldap.initialize("ldaps://" + ldap_server + ":" These are the wrong way around, of course ;) Updated

[web2py:24419] Re: ldap authentication

2009-06-18 Thread Fran
On Jun 18, 11:24 am, Johann Spies wrote: > How do I implement that in web2py? Current version: not possible. With patched version, like this (also sent by email to you & Massimo): auth.settings.login_methods=[ldap_auth(server='stbldap01.sun.ac.za', base_dn='ou=users,O=SU', mode='cn', secure=Tru

[web2py:24418] Re: ldap authentication

2009-06-18 Thread Johann Spies
Fran wrote: >> If you provide the working command line bind using one of the ldap >> command line tools, then I can try & develop something that works for >> you. >> > > Thanks for the offer. I will experiment and let you know. > $ ldapwhoami -H ldaps://stbldap01.sun.ac.za -D 'cn=jspies,ou=us

[web2py:24417] Re: universal data representation/encoding

2009-06-18 Thread Francisco Gama
you are right. It's just more "rapid" to write the things we want in a language that we want, and then just translate. I will do that way On Jun 18, 10:31 am, AchipA wrote: > I think we're forgetting an important lesson from gettext here... > > What you include in T() is NOT the message. It's

[web2py:24416] Re: universal data representation/encoding

2009-06-18 Thread AchipA
I think we're forgetting an important lesson from gettext here... What you include in T() is NOT the message. It's an ASCII key. Of course, most people make the key identical to the English message string for convenience as it's the fallback, too. On Jun 17, 1:38 pm, Francisco Gama wrote: > Tha

[web2py:24415] Re: web2py 1.64.2 is OUT

2009-06-18 Thread AchipA
Wasn't there a policy that new functionality is only included in major releases and not point releases ? If that's still in place it would be perfectly OK to rename it for 1.65 as you shouldn't rely on 1.64.*2* to have this anyway. On Jun 18, 7:37 am, mdipierro wrote: > Good point but now it mad

[web2py:24414] Re: http_origin equivalent outside of forms

2009-06-18 Thread Carl
thanks. for the record; locally on a Win XP box and deployed to GAE the following works: 'http://%s%s' % (request.env.http_host, URL(r=request,c='c', f='f')) [odd behaviour from Google Groups - I couldn't find this thread in search results and had to retrieve from browser history] On Jun 17, 6

[web2py:24413] Re: web2py 1.64.2 is OUT

2009-06-18 Thread Álvaro Justen [Turicas]
On Thu, Jun 18, 2009 at 5:17 AM, Iceberg wrote: > Interesting. > > I fully understand and like the backward-compatible policy of web2py. > But in this case, in this moment, I assume there aren't many people > download 1.64.2 yet, and only Mr. Freeze is using the IS_COMPLEX. So, > it is not too lat

[web2py:24412] Re: web2py 1.64.2 is OUT

2009-06-18 Thread Iceberg
Interesting. I fully understand and like the backward-compatible policy of web2py. But in this case, in this moment, I assume there aren't many people download 1.64.2 yet, and only Mr. Freeze is using the IS_COMPLEX. So, it is not too late now to change it to a more proper name. Otherwise, I thin

[web2py:24411] how to get validator details for a field?

2009-06-18 Thread Peter Etchells
Hi web2pyzeans I want to be able to access the type and parameters of validators for a given field. How would I do something like: myfield=db['mytable'][field] if field.type=='integer': if field.requires[0] == validator.IS_INT_IN_RANGE: min = the min arg of the IS_INT_IN_RANGE validator for

[web2py:24410] Re: Time

2009-06-18 Thread cjparsons
> What if server > is in East Kazakhstan and the user is in Hackensack, New Jersey? What > time zone is request.now?) If the server and user are in different time zones I don't believe there's an easy solution, especially when you consider daylight saving time (i.e. just converting everything to