Re: [web2py] Re: list:reference and orderby

2010-11-17 Thread Johann Spies
On 17 November 2010 16:48, mdipierro  wrote:

> IS_IN_DB(...,orderby=...)
>
>
Thanks.  Now I get

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.

Traceback (most recent call last):
  File "/home/js/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
  File "/home/js/web2py/applications/init/models/kb5.py"
, line
189, in 
orderby = 'instansie.naam' )),
  File "/home/js/web2py/gluon/validators.py", line 368, in __init__
(ktable, kfield) = str(self.field).split('.')
ValueError: need more than 1 value to unpack

 Error snapshot [image: help] Detailed traceback description

(need more than 1 value to unpack)


The model:




db.define_table('instansie_nuwename',
Field('nuutste', db.instansie,
  requires = IS_IN_DB(db, 'instansie.id','%(naam)s',
orderby = 'instansie.naam' )),
Field('vorige', 'list:reference instansie',
  requires = IS_IN_DB('instansie.id','%(naam)s',multiple
= True,
  orderby = 'instansie.naam' )),
Field('jaar', label = 'Tot watter jaar?'),
signature)
db.instansie_nuwename.nuutste.represent = lambda id: db.instansie(id).naam


Regards

Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] Please help: Are these errors?

2010-11-17 Thread Seeker
Hi guys,
Please help:

Could someone please confirm whether the following two issues are
indeed errors or if I am simply doing something wrong.  They have both
been around for a while now and I am surprised that they have not been
noticed yet - which makes me think I may be causing the problem.

Background:
===
Using Windows 7 operating system
Python 2.6
The errors appear in both the trunk and Windows binary editions

Steps for Error 1:

- Use the application wizard.
- Create an application with the following database specification.
Notice that the 'dog' table is related to the 'person' table, BUT the
tables are specified in the incorrect sequence:

table: dog
field definition in wizard: name
field definition in wizard: owner person

table person
field definition in wizard: name
field definition in wizard: age integer

- Using the generated application; choose 'dog select' from the menu.
- An error is generated:
  File "E:\Dev\w2p\web2py_hg\gluon\sql.py", line 1537, in
__allocate
  raise RuntimeError, "Using a recursive select but encountered a
broken reference"
  RuntimeError: Using a recursive select but encountered a broken
reference


Error 2:

- Use the appadmin for any application (eg: 
http://127.0.0.1:8000/myapp3/appadmin/index)
- Click the link to list the content of any table which already
contains a few records. (eg: http://127.0.0.1:8000/myapp3/appadmin/select/...)
- Click the 'view' link next to any of the records (eg:
http://127.0.0.1:8000/myapp3/appadmin/mytable_read/1)
- An error results: 'invalid function'

Thanks for helping.



[web2py] Precise behaviour of "compute" on record update

2010-11-17 Thread cjrh
Regarding the "compute" attribute of a Field object, the book says
this:

"compute is an optional function. If a record is inserted and there is
no value for a field that has a compute attribute, the value is
calculated by passing the record (as a dict) to the compute function."

My current testing, on 1.89.3, shows that compute will run not only
when a record is inserted, but indeed every time any other field in
that same record is updated.   I have a field that is a uuid which is
only supposed to be calculated once, on insertion. Also, the
compute function is passed the current record field values as a dict,
but that excludes any value the Field with compute() might currently
have.

In my opinion, the text in the book is misleading.  Thoughts?


[web2py] Customize the Appearance of the menu

2010-11-17 Thread Joe J
Hi all, I'm looking to customize the appearance if the menu on a per
controller basis.  I found some code in the "old" book that seems to
do this.
However, when I try to run the below code, I get a "two many values to
unpack error".  Does anyone know who I might go about doing this?

Any help is much appreciated.
Thanks,
Joe

In the controller, I have code as follows:
response.menu=[['civilized',True,URL('default','index')],
   ['test',False,URL('default','index')]]


In my View, I'm coding the following:
   {{if not response.menu:}}
Browse
Signup
   {{else:}}
 {{for _name,_active,_link in response.menu:}}
   {{=_name}}
 {{pass}}
   {{pass}}




Traceback (most recent call last):
  File "/Users/jjasinsk/Sites/web2py/web2py/gluon/restricted.py", line
188, in restricted
exec ccode in environment
  File "/Users/jjasinsk/Sites/web2py/web2py/applications/evesch/views/
default/index.html", line 38, in 
ValueError: too many values to unpack


[web2py] Re: New style 1.89.X forms seem washed out?

2010-11-17 Thread ron_m
I did a fresh download, unpacked, ran the welcome application and hit
the register button and the form looks the same as my application. I
don't see a way to attach a screen snapshot in the web interface, I
guess I need to use the email interface to do that.

Ron

On Nov 17, 10:12 pm, Phyo Arkar  wrote:
> You seem to got CSS messed up.
>
> On 11/18/10, ron_m  wrote:
>
> > I don't want to sound unappreciative of the new look for the
> > application, it is a lot of good work and a definite improvement over
> > all. Maybe I messed something up, I don't think so, but here is what I
> > find unusual now.
>
> > All form controls seem washed out, there are almost no visible borders
> > on text areas, check boxes are barely visible on the background unless
> > checked, push buttons are barely visible other than the text on the
> > button. The control with focus used to have a light green background
> > but now there is no change in color. In the previous version the
> > default form input controls had some color.
>
> > The text input fields are not very tall, in fact select boxes don't
> > even show the full height of the font. I fixed that by changing the
> > input text, input password and select height from 16px to 20px in
> > base.css
>
> > I can fix this myself but I am wondering if anyone else is also seeing
> > this.
>
> > I am running Ubuntu 10.04.1 with Firefox 3.6.12. I have also played
> > around with the LCD panel brightness and contrast but not much
> > difference is apparent in the look.
>
> > Thanks
> > Ron
>
>


Re: [web2py] experts4solutions.com again

2010-11-17 Thread Branko Vukelic
On Thu, Nov 18, 2010 at 4:36 AM, rochacbruno  wrote:
> Is that a matter of style?

Um... more like a matter of styleSHEET. ;) I forgot to correct that.
As for aesthetics, I think it can rock both ways, but personally, I
think it should use correct capitalization. I'll do that tonite (in
about 12 hours from now).


-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


Re: [web2py] Re: postgresql error ... (relation "auth_user" already exists)

2010-11-17 Thread Johann Spies
On 16 November 2010 21:48, Carlos  wrote:

>
> Johann, please send the files when you get this error too.
>

It happened just now again.  I  have changed the type of a field from 'date'
to 'integer' (I want None or year) and the following typical error occured:

Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.

Traceback (most recent call last):
  File "/home/js/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
  File "/home/js/web2py/applications/kb/models/kb5.py"
, line 229,
in 
signature)
  File "/home/js/web2py/gluon/sql.py", line 1378, in define_table
t._create(migrate=migrate, fake_migrate=fake_migrate)
  File "/home/js/web2py/gluon/sql.py", line 1874, in _create
fake_migrate=fake_migrate)
  File "/home/js/web2py/gluon/sql.py", line 1947, in _migrate
self._db._execute(sub_query)
  File "/home/js/web2py/gluon/sql.py", line 1033, in 
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
ProgrammingError: column "datum__tmp" is of type integer but
expression is of type date
LINE 1: UPDATE outeur_instansie SET datum__tmp=datum;
   ^
HINT:  You will need to rewrite or cast the expression.

 Error snapshot [image: help] Detailed traceback description

(column "datum__tmp" is of type integer
but expression is of type date LINE 1: UPDATE outeur_instansie SET
datum__tmp=datum; ^ HINT: You will need to rewrite or cast the expression. )
Regards
Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] session not saving variables?

2010-11-17 Thread Crim
so my website was working yesterday and now for some reason the
session variables arnt saving at certain points

namely when i try this









{{var =  db.executesql("""SELECT TOP 1000 [ID]
  ,[Price]
  ,[Airport-From-Name]
  ,[Airport-From-State]
  ,[Airport-From-City]
  ,[Airport-To-Name]
  ,[Airport-To-State]
  ,[Airport-To-City]
  FROM [master].[dbo].[Flight]
  WHERE [Airport-From-City] = ? AND [Airport-From-State]= ? AND
[Airport-From-Name]= ?;""", (a[1], a[2], a[0]), True)
  }}

{{for row in var:}}
{{=row}}{{pass}}







after i send something to the server the page refreshes and the
session is cleared

i dont know why this is happening now and it wasnt a day ago

... it was all working fine xD

thanks a lot for any information ^ ^ ill be up at 7ish to respond but
i raly have to sleep :( i have been trying to fix this for a while
now


Re: [web2py] New style 1.89.X forms seem washed out?

2010-11-17 Thread Phyo Arkar
You seem to got CSS messed up.

On 11/18/10, ron_m  wrote:
> I don't want to sound unappreciative of the new look for the
> application, it is a lot of good work and a definite improvement over
> all. Maybe I messed something up, I don't think so, but here is what I
> find unusual now.
>
> All form controls seem washed out, there are almost no visible borders
> on text areas, check boxes are barely visible on the background unless
> checked, push buttons are barely visible other than the text on the
> button. The control with focus used to have a light green background
> but now there is no change in color. In the previous version the
> default form input controls had some color.
>
> The text input fields are not very tall, in fact select boxes don't
> even show the full height of the font. I fixed that by changing the
> input text, input password and select height from 16px to 20px in
> base.css
>
> I can fix this myself but I am wondering if anyone else is also seeing
> this.
>
> I am running Ubuntu 10.04.1 with Firefox 3.6.12. I have also played
> around with the LCD panel brightness and contrast but not much
> difference is apparent in the look.
>
> Thanks
> Ron


[web2py] How do we add projects or post a request for a new job on expert exchange?

2010-11-17 Thread Jason Brower
I want to start recommending people come to this site for Jobs and
Projects... is that happening yet?


[web2py] New style 1.89.X forms seem washed out?

2010-11-17 Thread ron_m
I don't want to sound unappreciative of the new look for the
application, it is a lot of good work and a definite improvement over
all. Maybe I messed something up, I don't think so, but here is what I
find unusual now.

All form controls seem washed out, there are almost no visible borders
on text areas, check boxes are barely visible on the background unless
checked, push buttons are barely visible other than the text on the
button. The control with focus used to have a light green background
but now there is no change in color. In the previous version the
default form input controls had some color.

The text input fields are not very tall, in fact select boxes don't
even show the full height of the font. I fixed that by changing the
input text, input password and select height from 16px to 20px in
base.css

I can fix this myself but I am wondering if anyone else is also seeing
this.

I am running Ubuntu 10.04.1 with Firefox 3.6.12. I have also played
around with the LCD panel brightness and contrast but not much
difference is apparent in the look.

Thanks
Ron


Re: [web2py] experts4solutions.com again

2010-11-17 Thread Nathan Freeze
Massimo, your bio is missing a pic. Is it okay to endorse you? :)

On Wed, Nov 17, 2010 at 9:23 PM, mdipierro  wrote:

> I have implemented an endorsement mechanism. Existing members can see
> and endorse new applicants. New applications should contact existing
> members by email and request an endorsement.
> 5 endorsements qualify for acceptance as an expert. Endorsements can
> be withdrawn. Endorsements are confidential. I can override this and I
> will for known web2py contributors.
>
> You apply by simply logging in into the system.
>
> I am happy to say that at least 3 members of the group have already
> been contacted with job offers.
>
> Please DO NOT ENDORSE users who did not post a decent picture or
> profile, even if you know they are good web2py programmers.
>
> If you have already been approved because you are a web2py contributor
> but you have posted no picture, a scary picture (yes you!), or no
> profile, please correct it.
>
> Everybody can register a new affiliated company, a new project and/or
> a new skill. But they I will have to approve them. I do not want to
> make the list of skills too long. Projects must be based on web2py,
> tested and deployed. Companies but say in the web site that they
> provide web2py support (although not exclusively).
>
> Massimo
>


Re: [web2py] experts4solutions.com again

2010-11-17 Thread rochacbruno
In the expert profile/bio the top title where expert name are shown is all 
lowecase. 

Is that a matter of style?

Enviado via iPhone

Em 18/11/2010, às 01:23, mdipierro  escreveu:

> I have implemented an endorsement mechanism. Existing members can see
> and endorse new applicants. New applications should contact existing
> members by email and request an endorsement.
> 5 endorsements qualify for acceptance as an expert. Endorsements can
> be withdrawn. Endorsements are confidential. I can override this and I
> will for known web2py contributors.
> 
> You apply by simply logging in into the system.
> 
> I am happy to say that at least 3 members of the group have already
> been contacted with job offers.
> 
> Please DO NOT ENDORSE users who did not post a decent picture or
> profile, even if you know they are good web2py programmers.
> 
> If you have already been approved because you are a web2py contributor
> but you have posted no picture, a scary picture (yes you!), or no
> profile, please correct it.
> 
> Everybody can register a new affiliated company, a new project and/or
> a new skill. But they I will have to approve them. I do not want to
> make the list of skills too long. Projects must be based on web2py,
> tested and deployed. Companies but say in the web site that they
> provide web2py support (although not exclusively).
> 
> Massimo


[web2py] experts4solutions.com again

2010-11-17 Thread mdipierro
I have implemented an endorsement mechanism. Existing members can see
and endorse new applicants. New applications should contact existing
members by email and request an endorsement.
5 endorsements qualify for acceptance as an expert. Endorsements can
be withdrawn. Endorsements are confidential. I can override this and I
will for known web2py contributors.

You apply by simply logging in into the system.

I am happy to say that at least 3 members of the group have already
been contacted with job offers.

Please DO NOT ENDORSE users who did not post a decent picture or
profile, even if you know they are good web2py programmers.

If you have already been approved because you are a web2py contributor
but you have posted no picture, a scary picture (yes you!), or no
profile, please correct it.

Everybody can register a new affiliated company, a new project and/or
a new skill. But they I will have to approve them. I do not want to
make the list of skills too long. Projects must be based on web2py,
tested and deployed. Companies but say in the web site that they
provide web2py support (although not exclusively).

Massimo


[web2py] Re: Recipe about mixing web2py, pydev, GoogleCode and others

2010-11-17 Thread mdipierro
Thanks. This issue comes up often. Very valuable.

On Nov 17, 8:17 pm, pierreth  wrote:
> Hello,
>
> I just published a blog about mixing all this stuff in Eclipse for
> web2py development:
>
> # GC issue tracking with Mylyn;
> # GC versioning using Mercurial and the MercurialEclipse plug-in;
> # Pydev with code completion and code checking;
> # Aptana Studio plug-in for Eclipse for the edition of HTML and CSS
> files.
>
> http://pierreth.blogspot.com/2010/10/web2py-eclipse-pydev-recipe.html
>
> I hope you like. Comments are appreciated.


[web2py] Recipe about mixing web2py, pydev, GoogleCode and others

2010-11-17 Thread pierreth
Hello,

I just published a blog about mixing all this stuff in Eclipse for
web2py development:

# GC issue tracking with Mylyn;
# GC versioning using Mercurial and the MercurialEclipse plug-in;
# Pydev with code completion and code checking;
# Aptana Studio plug-in for Eclipse for the edition of HTML and CSS
files.

http://pierreth.blogspot.com/2010/10/web2py-eclipse-pydev-recipe.html

I hope you like. Comments are appreciated.


[web2py] Re: Error: Edit about end license

2010-11-17 Thread mdipierro
Thank you for the clarification. The reason I could not reproduce (and
still cannot) is that this is because of a bug that was fixed this
morning in trunk. ;-)

Thanks for reporting it anyway.

if filetype == 'html' and request.args >= 3:

in your version, should be

if filetype == 'html' and len(request.args) >= 3:


Massimo

On Nov 17, 8:01 pm, Vollrath  wrote:
> Ok,
>
> 1. In dashboard app welcome click about. (admin/default/site)
> 2. About welcome click in edit (admin/default/about/welcome)
> 3. result: Internal error: Ticket issued: admin/
> 127.0.0.1.2010-11-17.23-59-53.92f42c7d-cee6-4fe5-9794-d6c3c2fbc38c
> 4. Ticket:
>
> Traceback (most recent call last):
>   File "/home/vinicius/www/plocme/gluon/restricted.py", line 188, in
> restricted
>     exec ccode in environment
>   File "/home/vinicius/www/plocme/applications/admin/controllers/
> default.py", line 1148, in 
>   File "/home/vinicius/www/plocme/gluon/globals.py", line 96, in
> 
>     self._caller = lambda f: f()
>   File "/home/vinicius/www/plocme/applications/admin/controllers/
> default.py", line 437, in edit
>     request.args[2] + '.py')
> IndexError: list index out of range
>
> [ ]'s
> vinicius
>
> On Nov 17, 11:49 pm, mdipierro  wrote:
>
> > Since I cannot reproduce it, perhaps I do not understand. Can you list
> > the steps to reproduce it?
>
> > Massimo
>
> > On Nov 17, 3:32 pm, Vinicius Vollrath 
> > wrote:
>
> > > Hi,
>
> > > Environment
> > > web2py™ Version 1.89.3 (2010-11-16 13:53:22)
> > > Python Python 2.5.5: /usr/bin/python2.5
>
> > > Traceback (most recent call last):
> > >   File "/home/vinicius/www/plocme/gluon/restricted.py", line 188, in
> > > restricted
> > >     exec ccode in environment
> > >   File
> > > "/home/vinicius/www/plocme/applications/admin/controllers/default.py", 
> > > line
> > > 1148, in 
> > >   File "/home/vinicius/www/plocme/gluon/globals.py", line 96, in 
> > >     self._caller = lambda f: f()
> > >   File
> > > "/home/vinicius/www/plocme/applications/admin/controllers/default.py", 
> > > line
> > > 437, in edit
> > >     request.args[2] + '.py')
> > > IndexError: list index out of range
>
> > > ERROR SNAPSHOT
> > > (list index out of range)
> > > --
> > > Att,
> > > Vinicius Vollrath
>
>


[web2py] Re: Error: Edit about end license

2010-11-17 Thread Vollrath
Ok,

