[web2py:18410] New record too long

2009-03-21 Thread Alexei Vinidiktov
Hello, I'm just beginning to learn web2py. I've bought the web2py manual and am reading Chapter 1. I've defined a model through the admin interface: db = SQLDB('sqlite://storage.db') db.define_table('contacts', SQLField('name', 'string', length=20), SQLField('phone', 'string', length=12

[web2py:18411] Re: New record too long

2009-03-21 Thread Yarko Tymciurak
Hi Alexei - web2py uses UTF8 internally; this means Cyrillica will encode in 2-bytes per character (have a look at http://en.wikipedia.org/wiki/UTF-8#Rationale_behind_UTF-8.27s_design, or http://ru.wikipedia.org/wiki/UTF-8#Ratio

[web2py:18413] Re: Google Authentication + web2py on GAE

2009-03-21 Thread murray3
Looking at all the GAE Users documentation - it seems quite straight forward to authenticate a user using GAE User class. Using the code: from google.appengine.api import users user = users.get_current_user() if user: #user.email() else: #redirect to login: users.create_login_url() If anyone has

[web2py:18414] Re: New record too long

2009-03-21 Thread Yarko Tymciurak
Hi Alexei - Since UTF8 is variable length, and data is cheap, you can be generous. when a field is too short, you invariably have at least an unhappy customer by some measure. You saw your test name was not 22 bytes, but 21 ... so 2x is mildly conservative. You should be ok w/ something like: c

[web2py:18412] Re: New record too long

2009-03-21 Thread Alexei Vinidiktov
Hi Yarko, Thanks for your help. I've tried setting the name field length to 32, and it worked fine with a name such as Олег Зимний. It was to be expected though. The question is, in what units should the field length be measured - bytes or characters? I think it should be measured in characte

[web2py:18415] Re: New record too long

2009-03-21 Thread AchipA
Characters vs byte is possible (see unicode objects in python), but characters are problematic in databases (think record sizes, index structures, collation, etc). That's why most databases either 'cheat' by using byte counts in some places or suffer from a feature/ performance point. Also, there

[web2py:18416] Re: New record too long

2009-03-21 Thread Alexei Vinidiktov
The thing is the project that I'm intending to use web2py for is a web application for language learners, and I need to be sure that as many languages as possible are correctly treated by the application. So, I don't think it would be safe to use a Russian character for calculating the length of

[web2py:18417] GSOC Students for SAHANA

2009-03-21 Thread Alfonso de la Guarda
Hello, Currentlly i have applied as mentor for SAHANA (disaster app), which requires python and -also- web2py coders, if you wish to help the project and -also- take some money, well: http://wiki.sahana.lk/doku.php?do=show&id=dev:sahana_gsoc09_ideas Saludos, Alf

[web2py:18418] Re: New record too long

2009-03-21 Thread Alexei Vinidiktov
Unfortunately, due to the nature of the web application I'm planning on using web2py for, I can't use a single-byte encoding for the database or most tables. The tables are going to store strings in many different languages of the world. I was hoping that web2py could transparently communicate w

[web2py:18419] boolean display

2009-03-21 Thread Marco Prosperi
hello, how can I display a boolean field as a checkbox in a SQLTABLE? thanks, Marco --~--~-~--~~~---~--~~ 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@googlegrou

[web2py:18420] Re: New record too long

2009-03-21 Thread AchipA
>I was hoping that web2py could transparently communicate with >databases that are UTF8 encoded and that I would be able to do >operations on strings retrieved from databases without thinking about >their encodings. That is the goal. It will never be 100% as it is somewhat dabase/ version dependa

[web2py:18421] Re: New record too long

2009-03-21 Thread AchipA
Oops, wrong copypaste, here is the correct one: In [1]: validator = IS_LENGTH(1) In [2]: validator('a') Out[2]: ('a', None) In [3]: validator('aa') Out[3]: ('aa', 'too long!') In [4]: validator('á') Out[4]: ('\xc3\xa1', 'too long!') In [5]: validator('á'.decode('utf-8')) Out[5]: (u'\xe1', Non

[web2py:18422] Re: (possibly weird) Questions for web2py

2009-03-21 Thread Alex Popescu
Firstly thanks for your answers. In order to clarify some of the remaining things: 1. Routes clarification HTTP 1.1 defines [1] 7 methods: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE (and reserves the CONNECT). The web2py routing is using to determine the function name in the controller a part

[web2py:18423] Changing the font in 1.59 Amy editor

2009-03-21 Thread __future__
Greetings, Is there some way to change font on font size? I looked at the bundle files in admin/static/eamy but I did not see any way to set this. Also does anyone maintain a textmate version of these bundles? Thanks. --~--~-~--~~~---~--~~ You received this me

[web2py:18424] Re: New record too long

2009-03-21 Thread Alexei Vinidiktov
AchipA, thanks for taking the time to investigate the issue! 2009/3/21 AchipA : > > Oops, wrong copypaste, here is the correct one: > > In [1]: validator = IS_LENGTH(1) > > In [2]: validator('a') > Out[2]: ('a', None) > > In [3]: validator('aa') > Out[3]: ('aa', 'too long!') > > In [4]: validator

[web2py:18425] Authentication related question

2009-03-21 Thread Anand Vaidya
Hi I am a bit lost with the Authentication / Authorization in web2py. I am using v1.58 What I need: My current needs are quite minimal. Given a username and password (in a form), verify the user:pass and let the user in. Block all functions if anonymous or failed auth. I do not want to use any

[web2py:18426] Re: Changing the font in 1.59 Amy editor

2009-03-21 Thread Fran
On Mar 21, 3:00 pm, __future__ wrote: > Is there some way to change font on font size?  I looked at the bundle > files in admin/static/eamy but I did not see any way to set this. applications\admin\models\0.py --~--~-~--~~~---~--~~ You received this message becaus

[web2py:18427] Re: Changing the font in 1.59 Amy editor

2009-03-21 Thread __future__
This doesn't appear to have any effect with the Amy editor... only works for edit_area. Running Max OS 10.5.6, FF 3.0.7, web2py 1.59 On Mar 21, 11:09 am, Fran wrote: > On Mar 21, 3:00 pm, __future__ wrote: > > > Is there some way to change font on font size?  I looked at the bundle > > files

[web2py:18428] Re: (possibly weird) Questions for web2py

2009-03-21 Thread Yarko Tymciurak
On Sat, Mar 21, 2009 at 9:51 AM, Alex Popescu < the.mindstorm.mailingl...@gmail.com> wrote: > > Firstly thanks for your answers. In order to clarify some of the > remaining things: > > 1. Routes clarification > > HTTP 1.1 defines [1] 7 methods: OPTIONS, GET, HEAD, POST, PUT, DELETE, > TRACE (and r

[web2py:18429] Re: New record too long

2009-03-21 Thread Yarko Tymciurak
2009/3/21 Alexei Vinidiktov > > The thing is the project that I'm intending to use web2py for is a web > application for language learners, and I need to be sure that as many > languages as possible are correctly treated by the application. > > So, I don't think it would be safe to use a Russian

[web2py:18430] Re: New record too long

2009-03-21 Thread Yarko Tymciurak
2009/3/21 Alexei Vinidiktov > > Unfortunately, due to the nature of the web application I'm planning > on using web2py for, I can't use a single-byte encoding for the > database or most tables. > > The tables are going to store strings in many different languages of the > world. > > I was hoping

[web2py:18431] Re: New record too long

2009-03-21 Thread Yarko Tymciurak
2009/3/21 AchipA > > >I was hoping that web2py could transparently communicate with > >databases that are UTF8 encoded and that I would be able to do > >operations on strings retrieved from databases without thinking about > >their encodings. > > That is the goal. It will never be 100% as it is s

[web2py:18432] Re: New record too long

2009-03-21 Thread Yarko Tymciurak
2009/3/21 Alexei Vinidiktov > > AchipA, thanks for taking the time to investigate the issue! > > 2009/3/21 AchipA : > > > > Oops, wrong copypaste, here is the correct one: > > > > In [1]: validator = IS_LENGTH(1) > > > > In [2]: validator('a') > > Out[2]: ('a', None) > > > > In [3]: validator('aa

[web2py:18433] Re: boolean display

2009-03-21 Thread mdipierro
Try something like this: db.mytable.myfield.represent=lambda value: '[x]' if value else '[ ]' Massimo On Mar 21, 9:28 am, Marco Prosperi wrote: > hello, how can I display a boolean field as a checkbox in a SQLTABLE? > > thanks, Marco --~--~-~--~~~---~--~~ You re

[web2py:18434] Re: Authentication related question

2009-03-21 Thread mdipierro
1. is correct. You can create your own tables but I would let web2py do it for you. Here is the minimal *complete* code you need #in model db.py from gluon.tools import * auth=Auth(globals(),db) auth.define_tables() #in default.py def user(): return auth() The latter action will expose http://.

[web2py:18435] Re: Changing the font in 1.59 Amy editor

2009-03-21 Thread mdipierro
Correct. we have not figured out yet how to change fonts in Amy. On Mar 21, 11:35 am, __future__ wrote: > This doesn't appear to have any effect with the Amy editor... only > works for edit_area. > > Running Max OS 10.5.6, FF 3.0.7, web2py 1.59 > > On Mar 21, 11:09 am, Fran wrote: > > > On Mar

[web2py:18436] Re: (possibly weird) Questions for web2py

2009-03-21 Thread mdipierro
http:///a/b/c/... request.application is a request.controller is b request.function is c request.args are split('/') On Mar 21, 1:37 pm, Yarko Tymciurak wrote: > On Sat, Mar 21, 2009 at 9:51 AM, Alex Popescu < > > > > the.mindstorm.mailingl...@gmail.com> wrote: > > > Firstly thanks for

[web2py:18437] Re: (possibly weird) Questions for web2py

2009-03-21 Thread Alex Popescu
Yarko, Massimo, I do understand how web2py routing works. But I do NOT like it as it is action based while I am looking for clean REST. As I've pointed out in my first email the URL parsing and 'routing' happens in 'gluon.main.wsgibase' (at least for a mod_wsgi deployment) and I am pretty sure I

[web2py:18438] Re: Authentication related question

2009-03-21 Thread Jeffield
Hi Anand, I found this to be quite helpful for getting a handle on the authentication authorization scheme in web2py. "web2py 1.59 tutorial + auth + layouts + gae + shell" http://www.vimeo.com/3703345 Thanks Jeff On Mar 21, 9:42 am, Anand Vaidya wrote: > Hi > > I am a bit lost with the Authen

[web2py:18439] Re: boolean display

2009-03-21 Thread Jeffield
ahh that is cool How can I display a string field as a selectbox in a SQLTABLE? i.e: http://www.w3schools.com/html/tryit.asp?filename=tryhtml_select2 Thanks, Jeff On Mar 21, 1:34 pm, mdipierro wrote: > Try something like this: > > db.mytable.myfield.represent=lambda value: '[x]' if value

[web2py:18440] How to hide the console window?

2009-03-21 Thread Iceberg
Hi pals, I am using web2py 's windows distribution. Is there some way to hide the console window (a.k.a. the black dos window) in which web2py is running? I already know about: web2py.exe -a blah -t can start web2py in the systray of Microsoft Windows system, but the console itself is still th

[web2py:18441] Re: How to hide the console window?

2009-03-21 Thread Boris Manojlovic
Hi Iceberg, please try hstart program as it is created just for "problems" like yours. http://www.ntwind.com/software/utilities/hstart.html hope it helps :) On Sun, Mar 22, 2009 at 4:44 AM, Iceberg wrote: > > Hi pals, > > I am using web2py 's windows distribution. Is there some way to hide > t

[web2py:18442] Re: Authentication related question

2009-03-21 Thread Anand Vaidya
Thanks for the detailed response. For the time being, I decided to bypass the whole Auth issue . I am using web2py behind apache2 and using apache htpasswd for validating the users accts. AuthType Basic AuthName "RADIUS Admin" AuthUserFil