1. In dashboard app welcome click about. (admin/default/site)
2. About welcome click in edit (admin/default/about/welcome)
3. result: Internal error: Ticket issued: admin/
127.0.0.1.2010-11-17.23-59-53.92f42c7d-cee6-4fe5-9794-d6c3c2fbc38c
4. Ticket:

Traceback (most recent call last):
  File "/home/vinicius/www/plocme/gluon/restricted.py", line 188, in
restricted
exec ccode in environment
  File "/home/vinicius/www/plocme/applications/admin/controllers/
default.py", line 1148, in 
  File "/home/vinicius/www/plocme/gluon/globals.py", line 96, in

self._caller = lambda f: f()
  File "/home/vinicius/www/plocme/applications/admin/controllers/
default.py", line 437, in edit
request.args[2] + '.py')
IndexError: list index out of range

[ ]'s
vinicius


On Nov 17, 11:49 pm, mdipierro  wrote:
> Since I cannot reproduce it, perhaps I do not understand. Can you list
> the steps to reproduce it?
>
> Massimo
>
> On Nov 17, 3:32 pm, Vinicius Vollrath 
> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > Environment
> > web2py™ Version 1.89.3 (2010-11-16 13:53:22)
> > Python Python 2.5.5: /usr/bin/python2.5
>
> > Traceback (most recent call last):
> >   File "/home/vinicius/www/plocme/gluon/restricted.py", line 188, in
> > restricted
> >     exec ccode in environment
> >   File
> > "/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
> > 1148, in 
> >   File "/home/vinicius/www/plocme/gluon/globals.py", line 96, in 
> >     self._caller = lambda f: f()
> >   File
> > "/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
> > 437, in edit
> >     request.args[2] + '.py')
> > IndexError: list index out of range
>
> > ERROR SNAPSHOT
> > (list index out of range)
> > --
> > Att,
> > Vinicius Vollrath


[web2py] Re: Error: Edit about end license

2010-11-17 Thread mdipierro
Since I cannot reproduce it, perhaps I do not understand. Can you list
the steps to reproduce it?

Massimo

On Nov 17, 3:32 pm, Vinicius Vollrath 
wrote:
> Hi,
>
> Environment
> web2py™ Version 1.89.3 (2010-11-16 13:53:22)
> Python Python 2.5.5: /usr/bin/python2.5
>
> Traceback (most recent call last):
>   File "/home/vinicius/www/plocme/gluon/restricted.py", line 188, in
> restricted
>     exec ccode in environment
>   File
> "/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
> 1148, in 
>   File "/home/vinicius/www/plocme/gluon/globals.py", line 96, in 
>     self._caller = lambda f: f()
>   File
> "/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
> 437, in edit
>     request.args[2] + '.py')
> IndexError: list index out of range
>
> ERROR SNAPSHOT
> (list index out of range)
> --
> Att,
> Vinicius Vollrath


[web2py] Re: Error: Edit about end license

2010-11-17 Thread Vollrath
No, Ubuntu 10.04.

On Nov 17, 11:20 pm, mdipierro  wrote:
> using windows?
>
> On Nov 17, 7:06 pm, Vollrath  wrote:


[web2py] Re: endswith patch in trunk exception message incorrect

2010-11-17 Thread mdipierro
fixed in trunk.

On Nov 17, 7:11 pm, ron_m  wrote:
>     def endswith(self, value):
>        if self.type in ('string', 'text'):
>            return Query(self, ' LIKE ', '%%%s' % value)
>        else:
>            raise RuntimeError, "startswith used with incompatible
> field type"
>
> The last line should be
>
>            raise RuntimeError, "endswith used with incompatible field
> type"


[web2py] Re: Error: Edit about end license

2010-11-17 Thread mdipierro
using windows?

On Nov 17, 7:06 pm, Vollrath  wrote:
> version 1.89.3 (2010-11-16 13:53:22)
> I download the trunk (for developers) inhttps://web2py.googlecode.com/hg/
>
> [ ]'s
> Vinicius
>
> On Nov 17, 9:15 pm, mdipierro  wrote:
>
> > Eu não posso reproduzir isso.Qual a versão?
>
> > Em 17 de novembro, 03:32, Vinicius Vollrath  > terradigital.com.br>escreveu:
>
>


Re: [web2py] ajax push

2010-11-17 Thread Phyo Arkar
Very cool framework .

But how web2py gonna work with as it have no serverside support for python ?


We may be have to run 2 servers 1 for web2py and just 1 alone for Pushes ..

Anyone have used it in real applications?

On Tue, Nov 16, 2010 at 3:54 AM, Michele Comitini <
michele.comit...@gmail.com> wrote:

> Does anyone use this with web2py?
>
> http://www.ape-project.org/ajax-push.html
>
> seems interesting!
>
> mic
>


[web2py] endswith patch in trunk exception message incorrect

2010-11-17 Thread ron_m
def endswith(self, value):
   if self.type in ('string', 'text'):
   return Query(self, ' LIKE ', '%%%s' % value)
   else:
   raise RuntimeError, "startswith used with incompatible
field type"

The last line should be

   raise RuntimeError, "endswith used with incompatible field
type"


[web2py] Re: Error: Edit about end license

2010-11-17 Thread Vollrath
version 1.89.3 (2010-11-16 13:53:22)
I download the trunk (for developers) in https://web2py.googlecode.com/hg/

[ ]'s
Vinicius

On Nov 17, 9:15 pm, mdipierro  wrote:
> Eu não posso reproduzir isso.Qual a versão?
>
> Em 17 de novembro, 03:32, Vinicius Vollrath  terradigital.com.br>escreveu:


[web2py] Re: Unable to detect your browser

2010-11-17 Thread mdipierro
you should set the environment variable BROWSER

http://docs.python.org/library/webbrowser.html

On Nov 17, 5:31 pm, greenpoise  wrote:
> Ok, I must admit, I am one of those with a weird setup. I dont have
> firefox, seamonkey, IExplorer. I just happen to have Chromium and
> Opera as my two browsers. When I try to load web2py I get this error:
>
> Traceback (most recent call last):
>   File "web2py.py", line 20, in 
>     import gluon.widget
>   File "/home/danel/Applications/web2py/gluon/widget.py", line 85
>     print 'warning: unable to detect your browser'
>
> Thanks


[web2py] Unable to detect your browser

2010-11-17 Thread greenpoise
Ok, I must admit, I am one of those with a weird setup. I dont have
firefox, seamonkey, IExplorer. I just happen to have Chromium and
Opera as my two browsers. When I try to load web2py I get this error:


Traceback (most recent call last):
  File "web2py.py", line 20, in 
import gluon.widget
  File "/home/danel/Applications/web2py/gluon/widget.py", line 85
print 'warning: unable to detect your browser'


Thanks


[web2py] Re: web2py and distributed computing

2010-11-17 Thread mdipierro
You can import rpyc and use it already. Anyway, I am going to look
more into this.
Do you have something specific in mind?

On Nov 17, 5:12 pm, VP  wrote:
> I am wondering if it is feasible and even easy to incorporate
> something like RPyC into web2py.   Ideally, I would like to have an
> app calling a web2py app located in a different server without too
> much hassle (web2py taking care of the technical details).
>
> Can we have this feature in web2py?  :-)


[web2py] Re: Error: Edit about end license

2010-11-17 Thread mdipierro
I cannot reproduce this. Which version?

On Nov 17, 3:32 pm, Vinicius Vollrath 
wrote:
> Hi,
>
> Environment
> web2py™ Version 1.89.3 (2010-11-16 13:53:22)
> Python Python 2.5.5: /usr/bin/python2.5
>
> Traceback (most recent call last):
>   File "/home/vinicius/www/plocme/gluon/restricted.py", line 188, in
> restricted
>     exec ccode in environment
>   File
> "/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
> 1148, in 
>   File "/home/vinicius/www/plocme/gluon/globals.py", line 96, in 
>     self._caller = lambda f: f()
>   File
> "/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
> 437, in edit
>     request.args[2] + '.py')
> IndexError: list index out of range
>
> ERROR SNAPSHOT
> (list index out of range)
> --
> Att,
> Vinicius Vollrath


[web2py] web2py and distributed computing

2010-11-17 Thread VP
I am wondering if it is feasible and even easy to incorporate
something like RPyC into web2py.   Ideally, I would like to have an
app calling a web2py app located in a different server without too
much hassle (web2py taking care of the technical details).

Can we have this feature in web2py?  :-)


[web2py] Error: Edit about end license

2010-11-17 Thread Vinicius Vollrath
Hi,

Environment
web2py™ Version 1.89.3 (2010-11-16 13:53:22)
Python Python 2.5.5: /usr/bin/python2.5

Traceback (most recent call last):
  File "/home/vinicius/www/plocme/gluon/restricted.py", line 188, in
restricted
exec ccode in environment
  File
"/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
1148, in 
  File "/home/vinicius/www/plocme/gluon/globals.py", line 96, in 
self._caller = lambda f: f()
  File
"/home/vinicius/www/plocme/applications/admin/controllers/default.py", line
437, in edit
request.args[2] + '.py')
IndexError: list index out of range

ERROR SNAPSHOT
(list index out of range)
-- 
Att,
Vinicius Vollrath


[web2py] Re: import csv automatic

2010-11-17 Thread Aurigadl
#This was my solution.

import os

db.define_table('sgd_pa_cont_continente',
Field('cont_nombre',writable=False, required=True, notnull=True))

appfolder = os.path.normpath(request.folder)
fileCsv   = os.path.join(appfolder, 'static','continente.csv')

db.import_from_csv_file(open(fileCsv, 'rb'))

Thanks for the help




[web2py] Re: Upgrade problem

2010-11-17 Thread mdipierro
hmmm. I can make the error go away but this is a path issue

On Nov 17, 3:31 pm, Kenneth Lundström 
wrote:
> I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.
>
> I m running Linux, Apache and mod_wsgi. Is this too an file permission
> problem. I still can t create a new application with admin. Don t know
> where to start looking for the problem.
>
> Kenneth
>
> Version
> web2py Version 1.89.1 (2010-11-12 15:14:36)
> Python Python 2.6.5: /usr/bin/python
> Traceback
>
> Traceback (most recent call last):
> File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
> exec ccode in environment
> File "/data/domains/web2py/applications/admin/controllers/default.py",
> line 1146, in 
> File "/data/domains/web2py/gluon/globals.py", line 96, in 
> self._caller = lambda f: f()
> File "/data/domains/web2py/applications/admin/controllers/default.py",
> line 200, in upgrade_web2py
> (success, error) = upgrade(request)
> File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
> file.close()
> UnboundLocalError: local variable 'file' referenced before assignment
>
> Error snapshot help Detailed traceback description
>
> (local variable 'file' referenced
> before assignment)


[web2py] Re: decimal validator by default or not

2010-11-17 Thread mdipierro
4,2 have to do with precision, not range.

On Nov 17, 4:18 pm, Richard Vézina 
wrote:
> Ok,
>
> I think I wrongly define the IS_DECIMAL_IN_RANGE
>
> I set it to (0,99.99)
>
> And now the validators works.
>
> Still wondering if IS_DECIMAL_IN_RANGE as to be explicitly define since the
> decimal(4,2) were already available
>
> Richard
>
> On Wed, Nov 17, 2010 at 4:06 PM, Richard Vézina 
> > wrote:
> > Just to be sure... Data are entered in english... Mean if we entered
> > exactly this in the form fiel : 123.123
>
> > On Wed, Nov 17, 2010 at 3:59 PM, Jonathan Lundell wrote:
>
> >> On Nov 17, 2010, at 12:26 PM, mdipierro wrote:
>
> >> > could be. Not sure what that means for decimal numbers.
>
> >> FWIW, I took a look at the Python decimal module, and it requires '.' as
> >> the decimal separator. So any conversion is going to have to happen before
> >> Decimal gets the string.
>
> >> > On Nov 17, 2:07 pm, Richard Vézina 
> >> > wrote:
> >> >> I use postgresql and local in postgres are : fr_CA.UTF-8
>
> >> >> Could it be the reason of the problem?
>
> >> >> Richard
>
> >> >> On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
> >> wrote:
> >> >>> BTW... why are you getting the traceback in french? If your python is
> >> >>> localized, could this affect the meaning of . in sqlite?
>
> >> >>> On Nov 17, 9:43 am, Richard Vézina 
> >> >>> wrote:
> >>  Hello,
>
> >>  I wonder if it is normal that I get ticket in that case :
>
> >>  Model :
>
> >>  Field('field1','decimal(4,2)'),
>
> >>  If I insert in form generate with crud.create(db.table1) this value :
> >>  123.123
>
> >>  I get ticket :
>
> >>  Error traceback
>
> >>  1.
> >>  2.
> >>  3.
> >>  4.
> >>  5.
> >>  6.
> >>  7.
> >>  8.
> >>  9.
> >>  10.
> >>  11.
> >>  12.
> >>  13.
> >>  14.
> >>  15.
> >>  16.
> >>  17.
> >>  18.
> >>  19.
> >>  20.
> >>  21.
>
> >>  Traceback (most recent call last):
> >>    File "/web2py/gluon/restricted.py", line 188, in restricted
> >>      exec ccode in environment
> >>    File "/web2py/applications/app/controllers/test.py", line 552, in
> >> >>> 
> >>    File "/web2py/gluon/globals.py", line 96, in 
> >>      self._caller = lambda f: f()
> >>    File "/web2py/gluon/tools.py", line 2270, in f
> >>      return action(*a, **b)
> >>    File "/web2py/applications/app/controllers/test.py", line 372, in
> >> >>> update
> >>      if form.accepts(request.vars, session):
> >>    File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> >>      self.table._db(self.table.id == self.record.id).update(**fields)
> >>    File "/web2py/gluon/sql.py", line 3484, in update
> >>      self._db._execute(query)
> >>    File "/web2py/gluon/sql.py", line 1026, in 
> >>      self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> >>  DataError: ERREUR:  champ numérique en dehors des limites
> >>  DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
> >> une
> >> >>> valeur
> >>  absolue inférieure à 10^2.
>
> >>  I thought that the validator will show up a error...
>
> >>  Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> >> decimal
> >>  limit in the model???
>
> >>  Regards.
>
> >>  Richard
>
>


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
Ok,

I think I wrongly define the IS_DECIMAL_IN_RANGE

I set it to (0,99.99)

And now the validators works.

Still wondering if IS_DECIMAL_IN_RANGE as to be explicitly define since the
decimal(4,2) were already available

Richard

On Wed, Nov 17, 2010 at 4:06 PM, Richard Vézina  wrote:

> Just to be sure... Data are entered in english... Mean if we entered
> exactly this in the form fiel : 123.123
>
>
> On Wed, Nov 17, 2010 at 3:59 PM, Jonathan Lundell wrote:
>
>> On Nov 17, 2010, at 12:26 PM, mdipierro wrote:
>> >
>> > could be. Not sure what that means for decimal numbers.
>>
>> FWIW, I took a look at the Python decimal module, and it requires '.' as
>> the decimal separator. So any conversion is going to have to happen before
>> Decimal gets the string.
>>
>>
>> >
>> > On Nov 17, 2:07 pm, Richard Vézina 
>> > wrote:
>> >> I use postgresql and local in postgres are : fr_CA.UTF-8
>> >>
>> >> Could it be the reason of the problem?
>> >>
>> >> Richard
>> >>
>> >> On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
>> wrote:
>> >>> BTW... why are you getting the traceback in french? If your python is
>> >>> localized, could this affect the meaning of . in sqlite?
>> >>
>> >>> On Nov 17, 9:43 am, Richard Vézina 
>> >>> wrote:
>>  Hello,
>> >>
>>  I wonder if it is normal that I get ticket in that case :
>> >>
>>  Model :
>> >>
>>  Field('field1','decimal(4,2)'),
>> >>
>>  If I insert in form generate with crud.create(db.table1) this value :
>>  123.123
>> >>
>>  I get ticket :
>> >>
>>  Error traceback
>> >>
>>  1.
>>  2.
>>  3.
>>  4.
>>  5.
>>  6.
>>  7.
>>  8.
>>  9.
>>  10.
>>  11.
>>  12.
>>  13.
>>  14.
>>  15.
>>  16.
>>  17.
>>  18.
>>  19.
>>  20.
>>  21.
>> >>
>>  Traceback (most recent call last):
>>    File "/web2py/gluon/restricted.py", line 188, in restricted
>>  exec ccode in environment
>>    File "/web2py/applications/app/controllers/test.py", line 552, in
>> >>> 
>>    File "/web2py/gluon/globals.py", line 96, in 
>>  self._caller = lambda f: f()
>>    File "/web2py/gluon/tools.py", line 2270, in f
>>  return action(*a, **b)
>>    File "/web2py/applications/app/controllers/test.py", line 372, in
>> >>> update
>>  if form.accepts(request.vars, session):
>>    File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>>  self.table._db(self.table.id == self.record.id).update(**fields)
>>    File "/web2py/gluon/sql.py", line 3484, in update
>>  self._db._execute(query)
>>    File "/web2py/gluon/sql.py", line 1026, in 
>>  self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
>>  DataError: ERREUR:  champ numérique en dehors des limites
>>  DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
>> une
>> >>> valeur
>>  absolue inférieure à 10^2.
>> >>
>>  I thought that the validator will show up a error...
>> >>
>>  Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
>> decimal
>>  limit in the model???
>> >>
>>  Regards.
>> >>
>>  Richard
>> >>
>> >>
>>
>>
>>
>


[web2py] Re: many to many inline form

2010-11-17 Thread Joe Wakefield
I'm still learning widget stuff, and while I can design a many-to-many
widget, I am having trouble visualizing how to produce one with extra
fields and buttons for adding/removing. I might strike an epiphany,
but I'll likely just wait for you to make something available.

On Nov 12, 11:27 am, mdipierro  wrote:
> We do not have a widget for that but it is time to make one. It is not
> difficult.
> If I have time I will do this over the week-end. Other users may have
> already something working.
>
> On Nov 12, 10:17 am, Joe Wakefield  wrote:
>
> > So I'm trying to migrate an old rails app that broke a while back, and
> > I came across a rather difficult situation. I boiled the problem down
> > to this simplified mockup:http://yfrog.com/ghbeanjarsp
>
> > The real app has nothing to do with jelly beans, but this is the issue
> > at hand. Basically there are tables joined in a many to many
> > relationship, with an extra column for amount (because no bean is
> > unique). Creating/updating jars must be done inline with the rest of
> > the jar's form.
>
> > I was reading stuff about custom widgets, and that seemed a likely
> > direction. However, I'm hoping for a more direct suggestion on how you
> > guys would achieve this.
>
>


[web2py] Re:

2010-11-17 Thread villas
On Nov 17, 3:12 pm, Napoleon Moreno  wrote:
> I found the answer in the book , like is usual

Great news Napoleon!  Sorry I didn't see your post until after I'd
replied  :)



[web2py] Upgrade problem

2010-11-17 Thread Kenneth Lundström

I tried to upgrade version 1.89.1 to 1.89.3. I got the following error.

I´m running Linux, Apache and mod_wsgi. Is this too an file permission 
problem. I still can´t create a new application with admin. Don´t know 
where to start looking for the problem.



Kenneth


Version
web2py™ Version 1.89.1 (2010-11-12 15:14:36)
Python Python 2.6.5: /usr/bin/python
Traceback

Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/admin/controllers/default.py", 
line 1146, in 

File "/data/domains/web2py/gluon/globals.py", line 96, in 
self._caller = lambda f: f()
File "/data/domains/web2py/applications/admin/controllers/default.py", 
line 200, in upgrade_web2py

(success, error) = upgrade(request)
File "/data/domains/web2py/gluon/admin.py", line 427, in upgrade
file.close()
UnboundLocalError: local variable 'file' referenced before assignment

Error snapshot help Detailed traceback description

(local variable 'file' referenced 
before assignment)


[web2py] verification login

2010-11-17 Thread mattynoce
hi, i hope this is an easy question, but i didn't find answers
elsewhere in the forum.

here's what i'm looking to do:

1) a parent registers with the site
2) the parent registers her child using just an email address
3) the child receives the verification email, and clicks on the link
4) the child then finishes the rest of the registration

the part i'm having trouble with is the transition from (3) to (4). in
(2) i was able to do a custom form to create the user and populate the
registration_key field, no problem. but what i would like to do is
have clicking on the verification link actually log in the user, and
then use updates to set the rest of the variables.

this isn't a security risk because it's just registration and there's
no data about the child in the system. basically, i want the child to
be logged in BEFORE having to set a password, then change it inside.
is there a command i can use that will log a user in, or a way to set
verification to automatically log in a user?

thanks,

matt


[web2py] Re: How to setup plugin_wiki?

2010-11-17 Thread Dan
Thank you very much. Everything works fine if you use the simple way
to create an new application. In the beginning I was using the new
wizard and many things went wrong. E.g. everytime I was using the
registration forumular the system adds 100 random users + mine.

On 17 Nov., 21:07, mdipierro  wrote:
> http://www.web2py.com/book/default/chapter/13
>
> On Nov 17, 2:03 pm, Dan  wrote:
>
> > Hi, I just downloaded web2py and added the plugin_wiki plugin. But I
> > don't find any documentation on how to use this plugin. I saw the
> > video on vimeo but the plugin does not add a new node to the main
> > menu. If I'm calling the plugin in the url I'm getting an error: Not
> > authorized ACCESS DENIED.
>
> > Thanks for any help.
>
>


[web2py] Re: plugin_wiki won't set active flag in response.menu?

2010-11-17 Thread mdipierro
Plugin wiki is not very smart. That needs to be improved.

On Nov 17, 3:12 pm, Dan  wrote:
> Just tried to build my onw menu based on the pages from plugin_wiki
> but every active flag in response.menu is set to false. Is there any
> onther way to determine if a wiki page is active?


[web2py] plugin_wiki won't set active flag in response.menu?

2010-11-17 Thread Dan
Just tried to build my onw menu based on the pages from plugin_wiki
but every active flag in response.menu is set to false. Is there any
onther way to determine if a wiki page is active?


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
Just to be sure... Data are entered in english... Mean if we entered exactly
this in the form fiel : 123.123

On Wed, Nov 17, 2010 at 3:59 PM, Jonathan Lundell wrote:

> On Nov 17, 2010, at 12:26 PM, mdipierro wrote:
> >
> > could be. Not sure what that means for decimal numbers.
>
> FWIW, I took a look at the Python decimal module, and it requires '.' as
> the decimal separator. So any conversion is going to have to happen before
> Decimal gets the string.
>
>
> >
> > On Nov 17, 2:07 pm, Richard Vézina 
> > wrote:
> >> I use postgresql and local in postgres are : fr_CA.UTF-8
> >>
> >> Could it be the reason of the problem?
> >>
> >> Richard
> >>
> >> On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
> wrote:
> >>> BTW... why are you getting the traceback in french? If your python is
> >>> localized, could this affect the meaning of . in sqlite?
> >>
> >>> On Nov 17, 9:43 am, Richard Vézina 
> >>> wrote:
>  Hello,
> >>
>  I wonder if it is normal that I get ticket in that case :
> >>
>  Model :
> >>
>  Field('field1','decimal(4,2)'),
> >>
>  If I insert in form generate with crud.create(db.table1) this value :
>  123.123
> >>
>  I get ticket :
> >>
>  Error traceback
> >>
>  1.
>  2.
>  3.
>  4.
>  5.
>  6.
>  7.
>  8.
>  9.
>  10.
>  11.
>  12.
>  13.
>  14.
>  15.
>  16.
>  17.
>  18.
>  19.
>  20.
>  21.
> >>
>  Traceback (most recent call last):
>    File "/web2py/gluon/restricted.py", line 188, in restricted
>  exec ccode in environment
>    File "/web2py/applications/app/controllers/test.py", line 552, in
> >>> 
>    File "/web2py/gluon/globals.py", line 96, in 
>  self._caller = lambda f: f()
>    File "/web2py/gluon/tools.py", line 2270, in f
>  return action(*a, **b)
>    File "/web2py/applications/app/controllers/test.py", line 372, in
> >>> update
>  if form.accepts(request.vars, session):
>    File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>  self.table._db(self.table.id == self.record.id).update(**fields)
>    File "/web2py/gluon/sql.py", line 3484, in update
>  self._db._execute(query)
>    File "/web2py/gluon/sql.py", line 1026, in 
>  self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
>  DataError: ERREUR:  champ numérique en dehors des limites
>  DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
> une
> >>> valeur
>  absolue inférieure à 10^2.
> >>
>  I thought that the validator will show up a error...
> >>
>  Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> decimal
>  limit in the model???
> >>
>  Regards.
> >>
>  Richard
> >>
> >>
>
>
>


[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread Anthony
You should encourage every expert to provide as much bio detail as
possible (some have none at all), or at least link to a personal or
business website -- potential customers will want some details before
making contact. Also, everyone should have a location listed --
"undisclosed location" makes it sound like they're in hiding or
something.

Anthony

On Nov 17, 11:35 am, Branko Vukelic  wrote:
> On Wed, Nov 17, 2010 at 4:22 PM, mdipierro  wrote:
> > You can sign up. I will approve those people who I recognize as
> > contributors and/or have proven skills by deploying a web2py
> > application. After we reach ~50 people new members will have to be
> > endorsed by 5 existing members to be approved.
>
> Aaaand, we'll have to do something about that list of experts. Maybe a
> searchable paged list? Anyway, it's getting longer and longer.
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog:http://www.brankovukelic.com/
> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca:http://identi.ca/foxbunny
>
> Gimp Brushmakers Guildhttp://bit.ly/gbg-group


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Jonathan Lundell
On Nov 17, 2010, at 12:26 PM, mdipierro wrote:
> 
> could be. Not sure what that means for decimal numbers.

FWIW, I took a look at the Python decimal module, and it requires '.' as the 
decimal separator. So any conversion is going to have to happen before Decimal 
gets the string.


> 
> On Nov 17, 2:07 pm, Richard Vézina 
> wrote:
>> I use postgresql and local in postgres are : fr_CA.UTF-8
>> 
>> Could it be the reason of the problem?
>> 
>> Richard
>> 
>> On Wed, Nov 17, 2010 at 2:37 PM, mdipierro  wrote:
>>> BTW... why are you getting the traceback in french? If your python is
>>> localized, could this affect the meaning of . in sqlite?
>> 
>>> On Nov 17, 9:43 am, Richard Vézina 
>>> wrote:
 Hello,
>> 
 I wonder if it is normal that I get ticket in that case :
>> 
 Model :
>> 
 Field('field1','decimal(4,2)'),
>> 
 If I insert in form generate with crud.create(db.table1) this value :
 123.123
>> 
 I get ticket :
>> 
 Error traceback
>> 
 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.
 14.
 15.
 16.
 17.
 18.
 19.
 20.
 21.
>> 
 Traceback (most recent call last):
   File "/web2py/gluon/restricted.py", line 188, in restricted
 exec ccode in environment
   File "/web2py/applications/app/controllers/test.py", line 552, in
>>> 
   File "/web2py/gluon/globals.py", line 96, in 
 self._caller = lambda f: f()
   File "/web2py/gluon/tools.py", line 2270, in f
 return action(*a, **b)
   File "/web2py/applications/app/controllers/test.py", line 372, in
>>> update
 if form.accepts(request.vars, session):
   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
 self.table._db(self.table.id == self.record.id).update(**fields)
   File "/web2py/gluon/sql.py", line 3484, in update
 self._db._execute(query)
   File "/web2py/gluon/sql.py", line 1026, in 
 self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
 DataError: ERREUR:  champ numérique en dehors des limites
 DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une
>>> valeur
 absolue inférieure à 10^2.
>> 
 I thought that the validator will show up a error...
>> 
 Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
 limit in the model???
>> 
 Regards.
>> 
 Richard
>> 
>> 




[web2py] Re: experts4solutions badges

2010-11-17 Thread Branko Vukelic
Here are some badges for experts4solutions members. The 'button'
version comes in two flavors: for dark background ('_d') and for light
background ('_l').

-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group
<><><><>

Re: [web2py] Re: crud operations for joins?

2010-11-17 Thread Ivan Matveev
> In the example I provide (entity), specifically for web2py and
> relational databases, does it actually make sense to separate 'entity'
> to its own table and use 1:1 relationships from tables A/B/C, or is it
> recommended to just embed the 'entity' fields into tables A/B/C
> (without any references)?.
>
> What are the pros and cons of such alternatives?.
>
> The pro I see about using an independent 'entity' table is
> maintenance, but the con might be the access / manipulation of this
> extra reference ...?

For general info on relational database you can google for database
normalization.

On the practical side sometimes 1:1 relations are useful. For example
if we want to store 'dressed person' object which contains
person_name, current_jacket. Its convenient to store in 2 tables
db.define_table('jackets', Field('jacket', 'string'))
db.define_table('dressed_person', Field('person_name','string'),
Field(current_jacket', db.jackets.id)

So when a person changes a jacket we don't loose info on the jacket
he was wearing in case he wants to put old jacket on again.

On web2py side its much easier to design your app with  1 table= 1
page approach.


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
The french in the ticket should comes from the ubuntu locales setting, I see
no python packages related to the local...

Richard

On Wed, Nov 17, 2010 at 3:43 PM, Richard Vézina  wrote:

> No change with nav set to en-us and with firefox.
>
> Richard
>
>
> On Wed, Nov 17, 2010 at 3:35 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> In the database table decimal are represented like this : 123.123
>>
>> When I export data the "." is replaced by the comma, but I think that
>> depend of the local of the system or the local I specified in the pgadmin
>> export panel...
>>
>> What the relation between the local of the database and the and the lenght
>> of the decimal defined in the model?
>>
>> I far as I can see web2py return to the database the proper format it
>> should it only failed to detected the lenght of the entered value.
>>
>> Maybe the local of the naviagator is involved??
>>
>> I set chrome to french canada.
>>
>> I will make a check in firefox if the problem is not coming from chrome.
>>
>> Richard
>>
>>
>> On Wed, Nov 17, 2010 at 3:26 PM, mdipierro wrote:
>>
>>> could be. Not sure what that means for decimal numbers.
>>>
>>> On Nov 17, 2:07 pm, Richard Vézina 
>>> wrote:
>>> > I use postgresql and local in postgres are : fr_CA.UTF-8
>>> >
>>> > Could it be the reason of the problem?
>>> >
>>> > Richard
>>> >
>>> > On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
>>> wrote:
>>> > > BTW... why are you getting the traceback in french? If your python is
>>> > > localized, could this affect the meaning of . in sqlite?
>>> >
>>> > > On Nov 17, 9:43 am, Richard Vézina 
>>> > > wrote:
>>> > > > Hello,
>>> >
>>> > > > I wonder if it is normal that I get ticket in that case :
>>> >
>>> > > > Model :
>>> >
>>> > > > Field('field1','decimal(4,2)'),
>>> >
>>> > > > If I insert in form generate with crud.create(db.table1) this value
>>> :
>>> > > > 123.123
>>> >
>>> > > > I get ticket :
>>> >
>>> > > > Error traceback
>>> >
>>> > > > 1.
>>> > > > 2.
>>> > > > 3.
>>> > > > 4.
>>> > > > 5.
>>> > > > 6.
>>> > > > 7.
>>> > > > 8.
>>> > > > 9.
>>> > > > 10.
>>> > > > 11.
>>> > > > 12.
>>> > > > 13.
>>> > > > 14.
>>> > > > 15.
>>> > > > 16.
>>> > > > 17.
>>> > > > 18.
>>> > > > 19.
>>> > > > 20.
>>> > > > 21.
>>> >
>>> > > > Traceback (most recent call last):
>>> > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
>>> > > > exec ccode in environment
>>> > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
>>> > > 
>>> > > >   File "/web2py/gluon/globals.py", line 96, in 
>>> > > > self._caller = lambda f: f()
>>> > > >   File "/web2py/gluon/tools.py", line 2270, in f
>>> > > > return action(*a, **b)
>>> > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
>>> > > update
>>> > > > if form.accepts(request.vars, session):
>>> > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>>> > > > self.table._db(self.table.id == self.record.id
>>> ).update(**fields)
>>> > > >   File "/web2py/gluon/sql.py", line 3484, in update
>>> > > > self._db._execute(query)
>>> > > >   File "/web2py/gluon/sql.py", line 1026, in 
>>> > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
>>> > > > DataError: ERREUR:  champ numérique en dehors des limites
>>> > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
>>> une
>>> > > valeur
>>> > > > absolue inférieure à 10^2.
>>> >
>>> > > > I thought that the validator will show up a error...
>>> >
>>> > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
>>> decimal
>>> > > > limit in the model???
>>> >
>>> > > > Regards.
>>> >
>>> > > > Richard
>>> >
>>> >
>>>
>>
>>
>


[web2py] Re: crud operations for joins?

2010-11-17 Thread villas
Hi Carlos

In the relational model, you would separate it.  The idea is that you
group your data into logical datasets (tables),  then you join it all
together by using foreign keys. The idea is that data only ever has to
be entered once and there is little wasted space.

These days we also have the new non-sql DBs which have a different
logic.  With that model you try your best to put as much data as
possible into large tables.  It's also OK to have redundancy of data
provided the queries are faster.  Under that system,  we exchange the
elegance of the relational model for faster query speed.  If you
really do think that 1:1 is the way to go,  you can consider having
one big table containing all the fields you'll ever  want.   OK,
there's some wasted space,  but modern computers don't usually have a
problem and you can run it on Google App Engine too.

It's horses for courses,  but generally speaking,  enterprise software
is ausually based on the relational model.  Big global websites where
speed is paramount are based on non-sql.

-D

On Nov 17, 6:48 pm, Carlos  wrote:
> Thanks villas.
>
> In the example I provide (entity), specifically for web2py and
> relational databases, does it actually make sense to separate 'entity'
> to its own table and use 1:1 relationships from tables A/B/C, or is it
> recommended to just embed the 'entity' fields into tables A/B/C
> (without any references)?.
>
> What are the pros and cons of such alternatives?.
>
> The pro I see about using an independent 'entity' table is
> maintenance, but the con might be the access / manipulation of this
> extra reference ...?
>
> Thanks again!,
>
>    Carlos
>
> On Nov 17, 11:11 am, villas  wrote:
>
> > Hi Carlos,
>
> > See what you mean.  We don't usually use 1:1 relationships,  but 1 to
> > many.
>
> > e.g. From the book:
>
> > db.define_table('person',
> >     Field('name'),
> >     format='%(name)s')
>
> > db.define_table('dog',
> >     Field('name'),
> >     Field('owner', db.person),
> >     format='%(name)s')
>
> > Of course an owner might only have one dog to start with, but then
> > acquire others later, so this model serves for any number of dogs,
> > incl. zero.
>
> > The same owner might also decide to keep a cat and (assuming he needs
> > to keep different data on that) he would simply define a 'cat' table
> > later with a similar realtionship.
>
> > I suppose if you insisted on making it 1:1,  I might simply suggest
> > making the dog.owner field into a unique index which would prevent
> > your adding more than 1.
>
> > -D
>
> > On Nov 17, 3:44 pm, Carlos  wrote:
>
> > > Thanks villas and Ivan.
>
> > > When I say joins I mean 1:1 relationships (or "linked tables"?), where
> > > each record in tables A/B/C reference one (and only one) unique
> > > 'entity' record, kind of like an 'extension' of such tables, but with
> > > data centralized in the 'entity' table (which would allow better
> > > maintenance).
>
> > > I know I have the alternative of embedding all of the 'entity' fields
> > > directly into tables A/B/C (instead of having a separate centralized
> > > 'entity' table, with 1:1 relationships).
>
> > > I was wondering what would be the best approach for this in the
> > > relational world?.
>
> > > And if a separate 'entity' table is the best option, then I guess I
> > > can use the following slice to create (and update?) records with
> > > linked tables:
>
> > >http://www.web2pyslices.com/main/slices/take_slice/102
>
> > > Thanks for your recommendations.
>
> > > p.s. I have certainly already read the entire book :-)
>
> > >    Carlos
>
> > > On Nov 17, 9:06 am, Ivan Matveev  wrote:
>
> > > > >>  I have a 'central' table in my design called 'entity'
> > > > >> which contains lots of data (including names, company, emails, 
> > > > >> phones,
> > > > >> address, etc.) and I want many other tables to point to ONE entity
> > > > >> instance, i.e. 'entity' as an _extension_ of records in many 
> > > > >> different
> > > > >> tables.
>
> > > > When you say 'joined tables' do you mean
> > > > SELECT tabl1.some_col, tabl2.other_col FROM tabl1 LEFT JOIN tabl2 ON 
> > > > .
> > > > or something else?
>
> > > > I don't know a web2py component that can be used to edit a result of a
> > > > joined select.
>
> > > > If your 'entity' table includes all fields you want to present to a
> > > > user you can avoid joins by use of references. I don't use db
> > > > references myself. I think usage can look like this:
>
> > > > db.define_table('names', Field('name', 'string'))
> > > > db.define_table('companies', Field('company', 'string'))
>
> > > > db.define_table('entity',
> > > >     Field('name', db.names.name),
> > > >     Field('company', db.companies.company))
>
> > > > also you can alter the way a field is represented with .represent and
> > > > .requires methods
>
> > > > The details are in documentation on Database Abstraction 
> > > > Layer(DAL)http://www.web2py.com/book/default/chapter/06
>
> > > > SQLFORM allows to edi

[web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Niphlod
+1 for examples, it's quite unusable.

that is also accomplished with this query, only if not seeking other
values 

db4(db4.data_table).select(db4.data_table.reqtime, limitby=(0,1),
orderby=db4.data_table.reqtime)

Niphlod

On 17 Nov, 20:57, Lorin Rivers  wrote:
> I think this would make a good thing to have in the examples.
>
> On Nov 17, 2010, at 13:45 , Massimo Di Pierro wrote:
>
> > my mistake
>
> > m=db4.data_table.ReqTime.min()
> > firsttime = db4(db4.data_table).select(m).first()[m]
>
> > On Nov 17, 2010, at 1:44 PM, Lorin Rivers wrote:
>
> >> m=db4.data_table.ReqTime.min()
> >> firsttime = db4(db4.data_table).select().first()[m]
>
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing 
> 
> 512/203.3198 (m)


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
No change with nav set to en-us and with firefox.

Richard

On Wed, Nov 17, 2010 at 3:35 PM, Richard Vézina  wrote:

> In the database table decimal are represented like this : 123.123
>
> When I export data the "." is replaced by the comma, but I think that
> depend of the local of the system or the local I specified in the pgadmin
> export panel...
>
> What the relation between the local of the database and the and the lenght
> of the decimal defined in the model?
>
> I far as I can see web2py return to the database the proper format it
> should it only failed to detected the lenght of the entered value.
>
> Maybe the local of the naviagator is involved??
>
> I set chrome to french canada.
>
> I will make a check in firefox if the problem is not coming from chrome.
>
> Richard
>
>
> On Wed, Nov 17, 2010 at 3:26 PM, mdipierro wrote:
>
>> could be. Not sure what that means for decimal numbers.
>>
>> On Nov 17, 2:07 pm, Richard Vézina 
>> wrote:
>> > I use postgresql and local in postgres are : fr_CA.UTF-8
>> >
>> > Could it be the reason of the problem?
>> >
>> > Richard
>> >
>> > On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
>> wrote:
>> > > BTW... why are you getting the traceback in french? If your python is
>> > > localized, could this affect the meaning of . in sqlite?
>> >
>> > > On Nov 17, 9:43 am, Richard Vézina 
>> > > wrote:
>> > > > Hello,
>> >
>> > > > I wonder if it is normal that I get ticket in that case :
>> >
>> > > > Model :
>> >
>> > > > Field('field1','decimal(4,2)'),
>> >
>> > > > If I insert in form generate with crud.create(db.table1) this value
>> :
>> > > > 123.123
>> >
>> > > > I get ticket :
>> >
>> > > > Error traceback
>> >
>> > > > 1.
>> > > > 2.
>> > > > 3.
>> > > > 4.
>> > > > 5.
>> > > > 6.
>> > > > 7.
>> > > > 8.
>> > > > 9.
>> > > > 10.
>> > > > 11.
>> > > > 12.
>> > > > 13.
>> > > > 14.
>> > > > 15.
>> > > > 16.
>> > > > 17.
>> > > > 18.
>> > > > 19.
>> > > > 20.
>> > > > 21.
>> >
>> > > > Traceback (most recent call last):
>> > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
>> > > > exec ccode in environment
>> > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
>> > > 
>> > > >   File "/web2py/gluon/globals.py", line 96, in 
>> > > > self._caller = lambda f: f()
>> > > >   File "/web2py/gluon/tools.py", line 2270, in f
>> > > > return action(*a, **b)
>> > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
>> > > update
>> > > > if form.accepts(request.vars, session):
>> > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>> > > > self.table._db(self.table.id == self.record.id
>> ).update(**fields)
>> > > >   File "/web2py/gluon/sql.py", line 3484, in update
>> > > > self._db._execute(query)
>> > > >   File "/web2py/gluon/sql.py", line 1026, in 
>> > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
>> > > > DataError: ERREUR:  champ numérique en dehors des limites
>> > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
>> une
>> > > valeur
>> > > > absolue inférieure à 10^2.
>> >
>> > > > I thought that the validator will show up a error...
>> >
>> > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
>> decimal
>> > > > limit in the model???
>> >
>> > > > Regards.
>> >
>> > > > Richard
>> >
>> >
>>
>
>


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
In the database table decimal are represented like this : 123.123

When I export data the "." is replaced by the comma, but I think that depend
of the local of the system or the local I specified in the pgadmin export
panel...

What the relation between the local of the database and the and the lenght
of the decimal defined in the model?

I far as I can see web2py return to the database the proper format it should
it only failed to detected the lenght of the entered value.

Maybe the local of the naviagator is involved??

I set chrome to french canada.

I will make a check in firefox if the problem is not coming from chrome.

Richard

On Wed, Nov 17, 2010 at 3:26 PM, mdipierro  wrote:

> could be. Not sure what that means for decimal numbers.
>
> On Nov 17, 2:07 pm, Richard Vézina 
> wrote:
> > I use postgresql and local in postgres are : fr_CA.UTF-8
> >
> > Could it be the reason of the problem?
> >
> > Richard
> >
> > On Wed, Nov 17, 2010 at 2:37 PM, mdipierro 
> wrote:
> > > BTW... why are you getting the traceback in french? If your python is
> > > localized, could this affect the meaning of . in sqlite?
> >
> > > On Nov 17, 9:43 am, Richard Vézina 
> > > wrote:
> > > > Hello,
> >
> > > > I wonder if it is normal that I get ticket in that case :
> >
> > > > Model :
> >
> > > > Field('field1','decimal(4,2)'),
> >
> > > > If I insert in form generate with crud.create(db.table1) this value :
> > > > 123.123
> >
> > > > I get ticket :
> >
> > > > Error traceback
> >
> > > > 1.
> > > > 2.
> > > > 3.
> > > > 4.
> > > > 5.
> > > > 6.
> > > > 7.
> > > > 8.
> > > > 9.
> > > > 10.
> > > > 11.
> > > > 12.
> > > > 13.
> > > > 14.
> > > > 15.
> > > > 16.
> > > > 17.
> > > > 18.
> > > > 19.
> > > > 20.
> > > > 21.
> >
> > > > Traceback (most recent call last):
> > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
> > > > exec ccode in environment
> > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> > > 
> > > >   File "/web2py/gluon/globals.py", line 96, in 
> > > > self._caller = lambda f: f()
> > > >   File "/web2py/gluon/tools.py", line 2270, in f
> > > > return action(*a, **b)
> > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> > > update
> > > > if form.accepts(request.vars, session):
> > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> > > > self.table._db(self.table.id == self.record.id).update(**fields)
> > > >   File "/web2py/gluon/sql.py", line 3484, in update
> > > > self._db._execute(query)
> > > >   File "/web2py/gluon/sql.py", line 1026, in 
> > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > > DataError: ERREUR:  champ numérique en dehors des limites
> > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
> une
> > > valeur
> > > > absolue inférieure à 10^2.
> >
> > > > I thought that the validator will show up a error...
> >
> > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> decimal
> > > > limit in the model???
> >
> > > > Regards.
> >
> > > > Richard
> >
> >
>


[web2py] Re: decimal validator by default or not

2010-11-17 Thread mdipierro
could be. Not sure what that means for decimal numbers.

On Nov 17, 2:07 pm, Richard Vézina 
wrote:
> I use postgresql and local in postgres are : fr_CA.UTF-8
>
> Could it be the reason of the problem?
>
> Richard
>
> On Wed, Nov 17, 2010 at 2:37 PM, mdipierro  wrote:
> > BTW... why are you getting the traceback in french? If your python is
> > localized, could this affect the meaning of . in sqlite?
>
> > On Nov 17, 9:43 am, Richard Vézina 
> > wrote:
> > > Hello,
>
> > > I wonder if it is normal that I get ticket in that case :
>
> > > Model :
>
> > > Field('field1','decimal(4,2)'),
>
> > > If I insert in form generate with crud.create(db.table1) this value :
> > > 123.123
>
> > > I get ticket :
>
> > > Error traceback
>
> > > 1.
> > > 2.
> > > 3.
> > > 4.
> > > 5.
> > > 6.
> > > 7.
> > > 8.
> > > 9.
> > > 10.
> > > 11.
> > > 12.
> > > 13.
> > > 14.
> > > 15.
> > > 16.
> > > 17.
> > > 18.
> > > 19.
> > > 20.
> > > 21.
>
> > > Traceback (most recent call last):
> > >   File "/web2py/gluon/restricted.py", line 188, in restricted
> > >     exec ccode in environment
> > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> > 
> > >   File "/web2py/gluon/globals.py", line 96, in 
> > >     self._caller = lambda f: f()
> > >   File "/web2py/gluon/tools.py", line 2270, in f
> > >     return action(*a, **b)
> > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> > update
> > >     if form.accepts(request.vars, session):
> > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> > >     self.table._db(self.table.id == self.record.id).update(**fields)
> > >   File "/web2py/gluon/sql.py", line 3484, in update
> > >     self._db._execute(query)
> > >   File "/web2py/gluon/sql.py", line 1026, in 
> > >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > DataError: ERREUR:  champ numérique en dehors des limites
> > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une
> > valeur
> > > absolue inférieure à 10^2.
>
> > > I thought that the validator will show up a error...
>
> > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> > > limit in the model???
>
> > > Regards.
>
> > > Richard
>
>


Re: [web2py] Re: list:reference issue

2010-11-17 Thread Richard Vézina
Thanks

You are involved in a lot of dev... I understand the delay, no problem. It
is just a kind of reminder ;-)

Richard

On Wed, Nov 17, 2010 at 2:31 PM, mdipierro  wrote:

> will look into this asap.
>
> On Nov 17, 11:49 am, Richard Vézina 
> wrote:
> > Hello,
> >
> > The list:reference issue I discribed last week is still in trunk. I joint
> a
> > demo app with which it is possible to reproduce the issue.
> >
> > If the date validator is triggered and the id of the referenced record is
> > greater then or equal to 10 the app break completely if the corrected
> form
> > is submit and the digited id is not existing in table.
> >
> > For example :
> >
> > I select id 10, I submit, but I forgot to entered a date. I get the
> > validator in action, the id of my selected record is splitted into digit
> 1
> > and 0. 0 not existing in my table = app break including the appadmin
> > interface, so no correction of the problem possible except go in the
> > database changing the id selected.
> >
> > Thanks
> >
> > Richard
> >
> >  web2py.app.applistissue.w2p
> > 107KViewDownload


[web2py] Re: How to setup plugin_wiki?

2010-11-17 Thread mdipierro
http://www.web2py.com/book/default/chapter/13

On Nov 17, 2:03 pm, Dan  wrote:
> Hi, I just downloaded web2py and added the plugin_wiki plugin. But I
> don't find any documentation on how to use this plugin. I saw the
> video on vimeo but the plugin does not add a new node to the main
> menu. If I'm calling the plugin in the url I'm getting an error: Not
> authorized ACCESS DENIED.
>
> Thanks for any help.


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
I use postgresql and local in postgres are : fr_CA.UTF-8

Could it be the reason of the problem?

Richard

On Wed, Nov 17, 2010 at 2:37 PM, mdipierro  wrote:

> BTW... why are you getting the traceback in french? If your python is
> localized, could this affect the meaning of . in sqlite?
>
> On Nov 17, 9:43 am, Richard Vézina 
> wrote:
> > Hello,
> >
> > I wonder if it is normal that I get ticket in that case :
> >
> > Model :
> >
> > Field('field1','decimal(4,2)'),
> >
> > If I insert in form generate with crud.create(db.table1) this value :
> > 123.123
> >
> > I get ticket :
> >
> > Error traceback
> >
> > 1.
> > 2.
> > 3.
> > 4.
> > 5.
> > 6.
> > 7.
> > 8.
> > 9.
> > 10.
> > 11.
> > 12.
> > 13.
> > 14.
> > 15.
> > 16.
> > 17.
> > 18.
> > 19.
> > 20.
> > 21.
> >
> > Traceback (most recent call last):
> >   File "/web2py/gluon/restricted.py", line 188, in restricted
> > exec ccode in environment
> >   File "/web2py/applications/app/controllers/test.py", line 552, in
> 
> >   File "/web2py/gluon/globals.py", line 96, in 
> > self._caller = lambda f: f()
> >   File "/web2py/gluon/tools.py", line 2270, in f
> > return action(*a, **b)
> >   File "/web2py/applications/app/controllers/test.py", line 372, in
> update
> > if form.accepts(request.vars, session):
> >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> > self.table._db(self.table.id == self.record.id).update(**fields)
> >   File "/web2py/gluon/sql.py", line 3484, in update
> > self._db._execute(query)
> >   File "/web2py/gluon/sql.py", line 1026, in 
> > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > DataError: ERREUR:  champ numérique en dehors des limites
> > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une
> valeur
> > absolue inférieure à 10^2.
> >
> > I thought that the validator will show up a error...
> >
> > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> > limit in the model???
> >
> > Regards.
> >
> > Richard
>


[web2py] How to setup plugin_wiki?

2010-11-17 Thread Dan
Hi, I just downloaded web2py and added the plugin_wiki plugin. But I
don't find any documentation on how to use this plugin. I saw the
video on vimeo but the plugin does not add a new node to the main
menu. If I'm calling the plugin in the url I'm getting an error: Not
authorized ACCESS DENIED.

Thanks for any help.


Re: [web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Lorin Rivers
I think this would make a good thing to have in the examples.

On Nov 17, 2010, at 13:45 , Massimo Di Pierro wrote:

> my mistake
> 
> m=db4.data_table.ReqTime.min()
> firsttime = db4(db4.data_table).select(m).first()[m]
> 
> On Nov 17, 2010, at 1:44 PM, Lorin Rivers wrote:
> 
>> m=db4.data_table.ReqTime.min()
>> firsttime = db4(db4.data_table).select().first()[m]
> 

-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




[web2py] Re: Beginner's Question

2010-11-17 Thread mdipierro
The problem is here

> db.task.id_person_released.requires   = IS_IN_DB( db,'person.initials', 
> '%(initials)s  |  %(name_first)s %(name_last)s')

and 'person.initials' shoud be 'person.id' for a reference field.

You also have a | instead of an &.

Anyway, here is a more compact notation that should work

#Table Definitions

db.define_table("person",
Field("initials",length=16, notnull=True,unique=True),
Field("name_last",length=128, notnull=True),
Field("name_first",length=128, notnull=False,default=''),
format='%(initials)s  |  %(name_first)s %(name_last)s'
)

db.define_table("category",
Field("name",length=128, notnull=True,unique=True),
format='%(name)s'
)

db.define_table("task",
Field("title", length=256, notnull=True),
Field("description", "text"),
Field("id_person_assigned", db.person, ondelete='NO ACTION'),
Field("id_person_responsible", db.person, ondelete='NO ACTION'),
Field("id_person_released", db.person, ondelete='NO ACTION'),
Field("date_due", "datetime"),
Field("date_nextcheck", "datetime"),
format='%(title)s'
)

db.define_table("task_category",
SQLField("id_category", db.category),
SQLField("id_task", db.task)
)

task_category =
db((db.category.id==db.task_category.id_category)&(db.task.id==db.task_category.id_task))

I would also replace

Field("initials",length=16, notnull=True,unique=True),

with

Field("initials",length=16, compute=lambda row: ''.join(x[0] for x
in (row.first_name+' '+row.last_name).split())),



On Nov 17, 1:22 pm, asklucas  wrote:
> Hello!
>
> I'm new to web development and my trying web2py because of DRY and,
> most importantly, Python.
>
> I created a model, however I can't insert records in the admin
> interface because of a constraints-error I don't understand.
>
> When trying to insert a record 
> here:http://127.0.0.1:8000/task/appadmin/insert/db/task
>
> I get the Error Snapshot:
> 
>     (
>         ('23000',
>         '[23000] [Microsoft][ODBC SQL Server Driver][SQL Server]
>         The INSERT statement conflicted with the FOREIGN KEY
> constraint "task_id_person_assigned__constraint".
>         The conflict occurred in database "taskdb", table
> "dbo.person", column \'id\'. (547) (SQLExecDirectW);
>         [01000] [Microsoft][ODBC SQL Server Driver][SQL Server]The
> statement has been terminated. (3621)'
>         )
>     )
>
> What I really want is to have dropdown fields in [task] for all three
> person-fields, where only persons from the list can be chosen or no
> one (a task could be created without yet assigning it to anybody).
>
> Additionally I'd like to have a field in [task] where I can choose 0
> to n categories.
>
> Thank you very much!
>
> Lucas.
>
> Model:
>
> 
> #    Table Definitions
>
> db.define_table("person",
>     Field("initials", "string", length=16, notnull=True, default=None,
> unique=True),
>     Field("name_last", "string", length=128, notnull=True,
> default=None),
>     Field("name_first", "string", length=128, notnull=False,
> default=None)
>     )
>
> db.define_table("category",
>     Field("name", "string", length=128, notnull=True, default=None,
> unique=True)
>     )
>
> db.define_table("task",
>     Field("title", "string", length=256, notnull=True, default=None),
>     Field("description", "text"),
>     Field("id_person_assigned", db.person, ondelete='NO ACTION'),
>     Field("id_person_responsible", db.person, ondelete='NO ACTION'),
>     Field("id_person_released", db.person, ondelete='NO ACTION'),
>     Field("date_due", "datetime"),
>     Field("date_nextcheck", "datetime")
>     )
>
> db.define_table("task_category",
>     SQLField("id_category", db.category),
>     SQLField("id_task", db.task)
>     )
>
> #    Table Relations
> #    (remove fields you don't need from requires)
>
> db.task.id_person_assigned.requires       = IS_IN_DB( db,
> 'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')
> db.task.id_person_responsible.requires    = IS_IN_DB( db,
> 'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')
> db.task.id_person_released.requires       = IS_IN_DB( db,
> 'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')
>
> task_category = db(
>     (db.category.id == db.task_category.id_category) | (db.task.id ==
> db.task_category.id_task)
>     )
> 


Re: [web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Massimo Di Pierro
my mistake

m=db4.data_table.ReqTime.min()
firsttime = db4(db4.data_table).select(m).first()[m]

On Nov 17, 2010, at 1:44 PM, Lorin Rivers wrote:

> m=db4.data_table.ReqTime.min()
> firsttime = db4(db4.data_table).select().first()[m]



Re: [web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Lorin Rivers
Massimo,

That pegs my CPU for a bit and then errors:
  File 
"/Users/lrivers/Documents/CurrentProjects/SPTI/spowertech_webappserver1/gluon/sql.py",
 line 734, in __getitem__
return dict.__getitem__(self, key)
KeyError: 'MIN(data_table.ReqTime)'

Here's my code:
m=db4.data_table.ReqTime.min()
firsttime = db4(db4.data_table).select().first()[m]


On Nov 17, 2010, at 13:30 , mdipierro wrote:

> m=db.data_table.reqtime.min()
> value = db(db.date_table).select().first()[m]
> 
> On Nov 17, 11:43 am, Lorin Rivers  wrote:
>> executesql('select min(reqtime) from data_table;')
>> --
>> Lorin Rivers
>> Mosasaur: Killer Technical Marketing 
>> 
>> 512/203.3198 (m)

-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




[web2py] Beginner's Question

2010-11-17 Thread asklucas

Hello!

I'm new to web development and my trying web2py because of DRY and,
most importantly, Python.

I created a model, however I can't insert records in the admin
interface because of a constraints-error I don't understand.

When trying to insert a record here:
http://127.0.0.1:8000/task/appadmin/insert/db/task

I get the Error Snapshot:

(
('23000',
'[23000] [Microsoft][ODBC SQL Server Driver][SQL Server]
The INSERT statement conflicted with the FOREIGN KEY
constraint "task_id_person_assigned__constraint".
The conflict occurred in database "taskdb", table
"dbo.person", column \'id\'. (547) (SQLExecDirectW);
[01000] [Microsoft][ODBC SQL Server Driver][SQL Server]The
statement has been terminated. (3621)'
)
)


What I really want is to have dropdown fields in [task] for all three
person-fields, where only persons from the list can be chosen or no
one (a task could be created without yet assigning it to anybody).

Additionally I'd like to have a field in [task] where I can choose 0
to n categories.

Thank you very much!

Lucas.


Model:


#Table Definitions

db.define_table("person",
Field("initials", "string", length=16, notnull=True, default=None,
unique=True),
Field("name_last", "string", length=128, notnull=True,
default=None),
Field("name_first", "string", length=128, notnull=False,
default=None)
)

db.define_table("category",
Field("name", "string", length=128, notnull=True, default=None,
unique=True)
)

db.define_table("task",
Field("title", "string", length=256, notnull=True, default=None),
Field("description", "text"),
Field("id_person_assigned", db.person, ondelete='NO ACTION'),
Field("id_person_responsible", db.person, ondelete='NO ACTION'),
Field("id_person_released", db.person, ondelete='NO ACTION'),
Field("date_due", "datetime"),
Field("date_nextcheck", "datetime")
)

db.define_table("task_category",
SQLField("id_category", db.category),
SQLField("id_task", db.task)
)

#Table Relations
#(remove fields you don't need from requires)

db.task.id_person_assigned.requires   = IS_IN_DB( db,
'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')
db.task.id_person_responsible.requires= IS_IN_DB( db,
'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')
db.task.id_person_released.requires   = IS_IN_DB( db,
'person.initials', '%(initials)s  |  %(name_first)s %(name_last)s')

task_category = db(
(db.category.id == db.task_category.id_category) | (db.task.id ==
db.task_category.id_task)
)



[web2py] Re: social network, event planners, and the like?

2010-11-17 Thread mdipierro
Not exactly but this is a good place to start:

http://web2py.com/appliances/default/show/71

On Nov 17, 12:59 pm, Carlos  wrote:
> Hi,
>
> In a future project I might need capabilities like social network,
> event planners (e.g. weddings, parties), and the like.
>
> I'm wondering if there's something already out there - preferably free
> open source, and obviously developed with web2py?, or at least in
> python?.
>
> If there's nothing, is it recommended to start from scratch with
> web2py, or interface to external systems (e.g. elgg.org) from web2py?.
>
> If external systems, customizations will likely be required.
>
> Any help / advice on this matter is greatly appreciated - thanks!,
>
>    Carlos


[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread mdipierro
here are many things the need refactoring.

we need a public list of approved experts (the same as now, but random
order and pagination) and a private list of everybody who registered
to that existing experts can endorse new applicants.

massimo



On Nov 17, 10:35 am, Branko Vukelic  wrote:
> On Wed, Nov 17, 2010 at 4:22 PM, mdipierro  wrote:
> > You can sign up. I will approve those people who I recognize as
> > contributors and/or have proven skills by deploying a web2py
> > application. After we reach ~50 people new members will have to be
> > endorsed by 5 existing members to be approved.
>
> Aaaand, we'll have to do something about that list of experts. Maybe a
> searchable paged list? Anyway, it's getting longer and longer.
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog:http://www.brankovukelic.com/
> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca:http://identi.ca/foxbunny
>
> Gimp Brushmakers Guildhttp://bit.ly/gbg-group


[web2py] Web2py Application Exhibition ( Version 2.0 ) 4 weeks to go

2010-11-17 Thread NetAdmin

Just in case you didn't see the "pinned" message at the top of the
group messages, there are 5 weeks to get your apps ready for the
Web2py Application Exhibition ( Version 2.0 )

For more details, see the "pinned" message.

Good Luck!

Mr.NetAdmin


[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread mdipierro
I doubt you are getting a web2py error. You are probably getting a
RuntimeError or ProgrammingError from sqlite.

On Nov 17, 10:19 am, António Ramos  wrote:
> AHH, found a big problem!
> I need to create a table with 940 fields and web2py complains that it is
> over 255
>
> What to do to resolve this? i dont want to partition my table because the
> record realy has 940 fields in my database (Lotus Notes) that i want to
> migrate to web2py.
> António
>
> 2010/11/17 Anthony 
>
> > Are you talking about this:
>
> >http://web2pyople.appspot.com/
>
> > On Nov 17, 10:46 am, appydev  wrote:
> > > Excellent. Thanks for responding.
>
> > > A much changed. I remember an application that was made just for the map
> > of
> > > the "experts." And since I'm beginner, I wanted to see the application to
> > > learn, remember being hosted on Google App Engine.
>
> > > 2010/11/17 mdipierro 
>
> > > > we are taking a different approach
>
> > > >  https://experts4solutions.com
>
> > > > You can sign up. I will approve those people who I recognize as
> > > > contributors and/or have proven skills by deploying a web2py
> > > > application. After we reach ~50 people new members will have to be
> > > > endorsed by 5 existing members to be approved.
>
> > > > If you have already signed up but your name is not listed (not
> > > > approved) but you feel you deserve it, please email me and explain
> > > > why. It is possible I did not recognize your name.
>
> > > > Massimo
>
> > > > On Nov 17, 9:07 am, appydev  wrote:
> > > > > Greetings to everyone.
>
> > > > > I recently read about an application developed with web2py like
> > "Django
> > > > > People" I get to test it and I read about some suggestions from
> > Massimo.
>
> > > > > I've been looking but can not find it. Anyone remember it?- Hide
> > quoted text -
>
> > > - Show quoted text -
>
>


[web2py] Re: decimal validator by default or not

2010-11-17 Thread mdipierro
BTW... why are you getting the traceback in french? If your python is
localized, could this affect the meaning of . in sqlite?

On Nov 17, 9:43 am, Richard Vézina 
wrote:
> Hello,
>
> I wonder if it is normal that I get ticket in that case :
>
> Model :
>
> Field('field1','decimal(4,2)'),
>
> If I insert in form generate with crud.create(db.table1) this value :
> 123.123
>
> I get ticket :
>
> Error traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
>
> Traceback (most recent call last):
>   File "/web2py/gluon/restricted.py", line 188, in restricted
>     exec ccode in environment
>   File "/web2py/applications/app/controllers/test.py", line 552, in 
>   File "/web2py/gluon/globals.py", line 96, in 
>     self._caller = lambda f: f()
>   File "/web2py/gluon/tools.py", line 2270, in f
>     return action(*a, **b)
>   File "/web2py/applications/app/controllers/test.py", line 372, in update
>     if form.accepts(request.vars, session):
>   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>     self.table._db(self.table.id == self.record.id).update(**fields)
>   File "/web2py/gluon/sql.py", line 3484, in update
>     self._db._execute(query)
>   File "/web2py/gluon/sql.py", line 1026, in 
>     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> DataError: ERREUR:  champ numérique en dehors des limites
> DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une valeur
> absolue inférieure à 10^2.
>
> I thought that the validator will show up a error...
>
> Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> limit in the model???
>
> Regards.
>
> Richard


[web2py] Re: decimal validator by default or not

2010-11-17 Thread mdipierro
what python version? perhaps something has changed in sqlite? this
looks like a sqlite error.

On Nov 17, 9:43 am, Richard Vézina 
wrote:
> Hello,
>
> I wonder if it is normal that I get ticket in that case :
>
> Model :
>
> Field('field1','decimal(4,2)'),
>
> If I insert in form generate with crud.create(db.table1) this value :
> 123.123
>
> I get ticket :
>
> Error traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
>
> Traceback (most recent call last):
>   File "/web2py/gluon/restricted.py", line 188, in restricted
>     exec ccode in environment
>   File "/web2py/applications/app/controllers/test.py", line 552, in 
>   File "/web2py/gluon/globals.py", line 96, in 
>     self._caller = lambda f: f()
>   File "/web2py/gluon/tools.py", line 2270, in f
>     return action(*a, **b)
>   File "/web2py/applications/app/controllers/test.py", line 372, in update
>     if form.accepts(request.vars, session):
>   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>     self.table._db(self.table.id == self.record.id).update(**fields)
>   File "/web2py/gluon/sql.py", line 3484, in update
>     self._db._execute(query)
>   File "/web2py/gluon/sql.py", line 1026, in 
>     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> DataError: ERREUR:  champ numérique en dehors des limites
> DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une valeur
> absolue inférieure à 10^2.
>
> I thought that the validator will show up a error...
>
> Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> limit in the model???
>
> Regards.
>
> Richard


[web2py] Re: Validate dynamically generated select SQLFORM.factory

2010-11-17 Thread mdipierro
btw you can do

requires=IS_IN_SET(...,multiple=True,_and=IS_NOT_EMPTY())

On Nov 17, 1:33 pm, mdipierro  wrote:
> > DenesL I agree that "multiple should mean 1 or more, not zero or more."
>
> I disagree. Multiple means 0 or more. Anyway, we cannot change this.
>
> On Nov 17, 12:06 pm, Kostas M  wrote:
>
> > At first thanks villas for the correction of the boolean 'multiple'
> > argument.
>
> > DenesL I agree that "multiple should mean 1 or more, not zero or
> > more."
>
> > Making though the following test:
>
> > >>> IS_IN_SET(['max', 'john'])('')
>
> > ('', 'value not allowed')>>> IS_IN_SET(['max', 'john'], multiple=True)('')
>
> > ([], None)
>
> > seems that the zero option strangely is allowed for the multiple case.
>
> > According 
> > to:http://www.web2py.com/examples/static/epydoc/web2py.gluon.validators
> > this is due to lines:
> >  327              if self.multiple and (value == None or value ==
> > ''):
> >  328                  return ([], None)
>
> > I think should return (value, self.error_message), as is the case for
> > multiple=False
>
> > > Because multiple is not False, but I am not sure about the logic.
> > > No selection should still fail because it is not in the set,
> > > i.e. multiple should mean 1 or more, not zero or more.
>
>


[web2py] Re: Validate dynamically generated select SQLFORM.factory

2010-11-17 Thread mdipierro
> DenesL I agree that "multiple should mean 1 or more, not zero or more."

I disagree. Multiple means 0 or more. Anyway, we cannot change this.


On Nov 17, 12:06 pm, Kostas M  wrote:
> At first thanks villas for the correction of the boolean 'multiple'
> argument.
>
> DenesL I agree that "multiple should mean 1 or more, not zero or
> more."
>
> Making though the following test:
>
> >>> IS_IN_SET(['max', 'john'])('')
>
> ('', 'value not allowed')>>> IS_IN_SET(['max', 'john'], multiple=True)('')
>
> ([], None)
>
> seems that the zero option strangely is allowed for the multiple case.
>
> According 
> to:http://www.web2py.com/examples/static/epydoc/web2py.gluon.validators
> this is due to lines:
>  327              if self.multiple and (value == None or value ==
> ''):
>  328                  return ([], None)
>
> I think should return (value, self.error_message), as is the case for
> multiple=False
>
>
>
> > Because multiple is not False, but I am not sure about the logic.
> > No selection should still fail because it is not in the set,
> > i.e. multiple should mean 1 or more, not zero or more.
>
>


[web2py] Re: list:reference issue

2010-11-17 Thread mdipierro
will look into this asap.

On Nov 17, 11:49 am, Richard Vézina 
wrote:
> Hello,
>
> The list:reference issue I discribed last week is still in trunk. I joint a
> demo app with which it is possible to reproduce the issue.
>
> If the date validator is triggered and the id of the referenced record is
> greater then or equal to 10 the app break completely if the corrected form
> is submit and the digited id is not existing in table.
>
> For example :
>
> I select id 10, I submit, but I forgot to entered a date. I get the
> validator in action, the id of my selected record is splitted into digit 1
> and 0. 0 not existing in my table = app break including the appadmin
> interface, so no correction of the problem possible except go in the
> database changing the id selected.
>
> Thanks
>
> Richard
>
>  web2py.app.applistissue.w2p
> 107KViewDownload


[web2py] Re: Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread mdipierro
m=db.data_table.reqtime.min()
value = db(db.date_table).select().first()[m]

On Nov 17, 11:43 am, Lorin Rivers  wrote:
> executesql('select min(reqtime) from data_table;')
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing 
> 
> 512/203.3198 (m)


[web2py] social network, event planners, and the like?

2010-11-17 Thread Carlos
Hi,

In a future project I might need capabilities like social network,
event planners (e.g. weddings, parties), and the like.

I'm wondering if there's something already out there - preferably free
open source, and obviously developed with web2py?, or at least in
python?.

If there's nothing, is it recommended to start from scratch with
web2py, or interface to external systems (e.g. elgg.org) from web2py?.

If external systems, customizations will likely be required.

Any help / advice on this matter is greatly appreciated - thanks!,

   Carlos


[web2py] Re: crud operations for joins?

2010-11-17 Thread Carlos
Thanks villas.

In the example I provide (entity), specifically for web2py and
relational databases, does it actually make sense to separate 'entity'
to its own table and use 1:1 relationships from tables A/B/C, or is it
recommended to just embed the 'entity' fields into tables A/B/C
(without any references)?.

What are the pros and cons of such alternatives?.

The pro I see about using an independent 'entity' table is
maintenance, but the con might be the access / manipulation of this
extra reference ...?

Thanks again!,

   Carlos


On Nov 17, 11:11 am, villas  wrote:
> Hi Carlos,
>
> See what you mean.  We don't usually use 1:1 relationships,  but 1 to
> many.
>
> e.g. From the book:
>
> db.define_table('person',
>     Field('name'),
>     format='%(name)s')
>
> db.define_table('dog',
>     Field('name'),
>     Field('owner', db.person),
>     format='%(name)s')
>
> Of course an owner might only have one dog to start with, but then
> acquire others later, so this model serves for any number of dogs,
> incl. zero.
>
> The same owner might also decide to keep a cat and (assuming he needs
> to keep different data on that) he would simply define a 'cat' table
> later with a similar realtionship.
>
> I suppose if you insisted on making it 1:1,  I might simply suggest
> making the dog.owner field into a unique index which would prevent
> your adding more than 1.
>
> -D
>
> On Nov 17, 3:44 pm, Carlos  wrote:
>
>
>
>
>
>
>
> > Thanks villas and Ivan.
>
> > When I say joins I mean 1:1 relationships (or "linked tables"?), where
> > each record in tables A/B/C reference one (and only one) unique
> > 'entity' record, kind of like an 'extension' of such tables, but with
> > data centralized in the 'entity' table (which would allow better
> > maintenance).
>
> > I know I have the alternative of embedding all of the 'entity' fields
> > directly into tables A/B/C (instead of having a separate centralized
> > 'entity' table, with 1:1 relationships).
>
> > I was wondering what would be the best approach for this in the
> > relational world?.
>
> > And if a separate 'entity' table is the best option, then I guess I
> > can use the following slice to create (and update?) records with
> > linked tables:
>
> >http://www.web2pyslices.com/main/slices/take_slice/102
>
> > Thanks for your recommendations.
>
> > p.s. I have certainly already read the entire book :-)
>
> >    Carlos
>
> > On Nov 17, 9:06 am, Ivan Matveev  wrote:
>
> > > >>  I have a 'central' table in my design called 'entity'
> > > >> which contains lots of data (including names, company, emails, phones,
> > > >> address, etc.) and I want many other tables to point to ONE entity
> > > >> instance, i.e. 'entity' as an _extension_ of records in many different
> > > >> tables.
>
> > > When you say 'joined tables' do you mean
> > > SELECT tabl1.some_col, tabl2.other_col FROM tabl1 LEFT JOIN tabl2 ON .
> > > or something else?
>
> > > I don't know a web2py component that can be used to edit a result of a
> > > joined select.
>
> > > If your 'entity' table includes all fields you want to present to a
> > > user you can avoid joins by use of references. I don't use db
> > > references myself. I think usage can look like this:
>
> > > db.define_table('names', Field('name', 'string'))
> > > db.define_table('companies', Field('company', 'string'))
>
> > > db.define_table('entity',
> > >     Field('name', db.names.name),
> > >     Field('company', db.companies.company))
>
> > > also you can alter the way a field is represented with .represent and
> > > .requires methods
>
> > > The details are in documentation on Database Abstraction 
> > > Layer(DAL)http://www.web2py.com/book/default/chapter/06
>
> > > SQLFORM allows to edit a row in a table which is fine if you have all
> > > fields in 'entity' table.
>
> > > If your 'entity' table contains references to rows in other tables you
> > > will need SELECT...JOIN...
> > > To edit its result  you will have to make a page with multiple
> > > SQLFORMs to edit individual rows in tables ' entity' refers  to , or
> > > make a custom form with SQLFORM.factory, or invent something.
>
> > > >> My background is with object databases, and this kind of design makes
> > > >> sense, although I'm not sure if it makes sense with relation
> > > >> databases?.
>
> > > It's pretty common to store an object information in a relation db as
> > > a set of tables.


[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread cjrh
On Nov 17, 6:19 pm, António Ramos  wrote:
> What to do to resolve this? i dont want to partition my table because the
> record realy has 940 fields in my database (Lotus Notes)

I would love to see a summary of that schema, because with that number
of fields it sounds like you're beginning to fail the first normal
form, and possibly the second.  Does every record populate every field
with a value?


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Jonathan Lundell
On Nov 17, 2010, at 9:40 AM, Richard Vézina wrote:
> Doesn't neither with IS_DECIMAL_IN_RANGE(0,99), I get the same ticket...

The doctest for IS_DECIMAL_IN_RANGE is currently broken (Massimo, I'll send you 
a patch), but these all pass:

>>> IS_DECIMAL_IN_RANGE(0,99)(123.123)
(123.123, 'enter a number between 0 and 99')
>>> IS_DECIMAL_IN_RANGE(0,99)('123.123')
('123.123', 'enter a number between 0 and 99')
>>> IS_DECIMAL_IN_RANGE(0,99)('12.34')
(Decimal('12.34'), None)

Something else must be wrong.


> 
> Richard
> 
> On Wed, Nov 17, 2010 at 12:24 PM, villas  wrote:
> Sorry I misunderstood. I think you are right, web2py doesn't validate
> it.
> -D
> 
> On Nov 17, 5:00 pm, Richard Vézina 
> wrote:
> > I don't want to store 123.123, I want 99.99 max.
> >
> > The problem is that no validator is triggered when entering 123.123...
> >
> > Richard
> >
> > On Wed, Nov 17, 2010 at 11:53 AM, villas  wrote:
> > > Hi Richard
> >
> > > It might depend on the DB,  but I believe you would normally need at
> > > least decimal(5,2) to contain 123.456789
> > > With decimal(4,2) I think the max value would be 99.99...
> >
> > > Try it...  :)
> >
> > > -D
> >
> > > On Nov 17, 3:44 pm, Richard Vézina 
> > > wrote:
> > > > I forgot to precise that I am under 1.88.2
> >
> > > > Thanks
> >
> > > > On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
> >
> > > > ml.richard.vez...@gmail.com> wrote:
> > > > > Hello,
> >
> > > > > I wonder if it is normal that I get ticket in that case :
> >
> > > > > Model :
> >
> > > > > Field('field1','decimal(4,2)'),
> >
> > > > > If I insert in form generate with crud.create(db.table1) this value :
> > > > > 123.123
> >
> > > > > I get ticket :
> >
> > > > > Error traceback
> >
> > > > > 1.
> > > > > 2.
> >
> > > > > 3.
> > > > > 4.
> >
> > > > > 5.
> > > > > 6.
> >
> > > > > 7.
> > > > > 8.
> >
> > > > > 9.
> > > > > 10.
> >
> > > > > 11.
> > > > > 12.
> >
> > > > > 13.
> > > > > 14.
> >
> > > > > 15.
> > > > > 16.
> >
> > > > > 17.
> > > > > 18.
> >
> > > > > 19.
> > > > > 20.
> >
> > > > > 21.
> >
> > > > > Traceback (most recent call last):
> >
> > > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
> >
> > > > > exec ccode in environment
> >
> > > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> > > 
> >
> > > > >   File "/web2py/gluon/globals.py", line 96, in 
> >
> > > > > self._caller = lambda f: f()
> >
> > > > >   File "/web2py/gluon/tools.py", line 2270, in f
> >
> > > > > return action(*a, **b)
> >
> > > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> > > update
> >
> > > > > if form.accepts(request.vars, session):
> >
> > > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> >
> > > > > self.table._db(self.table.id == self.record.id).update(**fields)
> >
> > > > >   File "/web2py/gluon/sql.py", line 3484, in update
> >
> > > > > self._db._execute(query)
> >
> > > > >   File "/web2py/gluon/sql.py", line 1026, in 
> >
> > > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > > > DataError: ERREUR:  champ numérique en dehors des limites
> >
> > > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à 
> > > > > une
> > > valeur
> >
> > > > > absolue inférieure à 10^2.
> >
> > > > > I thought that the validator will show up a error...
> >
> > > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> > > decimal
> > > > > limit in the model???
> >
> > > > > Regards.
> >
> > > > > Richard
> >
> >
> 




[web2py] Re: Validate dynamically generated select SQLFORM.factory

2010-11-17 Thread Kostas M
At first thanks villas for the correction of the boolean 'multiple'
argument.

DenesL I agree that "multiple should mean 1 or more, not zero or
more."

Making though the following test:

>>> IS_IN_SET(['max', 'john'])('')
('', 'value not allowed')
>>> IS_IN_SET(['max', 'john'], multiple=True)('')
([], None)

seems that the zero option strangely is allowed for the multiple case.

According to: 
http://www.web2py.com/examples/static/epydoc/web2py.gluon.validators.IS_IN_SET-class.html#__call__
this is due to lines:
 327  if self.multiple and (value == None or value ==
''):
 328  return ([], None)

I think should return (value, self.error_message), as is the case for
multiple=False

>
> Because multiple is not False, but I am not sure about the logic.
> No selection should still fail because it is not in the set,
> i.e. multiple should mean 1 or more, not zero or more.
>


Re: [web2py] Re: How may I revoked a user logged in "server side"

2010-11-17 Thread Richard Vézina
Forgot about this one... My error cause of mixup between dev db and prod
db... ;-D

Richard

On Wed, Nov 17, 2010 at 11:50 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> Hello,
>
> I note that "blocked" in registration_key not prevent the user to login
> under 1.88.2...
>
> Is the keyword for that task as change??
>
> Richard
>
>
> On Thu, Aug 26, 2010 at 2:27 PM, mdipierro wrote:
>
>> What Thadeus suggests forces the user to logout.
>>
>> Before you do that you may also want to use appadmin and write
>> "blocked" in their registration key. This will prevent them from
>> logging in again.
>>
>> On Aug 26, 11:58 am, Thadeus Burgess  wrote:
>> > Two ways, delete their session file... unless you know their IP it
>> > might be hard to find the right one, so if its ok just delete them
>> > all.
>> >
>> > The other way is a design thing. Add a column to the auth_user table
>> > that says "force_logout" that is a boolean type. If you just flag that
>> > to true, make the login mechanism sign them out and require them to
>> > sign back in.
>> >
>> > --
>> > Thadeus
>> >
>> > On Thu, Aug 26, 2010 at 11:41 AM, Jean-Guy  wrote:
>> > >  Hello,
>> >
>> > > I would like to know how may I revoked a user logged in "server side"?
>> >
>> > > Can I just edit app/sessions/file... And comment appropriate line?
>> >
>> > > Which lines are the appropriate lines? ;-)
>> >
>> > > Jonhy
>>
>
>


[web2py] Easy to do using executesql, how to achieve with DAL?

2010-11-17 Thread Lorin Rivers
executesql('select min(reqtime) from data_table;')
-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
Doesn't neither with IS_DECIMAL_IN_RANGE(0,99), I get the same ticket...

Richard

On Wed, Nov 17, 2010 at 12:24 PM, villas  wrote:

> Sorry I misunderstood. I think you are right, web2py doesn't validate
> it.
> -D
>
> On Nov 17, 5:00 pm, Richard Vézina 
> wrote:
> > I don't want to store 123.123, I want 99.99 max.
> >
> > The problem is that no validator is triggered when entering 123.123...
> >
> > Richard
> >
> > On Wed, Nov 17, 2010 at 11:53 AM, villas  wrote:
> > > Hi Richard
> >
> > > It might depend on the DB,  but I believe you would normally need at
> > > least decimal(5,2) to contain 123.456789
> > > With decimal(4,2) I think the max value would be 99.99...
> >
> > > Try it...  :)
> >
> > > -D
> >
> > > On Nov 17, 3:44 pm, Richard Vézina 
> > > wrote:
> > > > I forgot to precise that I am under 1.88.2
> >
> > > > Thanks
> >
> > > > On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
> >
> > > > ml.richard.vez...@gmail.com> wrote:
> > > > > Hello,
> >
> > > > > I wonder if it is normal that I get ticket in that case :
> >
> > > > > Model :
> >
> > > > > Field('field1','decimal(4,2)'),
> >
> > > > > If I insert in form generate with crud.create(db.table1) this value
> :
> > > > > 123.123
> >
> > > > > I get ticket :
> >
> > > > > Error traceback
> >
> > > > > 1.
> > > > > 2.
> >
> > > > > 3.
> > > > > 4.
> >
> > > > > 5.
> > > > > 6.
> >
> > > > > 7.
> > > > > 8.
> >
> > > > > 9.
> > > > > 10.
> >
> > > > > 11.
> > > > > 12.
> >
> > > > > 13.
> > > > > 14.
> >
> > > > > 15.
> > > > > 16.
> >
> > > > > 17.
> > > > > 18.
> >
> > > > > 19.
> > > > > 20.
> >
> > > > > 21.
> >
> > > > > Traceback (most recent call last):
> >
> > > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
> >
> > > > > exec ccode in environment
> >
> > > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> > > 
> >
> > > > >   File "/web2py/gluon/globals.py", line 96, in 
> >
> > > > > self._caller = lambda f: f()
> >
> > > > >   File "/web2py/gluon/tools.py", line 2270, in f
> >
> > > > > return action(*a, **b)
> >
> > > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> > > update
> >
> > > > > if form.accepts(request.vars, session):
> >
> > > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> >
> > > > > self.table._db(self.table.id == self.record.id
> ).update(**fields)
> >
> > > > >   File "/web2py/gluon/sql.py", line 3484, in update
> >
> > > > > self._db._execute(query)
> >
> > > > >   File "/web2py/gluon/sql.py", line 1026, in 
> >
> > > > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > > > DataError: ERREUR:  champ numérique en dehors des limites
> >
> > > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à
> une
> > > valeur
> >
> > > > > absolue inférieure à 10^2.
> >
> > > > > I thought that the validator will show up a error...
> >
> > > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> > > decimal
> > > > > limit in the model???
> >
> > > > > Regards.
> >
> > > > > Richard
> >
> >
>


[web2py] Re: decimal validator by default or not

2010-11-17 Thread villas
Sorry I misunderstood. I think you are right, web2py doesn't validate
it.
-D

On Nov 17, 5:00 pm, Richard Vézina 
wrote:
> I don't want to store 123.123, I want 99.99 max.
>
> The problem is that no validator is triggered when entering 123.123...
>
> Richard
>
> On Wed, Nov 17, 2010 at 11:53 AM, villas  wrote:
> > Hi Richard
>
> > It might depend on the DB,  but I believe you would normally need at
> > least decimal(5,2) to contain 123.456789
> > With decimal(4,2) I think the max value would be 99.99...
>
> > Try it...  :)
>
> > -D
>
> > On Nov 17, 3:44 pm, Richard Vézina 
> > wrote:
> > > I forgot to precise that I am under 1.88.2
>
> > > Thanks
>
> > > On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
>
> > > ml.richard.vez...@gmail.com> wrote:
> > > > Hello,
>
> > > > I wonder if it is normal that I get ticket in that case :
>
> > > > Model :
>
> > > > Field('field1','decimal(4,2)'),
>
> > > > If I insert in form generate with crud.create(db.table1) this value :
> > > > 123.123
>
> > > > I get ticket :
>
> > > > Error traceback
>
> > > > 1.
> > > > 2.
>
> > > > 3.
> > > > 4.
>
> > > > 5.
> > > > 6.
>
> > > > 7.
> > > > 8.
>
> > > > 9.
> > > > 10.
>
> > > > 11.
> > > > 12.
>
> > > > 13.
> > > > 14.
>
> > > > 15.
> > > > 16.
>
> > > > 17.
> > > > 18.
>
> > > > 19.
> > > > 20.
>
> > > > 21.
>
> > > > Traceback (most recent call last):
>
> > > >   File "/web2py/gluon/restricted.py", line 188, in restricted
>
> > > >     exec ccode in environment
>
> > > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> > 
>
> > > >   File "/web2py/gluon/globals.py", line 96, in 
>
> > > >     self._caller = lambda f: f()
>
> > > >   File "/web2py/gluon/tools.py", line 2270, in f
>
> > > >     return action(*a, **b)
>
> > > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> > update
>
> > > >     if form.accepts(request.vars, session):
>
> > > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>
> > > >     self.table._db(self.table.id == self.record.id).update(**fields)
>
> > > >   File "/web2py/gluon/sql.py", line 3484, in update
>
> > > >     self._db._execute(query)
>
> > > >   File "/web2py/gluon/sql.py", line 1026, in 
>
> > > >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > > DataError: ERREUR:  champ numérique en dehors des limites
>
> > > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une
> > valeur
>
> > > > absolue inférieure à 10^2.
>
> > > > I thought that the validator will show up a error...
>
> > > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> > decimal
> > > > limit in the model???
>
> > > > Regards.
>
> > > > Richard
>
>


[web2py] Re: crud operations for joins?

2010-11-17 Thread villas
Hi Carlos,

See what you mean.  We don't usually use 1:1 relationships,  but 1 to
many.

e.g. From the book:

db.define_table('person',
Field('name'),
format='%(name)s')

db.define_table('dog',
Field('name'),
Field('owner', db.person),
format='%(name)s')

Of course an owner might only have one dog to start with, but then
acquire others later, so this model serves for any number of dogs,
incl. zero.

The same owner might also decide to keep a cat and (assuming he needs
to keep different data on that) he would simply define a 'cat' table
later with a similar realtionship.

I suppose if you insisted on making it 1:1,  I might simply suggest
making the dog.owner field into a unique index which would prevent
your adding more than 1.

-D


On Nov 17, 3:44 pm, Carlos  wrote:
> Thanks villas and Ivan.
>
> When I say joins I mean 1:1 relationships (or "linked tables"?), where
> each record in tables A/B/C reference one (and only one) unique
> 'entity' record, kind of like an 'extension' of such tables, but with
> data centralized in the 'entity' table (which would allow better
> maintenance).
>
> I know I have the alternative of embedding all of the 'entity' fields
> directly into tables A/B/C (instead of having a separate centralized
> 'entity' table, with 1:1 relationships).
>
> I was wondering what would be the best approach for this in the
> relational world?.
>
> And if a separate 'entity' table is the best option, then I guess I
> can use the following slice to create (and update?) records with
> linked tables:
>
> http://www.web2pyslices.com/main/slices/take_slice/102
>
> Thanks for your recommendations.
>
> p.s. I have certainly already read the entire book :-)
>
>    Carlos
>
> On Nov 17, 9:06 am, Ivan Matveev  wrote:
>
> > >>  I have a 'central' table in my design called 'entity'
> > >> which contains lots of data (including names, company, emails, phones,
> > >> address, etc.) and I want many other tables to point to ONE entity
> > >> instance, i.e. 'entity' as an _extension_ of records in many different
> > >> tables.
>
> > When you say 'joined tables' do you mean
> > SELECT tabl1.some_col, tabl2.other_col FROM tabl1 LEFT JOIN tabl2 ON .
> > or something else?
>
> > I don't know a web2py component that can be used to edit a result of a
> > joined select.
>
> > If your 'entity' table includes all fields you want to present to a
> > user you can avoid joins by use of references. I don't use db
> > references myself. I think usage can look like this:
>
> > db.define_table('names', Field('name', 'string'))
> > db.define_table('companies', Field('company', 'string'))
>
> > db.define_table('entity',
> >     Field('name', db.names.name),
> >     Field('company', db.companies.company))
>
> > also you can alter the way a field is represented with .represent and
> > .requires methods
>
> > The details are in documentation on Database Abstraction 
> > Layer(DAL)http://www.web2py.com/book/default/chapter/06
>
> > SQLFORM allows to edit a row in a table which is fine if you have all
> > fields in 'entity' table.
>
> > If your 'entity' table contains references to rows in other tables you
> > will need SELECT...JOIN...
> > To edit its result  you will have to make a page with multiple
> > SQLFORMs to edit individual rows in tables ' entity' refers  to , or
> > make a custom form with SQLFORM.factory, or invent something.
>
> > >> My background is with object databases, and this kind of design makes
> > >> sense, although I'm not sure if it makes sense with relation
> > >> databases?.
>
> > It's pretty common to store an object information in a relation db as
> > a set of tables.
>
>


Re: [web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
I don't want to store 123.123, I want 99.99 max.

The problem is that no validator is triggered when entering 123.123...

Richard

On Wed, Nov 17, 2010 at 11:53 AM, villas  wrote:

> Hi Richard
>
> It might depend on the DB,  but I believe you would normally need at
> least decimal(5,2) to contain 123.456789
> With decimal(4,2) I think the max value would be 99.99...
>
> Try it...  :)
>
> -D
>
>
> On Nov 17, 3:44 pm, Richard Vézina 
> wrote:
> > I forgot to precise that I am under 1.88.2
> >
> > Thanks
> >
> > On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
> >
> > ml.richard.vez...@gmail.com> wrote:
> > > Hello,
> >
> > > I wonder if it is normal that I get ticket in that case :
> >
> > > Model :
> >
> > > Field('field1','decimal(4,2)'),
> >
> > > If I insert in form generate with crud.create(db.table1) this value :
> > > 123.123
> >
> > > I get ticket :
> >
> > > Error traceback
> >
> > > 1.
> > > 2.
> >
> > > 3.
> > > 4.
> >
> > > 5.
> > > 6.
> >
> > > 7.
> > > 8.
> >
> > > 9.
> > > 10.
> >
> > > 11.
> > > 12.
> >
> > > 13.
> > > 14.
> >
> > > 15.
> > > 16.
> >
> > > 17.
> > > 18.
> >
> > > 19.
> > > 20.
> >
> > > 21.
> >
> > > Traceback (most recent call last):
> >
> > >   File "/web2py/gluon/restricted.py", line 188, in restricted
> >
> > > exec ccode in environment
> >
> > >   File "/web2py/applications/app/controllers/test.py", line 552, in
> 
> >
> > >   File "/web2py/gluon/globals.py", line 96, in 
> >
> > > self._caller = lambda f: f()
> >
> > >   File "/web2py/gluon/tools.py", line 2270, in f
> >
> > > return action(*a, **b)
> >
> > >   File "/web2py/applications/app/controllers/test.py", line 372, in
> update
> >
> > > if form.accepts(request.vars, session):
> >
> > >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
> >
> > > self.table._db(self.table.id == self.record.id).update(**fields)
> >
> > >   File "/web2py/gluon/sql.py", line 3484, in update
> >
> > > self._db._execute(query)
> >
> > >   File "/web2py/gluon/sql.py", line 1026, in 
> >
> > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > > DataError: ERREUR:  champ numérique en dehors des limites
> >
> > > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une
> valeur
> >
> > > absolue inférieure à 10^2.
> >
> > > I thought that the validator will show up a error...
> >
> > > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the
> decimal
> > > limit in the model???
> >
> > > Regards.
> >
> > > Richard
> >
> >
>


[web2py] Re: decimal validator by default or not

2010-11-17 Thread villas
Hi Richard

It might depend on the DB,  but I believe you would normally need at
least decimal(5,2) to contain 123.456789
With decimal(4,2) I think the max value would be 99.99...

Try it...  :)

-D


On Nov 17, 3:44 pm, Richard Vézina 
wrote:
> I forgot to precise that I am under 1.88.2
>
> Thanks
>
> On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
>
> ml.richard.vez...@gmail.com> wrote:
> > Hello,
>
> > I wonder if it is normal that I get ticket in that case :
>
> > Model :
>
> > Field('field1','decimal(4,2)'),
>
> > If I insert in form generate with crud.create(db.table1) this value :
> > 123.123
>
> > I get ticket :
>
> > Error traceback
>
> > 1.
> > 2.
>
> > 3.
> > 4.
>
> > 5.
> > 6.
>
> > 7.
> > 8.
>
> > 9.
> > 10.
>
> > 11.
> > 12.
>
> > 13.
> > 14.
>
> > 15.
> > 16.
>
> > 17.
> > 18.
>
> > 19.
> > 20.
>
> > 21.
>
> > Traceback (most recent call last):
>
> >   File "/web2py/gluon/restricted.py", line 188, in restricted
>
> >     exec ccode in environment
>
> >   File "/web2py/applications/app/controllers/test.py", line 552, in 
>
> >   File "/web2py/gluon/globals.py", line 96, in 
>
> >     self._caller = lambda f: f()
>
> >   File "/web2py/gluon/tools.py", line 2270, in f
>
> >     return action(*a, **b)
>
> >   File "/web2py/applications/app/controllers/test.py", line 372, in update
>
> >     if form.accepts(request.vars, session):
>
> >   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>
> >     self.table._db(self.table.id == self.record.id).update(**fields)
>
> >   File "/web2py/gluon/sql.py", line 3484, in update
>
> >     self._db._execute(query)
>
> >   File "/web2py/gluon/sql.py", line 1026, in 
>
> >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > DataError: ERREUR:  champ numérique en dehors des limites
>
> > DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une 
> > valeur
>
> > absolue inférieure à 10^2.
>
> > I thought that the validator will show up a error...
>
> > Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> > limit in the model???
>
> > Regards.
>
> > Richard
>
>


Re: [web2py] Re: How may I revoked a user logged in "server side"

2010-11-17 Thread Richard Vézina
Hello,

I note that "blocked" in registration_key not prevent the user to login
under 1.88.2...

Is the keyword for that task as change??

Richard

On Thu, Aug 26, 2010 at 2:27 PM, mdipierro  wrote:

> What Thadeus suggests forces the user to logout.
>
> Before you do that you may also want to use appadmin and write
> "blocked" in their registration key. This will prevent them from
> logging in again.
>
> On Aug 26, 11:58 am, Thadeus Burgess  wrote:
> > Two ways, delete their session file... unless you know their IP it
> > might be hard to find the right one, so if its ok just delete them
> > all.
> >
> > The other way is a design thing. Add a column to the auth_user table
> > that says "force_logout" that is a boolean type. If you just flag that
> > to true, make the login mechanism sign them out and require them to
> > sign back in.
> >
> > --
> > Thadeus
> >
> > On Thu, Aug 26, 2010 at 11:41 AM, Jean-Guy  wrote:
> > >  Hello,
> >
> > > I would like to know how may I revoked a user logged in "server side"?
> >
> > > Can I just edit app/sessions/file... And comment appropriate line?
> >
> > > Which lines are the appropriate lines? ;-)
> >
> > > Jonhy
>


[web2py] Re:

2010-11-17 Thread villas
Hi Napolean

I have looked at your app and I did not understand it very well,  but
I hope you don't mind that I will try to give you some advice anyway
(even though it might not be so useful!).

It seems that you are going from one view to another without a good
way of passing the ids.  For example you are doing this:

  referencia_id = session.referencia_id

Why not use the url and pick up the id with request.args(0)?

How do you find the patient info again? Why not try something like
this in your form...

   record = db.table(request.args(0)) or redirect(URL('index'))

The general advice I would give you is:

1. Try to it working in one controller and view first of all. You can
display more than one form in the view. Keep self-submitting the form
to the same controller until you see what you expect.

2. Either use the url to pass the id,  or place as a hidden field on
your forms -- see the book.

3. Use SQLFORM instead of crud whenever things start looking
complex.

4. Test the variables in your controller. e.g. try putting: print '--
whatever-here--' in your controller and then check the value on the
web2py commandline.

5. Once you have everyone working,  you can then figure out the best
UI.  You do not necessarily need to split everything across different
views. You could try for example using jQuery to show and hide forms
when you need them.

Finally, just a small point, take out 'welcome' from all the menu.py
links.  It is not necessary and it will make things easier for you
when you rename the app.

I am sure that everyone in the group would love to give detailed
advice when they can, and others may tell you more,  but quite
honestly it is too much to ask that people will find enough time to
download, review and debug entire apps for you, (please do not be
offended, I am just stating a fact!).

Best wishes,  David


On Nov 17, 2:24 pm, Napoleon Moreno  wrote:
> I am sorry for insist in this but it is driving me crazy.
>
> If i can not use a join in GAE. How can i show the name of 'diagnostico'
> table in an webgrid base on 'diagnostico_referencia' table. I tried with
> webgrid and crud and it always show me the id's of the
> 'diagnostico_referencia' table.
>
> Any advice about it?
>
> On Wed, Nov 17, 2010 at 6:57 AM, Napoleon Moreno wrote:
>
> > Good day
>
> > The webgrid is showing the fields of 'diagnostico_referencia' table. I need
> > that it shows the name field of the 'Diagnostico' table. I can not find a
> > way to do it. It suppose to be used in GAE.
>
> > Any advice about it
> > Thanks a lot for your help
>
> > On Wed, Nov 17, 2010 at 6:52 AM, Napoleon Moreno 
> > wrote:
>
> >> Hi Villas
>
> >> It is that i need.  Apparently there is not a way to do it with a crud. I
> >> could use  a sqlform.
>
> >> Thanks!
>
> >> On Mon, Nov 15, 2010 at 7:16 PM, villas  wrote:
>
> >>> Hi,
> >>> I'm not sure,  but I think Napoleon wants to save the id key of the
> >>> 'master table' into the master_id field of the 'detail' table.
> >>> I'm not sure how it works with crud.  I would suggest that you use
> >>> SQLFORM and set the field after form.accepts.  Take a look at this
> >>> link:
>
> >>>http://www.web2pyslices.com/main/slices/take_slice/102
>
> >>> This is a short-cut way of linking tables, but notice how the id is
> >>> set.
> >>> Hope this helps.
> >>> -D
>
> >>> On Nov 15, 11:49 pm, "mr.freeze"  wrote:
> >>> > Sorry, I don't fully understand. You can email your app (with any
> >>> > personal data removed) and I will take a closer look.
>
> >>> > On Nov 15, 5:02 pm, Napoleon Moreno  wrote:
>
> >>> > > I am doing that. but  the crud form does not the key value from the
> >>> master
> >>> > > table. ( or master page ). The user has to input the referencia value
> >>> in the
> >>> > > crud page.
>
> >>> > > db.define_table('referencia',
> >>> > >     Field('fecha_remision','
>
> >>> > > > datetime')
> >>> > > > )
>
> >>> > > > db.define_table('diagnostico_referencia',
> >>> > > >     Field('diagnostico',db.diagnostico),
> >>> > > >     Field('referencia',db.referencia)
> >>> > > >     )
>
> >>> > > > in the controler
> >>> > > >    
>
> >>> > > >     grid = webgrid.WebGrid(crud)
> >>> > > >     grid.enabled_rows = ['add_links']
> >>> > > >     grid.action_links = ['delete']
> >>> > > >     grid.action_headers = []
> >>> > > >     grid.crud_function = 'diagnostico_referencia'
>
> >>> > > >    crud.settings.controller = 'default'
> >>> > > >    grid.datasource =
> >>> > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
> >>> > > >     return dict(form=form, grid=grid(),referencia=referencia_id)
>
> >>> > > > def diagnostico_referencia():
> >>> > > >     crud.settings[request.args(0)+'_next'] =
> >>> URL(r=request,f='referencia')
> >>> > > >     return dict(form=crud())
>
> >>> > > > Is it posible that the form in diagnostico_referencia  get the
> >>> > > > referencia.id value from the controler in the addition form?
>
> >>> > > On Mon, Nov 15, 2010 at 5:59 PM, Napoleon Moreno <
> 

Re: [web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread Branko Vukelic
On Wed, Nov 17, 2010 at 4:22 PM, mdipierro  wrote:
> You can sign up. I will approve those people who I recognize as
> contributors and/or have proven skills by deploying a web2py
> application. After we reach ~50 people new members will have to be
> endorsed by 5 existing members to be approved.

Aaaand, we'll have to do something about that list of experts. Maybe a
searchable paged list? Anyway, it's getting longer and longer.


-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


Re: [web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread António Ramos
AHH, found a big problem!
I need to create a table with 940 fields and web2py complains that it is
over 255

What to do to resolve this? i dont want to partition my table because the
record realy has 940 fields in my database (Lotus Notes) that i want to
migrate to web2py.
António

2010/11/17 Anthony 

> Are you talking about this:
>
> http://web2pyople.appspot.com/
>
>
> On Nov 17, 10:46 am, appydev  wrote:
> > Excellent. Thanks for responding.
> >
> > A much changed. I remember an application that was made just for the map
> of
> > the "experts." And since I'm beginner, I wanted to see the application to
> > learn, remember being hosted on Google App Engine.
> >
> > 2010/11/17 mdipierro 
> >
> >
> >
> > > we are taking a different approach
> >
> > >  https://experts4solutions.com
> >
> > > You can sign up. I will approve those people who I recognize as
> > > contributors and/or have proven skills by deploying a web2py
> > > application. After we reach ~50 people new members will have to be
> > > endorsed by 5 existing members to be approved.
> >
> > > If you have already signed up but your name is not listed (not
> > > approved) but you feel you deserve it, please email me and explain
> > > why. It is possible I did not recognize your name.
> >
> > > Massimo
> >
> > > On Nov 17, 9:07 am, appydev  wrote:
> > > > Greetings to everyone.
> >
> > > > I recently read about an application developed with web2py like
> "Django
> > > > People" I get to test it and I read about some suggestions from
> Massimo.
> >
> > > > I've been looking but can not find it. Anyone remember it?- Hide
> quoted text -
> >
> > - Show quoted text -


Re: [web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread appydev
Thank you very much Anthony, I spend part of the morning trying to find in
the search of the group without any results. with queries like "django clone
people." Is rare.

Thank you very much again.

2010/11/17 Anthony 

> Also, there's this one (a little older):
>
> http://www.appenginepeople.net/users/tag/web2py/
>
> Discussed here:
>
> http://groups.google.com/group/web2py/browse_frm/thread/668fade78f5c3d79
>
> and here:
>
> http://groups.google.com/group/web2py/browse_frm/thread/aa692ce9bc9c572e
>
> On Nov 17, 10:57 am, Anthony  wrote:
> > Are you talking about this:
> >
> > http://web2pyople.appspot.com/
> >
> > On Nov 17, 10:46 am, appydev  wrote:
> >
> >
> >
> > > Excellent. Thanks for responding.
> >
> > > A much changed. I remember an application that was made just for the
> map of
> > > the "experts." And since I'm beginner, I wanted to see the application
> to
> > > learn, remember being hosted on Google App Engine.
> >
> > > 2010/11/17 mdipierro 
> >
> > > > we are taking a different approach
> >
> > > >  https://experts4solutions.com
> >
> > > > You can sign up. I will approve those people who I recognize as
> > > > contributors and/or have proven skills by deploying a web2py
> > > > application. After we reach ~50 people new members will have to be
> > > > endorsed by 5 existing members to be approved.
> >
> > > > If you have already signed up but your name is not listed (not
> > > > approved) but you feel you deserve it, please email me and explain
> > > > why. It is possible I did not recognize your name.
> >
> > > > Massimo
> >
> > > > On Nov 17, 9:07 am, appydev  wrote:
> > > > > Greetings to everyone.
> >
> > > > > I recently read about an application developed with web2py like
> "Django
> > > > > People" I get to test it and I read about some suggestions from
> Massimo.
> >
> > > > > I've been looking but can not find it. Anyone remember it?- Hide
> quoted text -
> >
> > > - Show quoted text -- Hide quoted text -
> >
> > - Show quoted text -


[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread Anthony
Also, there's this one (a little older):

http://www.appenginepeople.net/users/tag/web2py/

Discussed here:

http://groups.google.com/group/web2py/browse_frm/thread/668fade78f5c3d79

and here:

http://groups.google.com/group/web2py/browse_frm/thread/aa692ce9bc9c572e

On Nov 17, 10:57 am, Anthony  wrote:
> Are you talking about this:
>
> http://web2pyople.appspot.com/
>
> On Nov 17, 10:46 am, appydev  wrote:
>
>
>
> > Excellent. Thanks for responding.
>
> > A much changed. I remember an application that was made just for the map of
> > the "experts." And since I'm beginner, I wanted to see the application to
> > learn, remember being hosted on Google App Engine.
>
> > 2010/11/17 mdipierro 
>
> > > we are taking a different approach
>
> > >  https://experts4solutions.com
>
> > > You can sign up. I will approve those people who I recognize as
> > > contributors and/or have proven skills by deploying a web2py
> > > application. After we reach ~50 people new members will have to be
> > > endorsed by 5 existing members to be approved.
>
> > > If you have already signed up but your name is not listed (not
> > > approved) but you feel you deserve it, please email me and explain
> > > why. It is possible I did not recognize your name.
>
> > > Massimo
>
> > > On Nov 17, 9:07 am, appydev  wrote:
> > > > Greetings to everyone.
>
> > > > I recently read about an application developed with web2py like "Django
> > > > People" I get to test it and I read about some suggestions from Massimo.
>
> > > > I've been looking but can not find it. Anyone remember it?- Hide quoted 
> > > > text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


Re: [web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread appydev
Yes! Thanks Anthony.


2010/11/17 Anthony 

> Are you talking about this:
>
> http://web2pyople.appspot.com/
>
>
> On Nov 17, 10:46 am, appydev  wrote:
> > Excellent. Thanks for responding.
> >
> > A much changed. I remember an application that was made just for the map
> of
> > the "experts." And since I'm beginner, I wanted to see the application to
> > learn, remember being hosted on Google App Engine.
> >
> > 2010/11/17 mdipierro 
> >
> >
> >
> > > we are taking a different approach
> >
> > >  https://experts4solutions.com
> >
> > > You can sign up. I will approve those people who I recognize as
> > > contributors and/or have proven skills by deploying a web2py
> > > application. After we reach ~50 people new members will have to be
> > > endorsed by 5 existing members to be approved.
> >
> > > If you have already signed up but your name is not listed (not
> > > approved) but you feel you deserve it, please email me and explain
> > > why. It is possible I did not recognize your name.
> >
> > > Massimo
> >
> > > On Nov 17, 9:07 am, appydev  wrote:
> > > > Greetings to everyone.
> >
> > > > I recently read about an application developed with web2py like
> "Django
> > > > People" I get to test it and I read about some suggestions from
> Massimo.
> >
> > > > I've been looking but can not find it. Anyone remember it?- Hide
> quoted text -
> >
> > - Show quoted text -


[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread Anthony
Are you talking about this:

http://web2pyople.appspot.com/


On Nov 17, 10:46 am, appydev  wrote:
> Excellent. Thanks for responding.
>
> A much changed. I remember an application that was made just for the map of
> the "experts." And since I'm beginner, I wanted to see the application to
> learn, remember being hosted on Google App Engine.
>
> 2010/11/17 mdipierro 
>
>
>
> > we are taking a different approach
>
> >  https://experts4solutions.com
>
> > You can sign up. I will approve those people who I recognize as
> > contributors and/or have proven skills by deploying a web2py
> > application. After we reach ~50 people new members will have to be
> > endorsed by 5 existing members to be approved.
>
> > If you have already signed up but your name is not listed (not
> > approved) but you feel you deserve it, please email me and explain
> > why. It is possible I did not recognize your name.
>
> > Massimo
>
> > On Nov 17, 9:07 am, appydev  wrote:
> > > Greetings to everyone.
>
> > > I recently read about an application developed with web2py like "Django
> > > People" I get to test it and I read about some suggestions from Massimo.
>
> > > I've been looking but can not find it. Anyone remember it?- Hide quoted 
> > > text -
>
> - Show quoted text -


Re: [web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread appydev
Excellent. Thanks for responding.

A much changed. I remember an application that was made just for the map of
the "experts." And since I'm beginner, I wanted to see the application to
learn, remember being hosted on Google App Engine.


2010/11/17 mdipierro 

> we are taking a different approach
>
>   https://experts4solutions.com
>
> You can sign up. I will approve those people who I recognize as
> contributors and/or have proven skills by deploying a web2py
> application. After we reach ~50 people new members will have to be
> endorsed by 5 existing members to be approved.
>
> If you have already signed up but your name is not listed (not
> approved) but you feel you deserve it, please email me and explain
> why. It is possible I did not recognize your name.
>
> Massimo
>
> On Nov 17, 9:07 am, appydev  wrote:
> > Greetings to everyone.
> >
> > I recently read about an application developed with web2py like "Django
> > People" I get to test it and I read about some suggestions from Massimo.
> >
> > I've been looking but can not find it. Anyone remember it?
>


[web2py] Re: decimal validator by default or not

2010-11-17 Thread Richard Vézina
I forgot to precise that I am under 1.88.2

Thanks

On Wed, Nov 17, 2010 at 10:43 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> Hello,
>
> I wonder if it is normal that I get ticket in that case :
>
> Model :
>
> Field('field1','decimal(4,2)'),
>
>
> If I insert in form generate with crud.create(db.table1) this value :
> 123.123
>
> I get ticket :
>
> Error traceback
>
> 1.
> 2.
>
> 3.
> 4.
>
> 5.
> 6.
>
> 7.
> 8.
>
> 9.
> 10.
>
> 11.
> 12.
>
> 13.
> 14.
>
> 15.
> 16.
>
> 17.
> 18.
>
> 19.
> 20.
>
> 21.
>
> Traceback (most recent call last):
>
>   File "/web2py/gluon/restricted.py", line 188, in restricted
>
> exec ccode in environment
>
>   File "/web2py/applications/app/controllers/test.py", line 552, in 
>
>   File "/web2py/gluon/globals.py", line 96, in 
>
> self._caller = lambda f: f()
>
>   File "/web2py/gluon/tools.py", line 2270, in f
>
> return action(*a, **b)
>
>   File "/web2py/applications/app/controllers/test.py", line 372, in update
>
> if form.accepts(request.vars, session):
>
>   File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
>
> self.table._db(self.table.id == self.record.id).update(**fields)
>
>   File "/web2py/gluon/sql.py", line 3484, in update
>
> self._db._execute(query)
>
>   File "/web2py/gluon/sql.py", line 1026, in 
>
> self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> DataError: ERREUR:  champ numérique en dehors des limites
>
> DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une valeur
>
> absolue inférieure à 10^2.
>
>
> I thought that the validator will show up a error...
>
> Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
> limit in the model???
>
> Regards.
>
> Richard
>


[web2py] Re: crud operations for joins?

2010-11-17 Thread Carlos
Thanks villas and Ivan.

When I say joins I mean 1:1 relationships (or "linked tables"?), where
each record in tables A/B/C reference one (and only one) unique
'entity' record, kind of like an 'extension' of such tables, but with
data centralized in the 'entity' table (which would allow better
maintenance).

I know I have the alternative of embedding all of the 'entity' fields
directly into tables A/B/C (instead of having a separate centralized
'entity' table, with 1:1 relationships).

I was wondering what would be the best approach for this in the
relational world?.

And if a separate 'entity' table is the best option, then I guess I
can use the following slice to create (and update?) records with
linked tables:

http://www.web2pyslices.com/main/slices/take_slice/102

Thanks for your recommendations.

p.s. I have certainly already read the entire book :-)

   Carlos



On Nov 17, 9:06 am, Ivan Matveev  wrote:
> >>  I have a 'central' table in my design called 'entity'
> >> which contains lots of data (including names, company, emails, phones,
> >> address, etc.) and I want many other tables to point to ONE entity
> >> instance, i.e. 'entity' as an _extension_ of records in many different
> >> tables.
>
> When you say 'joined tables' do you mean
> SELECT tabl1.some_col, tabl2.other_col FROM tabl1 LEFT JOIN tabl2 ON .
> or something else?
>
> I don't know a web2py component that can be used to edit a result of a
> joined select.
>
> If your 'entity' table includes all fields you want to present to a
> user you can avoid joins by use of references. I don't use db
> references myself. I think usage can look like this:
>
> db.define_table('names', Field('name', 'string'))
> db.define_table('companies', Field('company', 'string'))
>
> db.define_table('entity',
>     Field('name', db.names.name),
>     Field('company', db.companies.company))
>
> also you can alter the way a field is represented with .represent and
> .requires methods
>
> The details are in documentation on Database Abstraction 
> Layer(DAL)http://www.web2py.com/book/default/chapter/06
>
> SQLFORM allows to edit a row in a table which is fine if you have all
> fields in 'entity' table.
>
> If your 'entity' table contains references to rows in other tables you
> will need SELECT...JOIN...
> To edit its result  you will have to make a page with multiple
> SQLFORMs to edit individual rows in tables ' entity' refers  to , or
> make a custom form with SQLFORM.factory, or invent something.
>
> >> My background is with object databases, and this kind of design makes
> >> sense, although I'm not sure if it makes sense with relation
> >> databases?.
>
> It's pretty common to store an object information in a relation db as
> a set of tables.


[web2py] decimal validator by default or not

2010-11-17 Thread Richard Vézina
Hello,

I wonder if it is normal that I get ticket in that case :

Model :

Field('field1','decimal(4,2)'),


If I insert in form generate with crud.create(db.table1) this value :
123.123

I get ticket :

Error traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.

Traceback (most recent call last):
  File "/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
  File "/web2py/applications/app/controllers/test.py", line 552, in 
  File "/web2py/gluon/globals.py", line 96, in 
self._caller = lambda f: f()
  File "/web2py/gluon/tools.py", line 2270, in f
return action(*a, **b)
  File "/web2py/applications/app/controllers/test.py", line 372, in update
if form.accepts(request.vars, session):
  File "/web2py/gluon/sqlhtml.py", line 1144, in accepts
self.table._db(self.table.id == self.record.id).update(**fields)
  File "/web2py/gluon/sql.py", line 3484, in update
self._db._execute(query)
  File "/web2py/gluon/sql.py", line 1026, in 
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
DataError: ERREUR:  champ numérique en dehors des limites
DETAIL:  Un champ de précision 4 et d'échelle 2 doit être arrondi à une valeur
absolue inférieure à 10^2.


I thought that the validator will show up a error...

Do I have to use IS_DECIMAL_IN_RANGE and why since I precised the decimal
limit in the model???

Regards.

Richard


[web2py] Re: migrate existing GAE list fields to new web2py list types

2010-11-17 Thread howesc
hmmm, i made the changes you suggested, but now that the field type is
'list:reference' GAE throws:

  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/ext/db/__init__.py", line 3016, in validate
raise BadValueError('Property %s must be a list' % self.name)
BadValueError: Property media must be a list

on existing fields.  we must be telling GAE to enforce the list type.
I do want to be able to take advantage of the lists, so i guess i'll
have to do the data transformation anyway.

cfh

On Nov 17, 6:47 am, mdipierro  wrote:
> replace
>
> Field('media', 'string', length=2048,
>           requires=IS_IN_DB(db, db.media.id, '%(url)s',
> multiple=True)),
>
> with
>
> Field('media', 'list:reference media', length=2048)
>
> and
>
> in db.define_table('media',...) add format='%(url)s'
>
> Massimo
>
> On Nov 17, 2:01 am, howesc  wrote:
>
> > i upgraded from 1.74.5 to 1.88.2 (so a little bit out of date as of
> > this week).
>
> > an example model with the problem is below.  the media field is the
> > problem.
>
> > db.define_table('song',
> >     #...@todo: add proper requires for each field
> >     Field('duration', 'integer',
> >           requires=IS_NULL_OR(IS_INT_IN_RANGE(0,36001))),
> >     Field('last_modified', 'datetime', default=now, update=now),
> >     Field('title', 'string', length=256, requires=IS_NOT_EMPTY()),
> >     Field('artist', 'string', length=256,
> >           requires=IS_IN_DB(db, db.artist.name, '%(name)s')),
> >     Field('genre', 'string',
> >           requires=IS_IN_DB(db, db.genre.name, '%(name)s')),
> >     Field('song_key', 'string',
> >           requires=IS_NULL_OR(IS_IN_DB(db, db.song_key.name, '%
> > (name)s'))),
> >     Field('song_scale', 'string',
> >           requires=IS_NULL_OR(IS_IN_DB(db, db.song_scale.name, '%
> > (name)s'))),
> >     Field('publisher_song_code', 'string', length=100),
> >     Field('label', 'string',
> >           requires=IS_IN_DB(db, db.label.name, '%(name)s')),
> >     #...@todo: not sure that i like this string of ID's seperated by |
> >     Field('media', 'string', length=2048,
> >           requires=IS_IN_DB(db, db.media.id, '%(url)s',
> > multiple=True)),
> >     Field('isrc', 'string', length=12, unique=True),
> >     Field('orig_publish_year', 'integer',
> >           requires=IS_NULL_OR(IS_INT_IN_RANGE(1800, 2100))),
> >     Field('tempo', 'integer',
> >           requires=IS_NULL_OR(IS_INT_IN_RANGE(0, 250))),
> >     Field('written_by', 'string'),
> >     #...@todo: add optional parameters
> >     #keywords, description, status,thumbnail,name
> >     migrate=migrate)
>
> > thanks,
>
> > cfh
>
> > On Nov 16, 7:20 pm, mdipierro  wrote:
>
> > > Which version did you upgrade from?
> > > Can you show the model that causes problem?
>
> > > On Nov 16, 8:42 pm, howesc  wrote:
>
> > > > Hi all,
>
> > > > sorry if i missed the discussion on this, but i was just bitten by an
> > > > upgrade issue that i'm not sure the best way to solve.
>
> > > > i have an existing app running on the google app engine that uses
> > > > several String fields with IS_IN_DB(... multiple=True).  I upgraded
> > > > web2py and now those fields are not working properly (the forms don't
> > > > see the existing data, and then they update the field incorrectly
> > > > based on the old pipe-delimited string).  This is wrecking havoc in
> > > > the system.
>
> > > > as far as i can tell the best solution is:
> > > >  - change the field type to 'list:reference ' since they
> > > > are references
> > > >  - update my code that expects the pipe-delimited string and make it
> > > > expect a list of IDs (yea!!)
> > > >  - write a task that i can run in the GAE task-queue to query each row
> > > > (around 200,000 of them at least), parse the string, convert it to the
> > > > list, and write back the new entry.
>
> > > > is this correct?  has anyone else done this and have a better
> > > > suggestion?
>
> > > > thanks!
>
> > > > christian
>
>


[web2py] Re: Application developed with web2py like "Django People"

2010-11-17 Thread mdipierro
we are taking a different approach

   https://experts4solutions.com

You can sign up. I will approve those people who I recognize as
contributors and/or have proven skills by deploying a web2py
application. After we reach ~50 people new members will have to be
endorsed by 5 existing members to be approved.

If you have already signed up but your name is not listed (not
approved) but you feel you deserve it, please email me and explain
why. It is possible I did not recognize your name.

Massimo

On Nov 17, 9:07 am, appydev  wrote:
> Greetings to everyone.
>
> I recently read about an application developed with web2py like "Django
> People" I get to test it and I read about some suggestions from Massimo.
>
> I've been looking but can not find it. Anyone remember it?


Re: [web2py] Re:

2010-11-17 Thread Napoleon Moreno
I found the answer in the book , like is usual

db.define_table('diagnostico',
Field('name','string'),format='%(name)s'
)

It shows the name  in every place where i have the diagnostico.id. I got my
app running.

Thanks everybody!

On Wed, Nov 17, 2010 at 9:24 AM, Napoleon Moreno wrote:

> I am sorry for insist in this but it is driving me crazy.
>
> If i can not use a join in GAE. How can i show the name of 'diagnostico'
> table in an webgrid base on 'diagnostico_referencia' table. I tried with
> webgrid and crud and it always show me the id's of the
> 'diagnostico_referencia' table.
>
> Any advice about it?
>
>
>
> On Wed, Nov 17, 2010 at 6:57 AM, Napoleon Moreno wrote:
>
>> Good day
>>
>> The webgrid is showing the fields of 'diagnostico_referencia' table. I
>> need that it shows the name field of the 'Diagnostico' table. I can not find
>> a way to do it. It suppose to be used in GAE.
>>
>> Any advice about it
>> Thanks a lot for your help
>>
>>
>> On Wed, Nov 17, 2010 at 6:52 AM, Napoleon Moreno wrote:
>>
>>> Hi Villas
>>>
>>> It is that i need.  Apparently there is not a way to do it with a crud. I
>>> could use  a sqlform.
>>>
>>> Thanks!
>>>
>>>
>>> On Mon, Nov 15, 2010 at 7:16 PM, villas  wrote:
>>>
 Hi,
 I'm not sure,  but I think Napoleon wants to save the id key of the
 'master table' into the master_id field of the 'detail' table.
 I'm not sure how it works with crud.  I would suggest that you use
 SQLFORM and set the field after form.accepts.  Take a look at this
 link:

 http://www.web2pyslices.com/main/slices/take_slice/102

 This is a short-cut way of linking tables, but notice how the id is
 set.
 Hope this helps.
 -D

 On Nov 15, 11:49 pm, "mr.freeze"  wrote:
 > Sorry, I don't fully understand. You can email your app (with any
 > personal data removed) and I will take a closer look.
 >
 > On Nov 15, 5:02 pm, Napoleon Moreno  wrote:
 >
 > > I am doing that. but  the crud form does not the key value from the
 master
 > > table. ( or master page ). The user has to input the referencia
 value in the
 > > crud page.
 >
 > > db.define_table('referencia',
 > > Field('fecha_remision','
 >
 > > > datetime')
 > > > )
 >
 > > > db.define_table('diagnostico_referencia',
 > > > Field('diagnostico',db.diagnostico),
 > > > Field('referencia',db.referencia)
 > > > )
 >
 > > > in the controler
 > > >
 >
 > > > grid = webgrid.WebGrid(crud)
 > > > grid.enabled_rows = ['add_links']
 > > > grid.action_links = ['delete']
 > > > grid.action_headers = []
 > > > grid.crud_function = 'diagnostico_referencia'
 >
 > > >crud.settings.controller = 'default'
 > > >grid.datasource =
 > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
 > > > return dict(form=form, grid=grid(),referencia=referencia_id)
 >
 > > > def diagnostico_referencia():
 > > > crud.settings[request.args(0)+'_next'] =
 URL(r=request,f='referencia')
 > > > return dict(form=crud())
 >
 > > > Is it posible that the form in diagnostico_referencia  get the
 > > > referencia.id value from the controler in the addition form?
 >
 > > On Mon, Nov 15, 2010 at 5:59 PM, Napoleon Moreno <
 napoleo...@gmail.com>wrote:
 >
 > > > Thansk for your answer
 >
 > > > I am doing that. but  the crud form does not the key value from
 the master
 > > > table. ( or master page )
 >
 > > > This is my code
 >
 > > > db.define_table('referencia',
 > > > Field('fecha_remision','datetime')
 > > > )
 >
 > > > db.define_table('diagnostico_referencia',
 > > > Field('diagnostico',db.diagnostico),
 > > > Field('referencia',db.referencia)
 > > > )
 >
 > > > in the controler
 > > >
 >
 > > > grid = webgrid.WebGrid(crud)
 > > > grid.enabled_rows = ['add_links']
 > > > grid.action_links = ['delete']
 > > > grid.action_headers = []
 > > > grid.crud_function = 'diagnostico_referencia'
 >
 > > >crud.settings.controller = 'default'
 > > >grid.datasource =
 > > > db(db.diagnostico_referencia.referencia==referencia_id).select()
 > > > return dict(form=form, grid=grid(),referencia=referencia_id)
 >
 > > > def diagnostico_referencia():
 > > > crud.settings[request.args(0)+'_next'] =
 URL(r=request,f='referencia')
 > > > return dict(form=crud())
 >
 > > > Is it posible that the form in diagnostico_referencia  the
  referencia.idvalue from the controler in the addition form?
 >
 > > > On Mon, Nov 15, 2010 at 5:26 PM, mr.freeze 
 wrote:
 >
 > > >> You need to expose crud through a controller. In default.py, put
 this:
 >
 > 

[web2py] Re: crud.create(db.table) issues error ticket

2010-11-17 Thread annet
Hi Denes,

Thanks for your explanation. The mock app's behaviour made me worry
about my own app's behaviour, however, I chose a different approach,
and know I understand why I won't encounter this problem.


Kind regards,

Annet.


  1   2   >