[web2py] Re: Dream Host Deployment

2010-03-04 Thread rppowell
I use Dreamhost but I got things working with FastCGI.

I have documented the steps here: 
http://www.web2pyslices.com/main/slices/take_slice/68

This is not the best/only way to do it, but I got it working (and in a
sub-directory/sub-url too).
-rppowell

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: GAE delete() has subtle difference compared to native Web2Py

2010-03-04 Thread Throngly
Thanks!

I can confirm this is fixed in 1.76.3


On Mar 3, 11:28 am, mdipierro  wrote:
> I think this is now fixed in trunk.
>
> On Mar 3, 3:24 am, Throngly  wrote:
>
> > I also get this problem with code that used to work before the
> > ".count() to len()" change, so it appears to be a regression.
>
> > My traceback is as follows:
>
> > Traceback (most recent call last):
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/gluon/
> > restricted.py", line 173, in restricted
> > exec ccode in environment
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/
> > applications/throngly/controllers/events.py:delete", line 225, in
> > 
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/gluon/
> > globals.py", line 96, in 
> > self._caller = lambda f: f()
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/gluon/
> > tools.py", line 1850, in f
> > return action(*a, **b)
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/
> > applications/throngly/controllers/events.py:delete", line 80, in
> >delete
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/gluon/
> > contrib/gql.py", line 696, indelete
> > counter = len(items)
> > TypeError: object of type 'Query' has no len()
>
> > On Mar 1, 6:30 pm, mdipierro  wrote:
>
> > > Can you send me the complete traceback please. This is different than
> > > the error that strasted the thread (about count()).
>
> > > Massimo
>
> > > On Mar 1, 5:24 am, Richard  wrote:
>
> > > > when using appadmin forgaetodeleteall records that satisfy the
> > > > query "db.scrape.id>0" I get:
>
> > > > Invalid Query
>
> > > > object of type 'Query' has no len()
>
> > > > I get this with both the latest release and trunk.
>
> > > > On Mar 1, 12:09 am, mdipierro  wrote:
>
> > > > > they should be quivalent
>
> > > > > On Feb 23, 10:11 pm, Richard  wrote:
>
> > > > > > I sometimes get that ID error on bothGAEand the development server,
> > > > > > and for non-deleteoperations such as:
>
> > > > > > db(db.client.id > 0).select()
>
> > > > > > so to be more robust I have replaced ID calls with:
>
> > > > > > db().select(db.client.ALL)
>
> > > > > > On Feb 7, 11:33 am, Jon Romero  wrote:
>
> > > > > > > the problem seems to happen when you try to query by the id field 
> > > > > > > and
> > > > > > > thendelete(I coulddeletewhen I chose a different field)
>
> > > > > > > On Feb 7, 2:18 am, Jon Romero  wrote:
>
> > > > > > > > Some thing happens to me. When I do:
> > > > > > > > db(db.table.id == some_id_that_exists).delete, I get the same 
> > > > > > > > count
> > > > > > > > error
>
> > > > > > > > On Feb 4, 3:16 am, mdipierro  wrote:
>
> > > > > > > > > do you use 2.5 or something else locally?
>
> > > > > > > > > On Feb 3, 6:11 pm, Carl  wrote:
>
> > > > > > > > > > This may be related toGAEupdate_record() has subtle 
> > > > > > > > > > difference
> > > > > > > > > > compared to native 
> > > > > > > > > > Web2Pyhttp://groups.google.com/group/web2py/browse_thread/thread/a69afded01...
> > > > > > > > > > but until shown otherwise, I've posed separately.
>
> > > > > > > > > > I have this in db.py:
>
> > > > > > > > > > db.define_table('team_user',
> > > > > > > > > > Field('teamId', 'integer', notnull=True,
> > > > > > > > > > required=True),
> > > > > > > > > > Field('user_email', 'string', length=254,
> > > > > > > > > > notnull=True, required=True,
> > > > > > > > > >  requires = 
> > > > > > > > > > [IS_LOWER(),IS_EMAIL()]),
> > > > > > > > > > Field('live', 'boolean', notnull=True, 
> > > > > > > > > > required=True,
> > > > > > > > > > default='True'),
> > > > > > > > > > Field('cDate', 'datetime'),
> > > > > > > > > > Field('mDate', 'datetime'))
>
> > > > > > > > > > I make this call:
> > > > > > > > > > self.db(self.db.team_user.id==memberId).delete()
>
> > > > > > > > > > such a statement callsdelete(self) in gql.py
> > > > > > > > > > defdelete(self):
> > > > > > > > > > self._db['_lastsql'] = 'DELETEWHERE %s' % self.where
> > > > > > > > > > (items, tablename, fields) = self._select()
> > > > > > > > > > tableobj = self._db[tablename]._tableobj
> > > > > > > > > > counter = items.count()
> > > > > > > > > >gae.delete(items)
> > > > > > > > > > return counter - items.count()
>
> > > > > > > > > > When the interpreter exectutes "counter = items.count()" an 
> > > > > > > > > > exception
> > > > > > > > > > is thrown stating "TypeError: count() takes exactly one 
> > > > > > > > > > argument (0
> > > > > > > > > > given)"
>
> > > > > > > > > > Have I something in my db.py definition that native web2py 
> > > > > > > > > > is happy
> > > > > > > > > > with but dev_appserver chokes on?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@goog

[web2py] Re: GAE delete() has subtle difference compared to native Web2Py

2010-03-04 Thread Throngly
Thanks!

I can confirm this is fixed in 1.76.3


On Mar 3, 11:28 am, mdipierro  wrote:
> I think this is now fixed in trunk.
>
> On Mar 3, 3:24 am, Throngly  wrote:
>
> > I also get this problem with code that used to work before the
> > ".count() to len()" change, so it appears to be a regression.
>
> > My traceback is as follows:
>
> > Traceback (most recent call last):
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/gluon/
> > restricted.py", line 173, in restricted
> > exec ccode in environment
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/
> > applications/throngly/controllers/events.py:delete", line 225, in
> > 
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/gluon/
> > globals.py", line 96, in 
> > self._caller = lambda f: f()
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/gluon/
> > tools.py", line 1850, in f
> > return action(*a, **b)
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/
> > applications/throngly/controllers/events.py:delete", line 80, in
> >delete
> >   File "/base/data/home/apps/throngly-com/1.340262947933306301/gluon/
> > contrib/gql.py", line 696, indelete
> > counter = len(items)
> > TypeError: object of type 'Query' has no len()
>
> > On Mar 1, 6:30 pm, mdipierro  wrote:
>
> > > Can you send me the complete traceback please. This is different than
> > > the error that strasted the thread (about count()).
>
> > > Massimo
>
> > > On Mar 1, 5:24 am, Richard  wrote:
>
> > > > when using appadmin forgaetodeleteall records that satisfy the
> > > > query "db.scrape.id>0" I get:
>
> > > > Invalid Query
>
> > > > object of type 'Query' has no len()
>
> > > > I get this with both the latest release and trunk.
>
> > > > On Mar 1, 12:09 am, mdipierro  wrote:
>
> > > > > they should be quivalent
>
> > > > > On Feb 23, 10:11 pm, Richard  wrote:
>
> > > > > > I sometimes get that ID error on bothGAEand the development server,
> > > > > > and for non-deleteoperations such as:
>
> > > > > > db(db.client.id > 0).select()
>
> > > > > > so to be more robust I have replaced ID calls with:
>
> > > > > > db().select(db.client.ALL)
>
> > > > > > On Feb 7, 11:33 am, Jon Romero  wrote:
>
> > > > > > > the problem seems to happen when you try to query by the id field 
> > > > > > > and
> > > > > > > thendelete(I coulddeletewhen I chose a different field)
>
> > > > > > > On Feb 7, 2:18 am, Jon Romero  wrote:
>
> > > > > > > > Some thing happens to me. When I do:
> > > > > > > > db(db.table.id == some_id_that_exists).delete, I get the same 
> > > > > > > > count
> > > > > > > > error
>
> > > > > > > > On Feb 4, 3:16 am, mdipierro  wrote:
>
> > > > > > > > > do you use 2.5 or something else locally?
>
> > > > > > > > > On Feb 3, 6:11 pm, Carl  wrote:
>
> > > > > > > > > > This may be related toGAEupdate_record() has subtle 
> > > > > > > > > > difference
> > > > > > > > > > compared to native 
> > > > > > > > > > Web2Pyhttp://groups.google.com/group/web2py/browse_thread/thread/a69afded01...
> > > > > > > > > > but until shown otherwise, I've posed separately.
>
> > > > > > > > > > I have this in db.py:
>
> > > > > > > > > > db.define_table('team_user',
> > > > > > > > > > Field('teamId', 'integer', notnull=True,
> > > > > > > > > > required=True),
> > > > > > > > > > Field('user_email', 'string', length=254,
> > > > > > > > > > notnull=True, required=True,
> > > > > > > > > >  requires = 
> > > > > > > > > > [IS_LOWER(),IS_EMAIL()]),
> > > > > > > > > > Field('live', 'boolean', notnull=True, 
> > > > > > > > > > required=True,
> > > > > > > > > > default='True'),
> > > > > > > > > > Field('cDate', 'datetime'),
> > > > > > > > > > Field('mDate', 'datetime'))
>
> > > > > > > > > > I make this call:
> > > > > > > > > > self.db(self.db.team_user.id==memberId).delete()
>
> > > > > > > > > > such a statement callsdelete(self) in gql.py
> > > > > > > > > > defdelete(self):
> > > > > > > > > > self._db['_lastsql'] = 'DELETEWHERE %s' % self.where
> > > > > > > > > > (items, tablename, fields) = self._select()
> > > > > > > > > > tableobj = self._db[tablename]._tableobj
> > > > > > > > > > counter = items.count()
> > > > > > > > > >gae.delete(items)
> > > > > > > > > > return counter - items.count()
>
> > > > > > > > > > When the interpreter exectutes "counter = items.count()" an 
> > > > > > > > > > exception
> > > > > > > > > > is thrown stating "TypeError: count() takes exactly one 
> > > > > > > > > > argument (0
> > > > > > > > > > given)"
>
> > > > > > > > > > Have I something in my db.py definition that native web2py 
> > > > > > > > > > is happy
> > > > > > > > > > with but dev_appserver chokes on?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@goog

Re: [web2py] Re: wordpress

2010-03-04 Thread Giovanni Giorgi
Hi,
 I am working on a first version and it is easy to code after you have
understood the css.
I will post to the list a first preview in the w.e.

On Thu, March 4, 2010 02:02, mdipierro wrote:
> The nice thing about wordpress is that it is color neutral and it doed
> almost everything with CSS not images. They have a few images like
> this for example:
>
> http://s0.wp.com/wp-admin/images/gray-grad.png
>
> and they they have tabs like
>
> 
>   
> 
>   
>Title
>
>   
>
> 
>
> all the effect logic for all "someblock"s can be handled by one very
> simple JS
>
> // start with all closed blocks
> jQuery(document).ready(function(){jQuery('.inside').hide();});
> // slide-toggle when clicking on the handles
> jQuery('handlediv, h3.handle').click(function()
> {jQuery(this).parent().child('inside').slideToggle();});
>
> the rounded corner are handled via CSS
>
> 
> .rounded {
>   -moz-border-radius-bottomleft:6px;
>   -moz-border-radius-bottomright:6px;
>   -moz-border-radius-topleft:6px;
>   -moz-border-radius-topright:6px;
>   width: 80%;
>   border: 1px solid #33;
> }
> h3 {
>background:#DFDFDF url(images/gray-grad.png) repeat-x scroll left
> top;
>text-shadow:0 1px 0 #FF;
>width: 100%;
> }
> 
>
> Notice that when the ".inside" is closed the H3 has 4 rounded corners.
> When the ".inside" is open the H3 has top rounded corners and and the
> border of ".rounded" someblock has bottom rounded corners too, which
> is a cool effect.
>
>  It should be possible to apply the same logic to all admin views.
>
> There is not really much more than that except for the top menu (which
> web2py needs) and the left accordion menu (which web2py admin does not
> need).
>
> I am not saying this is easy. It takes time, understanding of CSS and
> an artistic eye.
>
> Massimo
>
> On Mar 3, 5:57 pm, Richard  wrote:
>> that would be great!
>> There was an OSX admin style posted here some time back but can't find
>> it right now ...
>>
>> Richard
>>
>> On Mar 4, 3:07 am, "Giovanni Giorgi"  wrote:
>>
>> > I am working on an application and I need to change the CSS.
>> > I can grab the Wordpress CSS and adapt it... :)
>> > After I finished the work, how do you like to send you the changes?
>>
>> > On Wed, March 3, 2010 17:04, mdipierro wrote:
>> > > I really like the look and feel of the management interface of
>> > > wordpress (white/black/gray with rounder corner and js
>> effects/menu).
>> > > It would be nice to use their CSS and images in web2py admin. What
>> do
>> > > you think? Any volunteers to work on it?
>>
>> > > --
>> > > You received this message because you are subscribed to the Google
>> Groups
>> > > "web2py-users" group.
>> > > To post to this group, send email to web...@googlegroups.com.
>> > > To unsubscribe from this group, send email to
>> > > web2py+unsubscr...@googlegroups.com.
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/web2py?hl=en.
>>
>> > --
>> > Team Leader
>> > Gioorgi.com Chief Editor
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>


-- 
Team Leader
Gioorgi.com Chief Editor

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] date fieds layout problem

2010-03-04 Thread Andrea Parodi

I have a problem with date fields. I've created
a SQLFORM with lot of fields (about 40). Some of there are dates.
In firefox calendar widgets works correctly, but in IE the calendar 
appear vertically

shifted. And the shift amount increase on the fields on the bottom of page.
Anyone already get this strange problem?

thks

Andrea


--
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] uservoice and decimal

2010-03-04 Thread mdipierro
There is a comment on uservoice about decimal.

DAL already has support for decimal although it is not documented in
the book. On SQLite it is mapped into "double" because SQLite does not
have native "decimal" but it works well on other databases.

Field('money','decimal(10,3)') for 3 decimals.

I did not delete the comment but somebody perhaps should or edit it
since it may give the wrong impression to new users.


There are other comments with wishes that have already been granted or
are not clear. This confuses new users. Who should we deal with them?

Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: appadmin fails on gae

2010-03-04 Thread Oatman
I'm experiencing a similar issue, seemingly because dev_appserver.py
does not support https.
If I try to use https, I get a lot of (presumably ssl) binary stuff in
the log and the browser gives me:
"ERR_SSL_PROTOCOL_ERROR"

If I try to use appadmin (working on the real GAE) locally, I'm
presented with:
 "appadmin is disabled because insecure channel"

Which is half right. Yes, it is not using https, but it is running on
localhost, so that should not be a problem.
Something in the dev_appserver.py must be confusing the localhost-
detection mechanism.

A simple patch of appadmin.py fixes this. Line 31:
elif (remote_addr not in hosts) and (remote_addr != "127.0.0.1"):
I have added the second test, which should be redundant, but on local
GAE breaks.

This is a bit of a cludge, what should be done is to fix the hosts
list to work on GAE, but I'll leave that to someone far more competent
than me!

Hope this helps someone,
Tris

On Feb 22, 9:58 am, Carles Gonzalez  wrote:
> No, it does not work either.
>
> it raises (from chromium):
>
> Error 107 (net::ERR_SSL_PROTOCOL_ERROR): Error desconegut.
>
> The app is quite simple, almost no code. Just a table, crud and webgrid.
>
>
>
> On Fri, Feb 19, 2010 at 2:07 PM, mdipierro  wrote:
> > I do not know. I have never seen this that function is
> > straightforward:
>
> >        from google.appengine.api import users
> >         users.create_login_url(request.env.path_info) 
>
> > and you get a GAE error
>
> > >   File "/base/python_lib/versions/1/google/appengine/api/users.py", line
> > 179, in create_login_url
> > >     raise NotAllowedError
> > > NotAllowedError
>
> > Does it work on dev_appserver?
>
> > On Feb 19, 7:01 am, Carles G  wrote:
> > > Hi!
>
> > > I'm deploying a test aplication on GAE and almost everything woks
> > > fine, although I can't access appadmin.
>
> > > When i try to access through https the application fails and i can see
> > > the following error in the dashboard logs:
>
> > > In FILE: /base/data/home/apps/professorsecaib/1.339995859017462670/
> > > applications/professors/controllers/appadmin.py
>
> > > Traceback (most recent call last):
> > >   File "/base/data/home/apps/professorsecaib/1.339995859017462670/
> > > gluon/restricted.py", line 173, in restricted
> > >     exec ccode in environment
> > >   File "/base/data/home/apps/professorsecaib/1.339995859017462670/
> > > applications/professors/controllers/appadmin.py:index", line 33, in
> > > 
> > >   File "/base/data/home/apps/professorsecaib/1.339995859017462670/
> > > gluon/fileutils.py", line 271, in check_credentials
> > >     % users.create_login_url(request.env.path_info)
> > >   File "/base/python_lib/versions/1/google/appengine/api/users.py",
> > > line 179, in create_login_url
> > >     raise NotAllowedError
> > > NotAllowedError
>
> > > I searched the list but i couldn't find the answer.
>
> > > Thanks in advance and sorry for my poor english.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > web2py+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] New features not documented in PDF book (2 ed)

2010-03-04 Thread DenesL
New features not documented in the PDF book (2nd edition)
as highlights in release order sequence (newer to older):

1.76.3
repost of 1.76.2 with crud captcha fix
http://groups.google.com/group/web2py/browse_thread/thread/658c72a8c08040d9#

1.76.2
*** use 1.76.3 ***
Main changes include:
1) major fix in cron (yet again)
2) auth.settings.login_captcha and auth.settings.register_captcha
3) crud.settings.create_captcha and crud.settings.update_captcha
4) automatic update button in admin
To test (4):
- make a fresh web2py installation
- locate the file VERSION (under web2py/ on Win and under
  web2py.app/Contents/Resources/ on Mac)
- edit this file and set it to something old like 1.0.0
- restart web2py
- in admin/default/site click on "upgrade web2py"
- restart web2py
- send feedback to the group
http://groups.google.com/group/web2py/browse_thread/thread/658c72a8c08040d9#

1.76.1
* editarea 0.8.2 + zencoding
* new (better) cron locking mechanism
* no storing session cookies on session.forget()
* routes_apps_raw allows disabling of request.args validation
* fixed problem with edit_languages ad multiple tabs
* crud captcha
* softcron disabled by default in wsgihandler and fcgihandler
The new cron mechanism may need a little more testing but it
is being released since the previous one had bugs anyway.
http://groups.google.com/group/web2py/browse_thread/thread/52f4d0615f32f088#

1.75.5
- fixed behaviour with languages.py
- added Chinese and Hungarian
- fixed problem with GAE deleted by id
- fixed bug in LOAD with custom views
- improved IS_IN_SET takes iterator, dict, list or list of tuples
- Auth(...,controller='default')
- fixed major bug in parsing repeated request.vars
- IS_DATE and IS_DATETIME can now handle any 0http://groups.google.com/group/web2py/browse_thread/thread/8bb2b0d72ec587ef#

1.75.4
- bug fix in BEAUTIFY

1.75.3
*** skip, use 1.75.4 ***
- better BEAUTIFY
- Linux PAM (Pluggable Authentication Modules) support
  http://groups.google.com/group/web2py/msg/f87ec95bc8eca536

1.75.2
- no more cron with -S option
- ability to overwrite/upgrade and app
  http://groups.google.com/group/web2py/msg/4f3ba5eedeced6a6
- gluon.tools.prettydate
  http://groups.google.com/group/web2py/msg/03ea6109ec90f0c8
- crud.archive
  http://groups.google.com/group/web2py/msg/d4892f347889fc6e
- better uuid avoids conflicts on replicated servers in the cloud
  http://groups.google.com/group/web2py/msg/12e8a11e1c574838
  http://groups.google.com/group/web2py-developers/msg/dcfe498b80e66e64
note: moved from EC2 to VPS.net
http://groups.google.com/group/web2py/browse_thread/thread/6fbcd5f9a0c5032c#

1.75.1
* minor fixes
http://groups.google.com/group/web2py/browse_thread/thread/9507d225c0ff40c3#

1.74.11 / 1.74.10
- fixes a few problems with CRON, typos
- check for invalid field and in DB
http://groups.google.com/group/web2py/browse_thread/thread/d830cb54fe913028#

1.74.9
* Fixes security hole that affects 1.74.8 and 1.74.7
http://groups.google.com/group/web2py/browse_thread/thread/23c04866d81fe57d#

1.74.8
*** UPGRADE TO 1.74.9 IMMEDIATELY! ***
http://groups.google.com/group/web2py/browse_thread/thread/23c04866d81fe57d#
1) IS_SLUG()
2) web2py.py -nogui
3) solved a problem with jython
4) login has "remember me option"
5) fixed problem with keepvalues in update forms
http://groups.google.com/group/web2py/browse_thread/thread/4075ac6578a5197e#

1.74.7
*** UPGRADE TO 1.74.9 IMMEDIATELY! ***
http://groups.google.com/group/web2py/browse_thread/thread/23c04866d81fe57d#
1) request_password_reset and password reset verification
2) python web2py.py -S app -M -R script.py -A arg1 arg2 arg3
3) support for T("%(a)s") % dict(a="hello")
http://groups.google.com/group/web2py/browse_thread/thread/fed8aa7e13d44ab2#

1.74.6
Mostly bug fixes and two main security issues fixed:
* deals with misconfiguration of postgresql that may cause SQL
Injection vulnerability
* blocked accounts were not really blocked
http://groups.google.com/group/web2py/browse_thread/thread/5b60ab4685d33b57#

1.74.5
* auth.user_id (shortcut for auth.user.id, defaults to None if not
logged in)
* support for all native types on GAE (e.g. StringListProperty)
* cache.ram usage statistics
* no more auth menu in scaffolding
* no more splash screen with -Q
* export_to_csv_file has represent
http://groups.google.com/group/web2py/browse_thread/thread/89a718332e6d7115#

1.74.4 - 1.74.2: bug fix releases

LOAD function
  introduced along the plugin system, this went fairly unnoticed
  LOAD(a, b, args=args, vars=vars, ajax=ajax, ajax_trap=ajax_trap )
http://www.web2py.com/AlterEgo/default/show/252

1.74.1
* Moved to mercurial
* Default validators use the new define_table(,format='...')
  http://groups.google.com/group/web2py/browse_thread/thread/35298fa6005a3a5b
* New get_vars and post_vars compatible in 2.5 and 2.6
* Major rewrite of gql.py extends DAL syntax on GAE, supports belongs
  http://groups.google.com/group/web2py/browse_thread/thread/6efa5dd4095f91e1
* No more *.w2p, welco

[web2py] Re: impersonate: decorators, original user info

2010-03-04 Thread reyelts
The new implementation works fine. Thx!

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] did you know?

2010-03-04 Thread mdipierro
http://gluonframework.wordpress.com/2010/03/04/web2py-learner/

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] did you know?

2010-03-04 Thread Thadeus Burgess
Nice!
-Thadeus





On Thu, Mar 4, 2010 at 9:08 AM, mdipierro  wrote:
> http://gluonframework.wordpress.com/2010/03/04/web2py-learner/
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] CRUD.update TypeError: list indices must be integers, not str

2010-03-04 Thread kachna
Hi all,
I use CRUD.update to generate update form. After submit this form a
receive:

TypeError: list indices must be integers, not str

MODEL:

db.define_table('runner',
  Field('name','string'),
  Field('male','integer',requires=IS_INT_IN_RANGE(0, 2))
)

CONTROLLER:

@auth.requires_login()
def edit():
  form_edit = crud.update(db[request.vars['tbl']], request.vars['id'])

  return dict(form=form_edit)


COMPLETE ERROR:
Traceback (most recent call last):
  File "/home/kachna/work/web2py/gluon/restricted.py", line 173, in
restricted
exec ccode in environment
  File "/home/kachna/work/web2py/applications/CHTrainCup/controllers/
admin.py", line 42, in 
  File "/home/kachna/work/web2py/gluon/globals.py", line 96, in

self._caller = lambda f: f()
  File "/home/kachna/work/web2py/gluon/tools.py", line 1863, in f
return action(*a, **b)
  File "/home/kachna/work/web2py/applications/CHTrainCup/controllers/
admin.py", line 38, in edit
form_edit = crud.update(db[request.vars['tbl']],
request.vars['id'])
  File "/home/kachna/work/web2py/gluon/tools.py", line 2353, in update
upload=self.settings.download_url,
  File "/home/kachna/work/web2py/gluon/sqlhtml.py", line 640, in
__init__
self.record_id = str(record['id'])

Can anybody help me? thx

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: did you know?

2010-03-04 Thread DenesL
+1

On Mar 4, 10:14 am, Thadeus Burgess  wrote:
> Nice!
> -Thadeus
>
> On Thu, Mar 4, 2010 at 9:08 AM, mdipierro  wrote:
> >http://gluonframework.wordpress.com/2010/03/04/web2py-learner/
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: uservoice and decimal

2010-03-04 Thread DenesL
Other that pointing them in the right direction?.


On Mar 4, 8:06 am, mdipierro  wrote:
> There is a comment on uservoice about decimal.
>
> DAL already has support for decimal although it is not documented in
> the book. On SQLite it is mapped into "double" because SQLite does not
> have native "decimal" but it works well on other databases.
>
>     Field('money','decimal(10,3)') for 3 decimals.
>
> I did not delete the comment but somebody perhaps should or edit it
> since it may give the wrong impression to new users.
>
> There are other comments with wishes that have already been granted or
> are not clear. This confuses new users. Who should we deal with them?
>
> Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: * web2py's Brand *

2010-03-04 Thread Thadeus Burgess
What designates a success though?

Something open source, that is better than wordpress, or trac, or
?

Or something written in a corporate environment that can't be released
or even anything shared about it due to legality issues?

There are many web2py apps that are being used in business, much more
internal "enterprisey" (meaning used in business) than open source
web2py apps.

Web2py's aim is to be "enterprisey" not "open sourcey". Thats just my
impression however. And as stated, because of this, there will always
be less apps that are visible to the public that are actually a
success.

-Thadeus





On Wed, Mar 3, 2010 at 9:42 PM, waTR  wrote:
> I tend to agree with what has been mentioned in the past. Concentrate
> on building good web apps and websites using web2py. Let the work
> speak for itself.
>
> All we need is one or two big successes...
>
>
>
> On Mar 3, 7:02 pm, mdipierro  wrote:
>> On Mar 3, 7:23 pm, John Heenan  wrote:
>>
>> > On Mar 4, 2:17 am, mdipierro  wrote:
>>
>> > > Some of the answers are funny. Mostly they are consistent with one
>> > > exception.
>> > > Perhaps a web2py hat is better than a t-shirt. I lost mine last
>> > > summer. :-(
>>
>> > Rather flippant given that someone has gone to some effort to set up a
>> > survey to help out Web2py and that the survey responses were careful.
>>
>> Perhaps my comment did not come out right. This was a good idea. When
>> I said some some of the answers are "funny" I meant it in a positive
>> sense. Perhaps I did not translated the concept I have in my mind
>> ("simpatiche" in Italian) in the proper english.
>>
>> > As I see it the real goal of Web2py is to become more popular than
>> > Django. I do not see this as healthy.
>>
>> I do not think this is the goal. I think the future of python
>> frameworks is correlated, not anti-correlated.
>>
>> > Like it or not, for whatever reasons the Python community is
>> > interested in Django and not in Web2py, as evidenced through
>> > democratic votes of PyCon participants about what participants want to
>> > attend presentations about.
>>
>> I was part of the process so I have something to add about this. For
>> three years there has been no talk and no tutorials about web2py,
>> although for three years I have submitted proposals. I was on a panel
>> discussion at PyCon 2009 because Guido stepped in and told them
>> excluding web2py was unfair. I was invited to a panel discussion at
>> PyCon 2010 but I did not go because 5 minutes of air time are not
>> worth the costs.
>> It is not the participants making the choice but a small set of
>> organizers. The decision process by the organizers is indeed
>> democratic (one person one vote) and I was one of them, but the rules
>> are debatable because the goal is unclear. One problem is that
>> basically few people participate to all rounds of discussions and in
>> practice it takes only one or two people to essentially veto a talk.
>> Some people when confronted with the choice tend to give a preference
>> to talks that they perceive to be more popular (for example Django vs
>> TG or web.py or web2py) and to "good speakers" defined as those who
>> have already presented at PyCon before. I have argued that the goal of
>> PyCon should be to broaden the audience (identify medium/large sub-
>> communities and give them representation) as opposed to consolidate
>> existing audience by giving a majority premium to largest communities
>> (such as ~24 hours of Django tutorials/talks and almost nothing to
>> other web frameworks). Of course the Django tutorials were the most
>> popular since by filtering out smaller communities the Django users
>> were the largest community represented at PyCon. The result is that
>> almost nobody from our list of 1600 people attended PyCon 2010. This
>> is not a problem for us as much as it is a problem for PyCon and the
>> Python community in general.
>>
>> Although I have published some technical comparisons between web2py
>> and Django (as well as between web2py and other web frameworks) you
>> will not find any post from me or other members less than deferential
>> towards Django. Although, unfortunately, the opposite is not true,
>> negative remarks tend to come from the low end of the food chain. In
>> fact top Django developers and contributors are nice, intelligent and
>> friendly people.
>>
>> Moreover I am not convinced at all that the Django community is
>> particularly hostile to web2py. It is just very large so it is more
>> likely that some particularly vocal people belong to it. The people
>> who have been most annoying online (and I know who they are) are not
>> Django cheerleaders either.
>>
>> Some people have been offended by a few comments of mine like "[that
>> piece of software] is horrible" or "building an ORM is not rocket
>> science". In there first case the comment just did not come out right
>> and I apologized. In the second case I stand by what I said.
>>
>> I personally care more about design a

[web2py] Re: online book correction protocol

2010-03-04 Thread DenesL
In http://groups.google.com/group/web2py/msg/7b9661eac4f788e0 Massimo
said:

- - - - - -  - - - - - -
I made some of you editors (if you are not and want to be just ask)

Please follow these few rules:

- Try use wiki instead of editing book section
- Do not rearrange or edit text in book sections (*) but limit
yourself to
- Fix errors
- Add paragraphs about new features
- If you save many times go to the "log" page (bottom of section) and
delete intermediate archived pages. You can also see the history of
changes there.

(*) because it would make a nightmare for me to diff and correct the
latex book.
- - - - - -  - - - - - -

Also http://web2py.com/book/default/wikipage/how-to-contribute

- - - - - -  - - - - - -
How to contribute

You have contributed code to web2py and want to contribute with
documentation about that code, it should go in the main book, not in a
wiki page. Please email me if you need need full editor permissions.

The wiki are mostly for recipes and test cases.

The threaded discussion IS NOT a place to ask questions. Questions
will be deleted.
- - - - - -  - - - - - -

But there is http://web2py.com/book/default/wikipage/errata
which IMO should not exist, all errata corrections must be done to the
book itself.

Denes.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: did you know?

2010-03-04 Thread Thadeus Burgess
This reminds me of starship troopers... "Did you know?"
-Thadeus





On Thu, Mar 4, 2010 at 9:20 AM, DenesL  wrote:
> +1
>
> On Mar 4, 10:14 am, Thadeus Burgess  wrote:
>> Nice!
>> -Thadeus
>>
>> On Thu, Mar 4, 2010 at 9:08 AM, mdipierro  wrote:
>> >http://gluonframework.wordpress.com/2010/03/04/web2py-learner/
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "web2py-users" group.
>> > To post to this group, send email to web...@googlegroups.com.
>> > To unsubscribe from this group, send email to 
>> > web2py+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/web2py?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: did you know?

2010-03-04 Thread Albert Abril
I like this blog, it's a lot useful for people like me that still
discovering web2py.

Just one thing: i supose at title that *leaner* is *learner*, ( i'm not
english ).

Regards.

On Thu, Mar 4, 2010 at 5:06 PM, Thadeus Burgess wrote:

> This reminds me of starship troopers... "Did you know?"
> -Thadeus
>
>
>
>
>
> On Thu, Mar 4, 2010 at 9:20 AM, DenesL  wrote:
> > +1
> >
> > On Mar 4, 10:14 am, Thadeus Burgess  wrote:
> >> Nice!
> >> -Thadeus
> >>
> >> On Thu, Mar 4, 2010 at 9:08 AM, mdipierro 
> wrote:
> >> >http://gluonframework.wordpress.com/2010/03/04/web2py-learner/
> >>
> >> > --
> >> > You received this message because you are subscribed to the Google
> Groups "web2py-users" group.
> >> > To post to this group, send email to web...@googlegroups.com.
> >> > To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> >> > For more options, visit this group athttp://
> groups.google.com/group/web2py?hl=en.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Dream Host Deployment

2010-03-04 Thread Jesse
Using virtualenv seemed to do the trick.

Although, I'm sure it doesn't matter now when I ran "import dbhash" I
got a several line long error:
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/username/opt//lib/python2.5/dbhash.py", line 5, in

import bsddb
  File "/home/username/opt//lib/python2.5/bsddb/__init__.py", line 51,
in 
import _bsddb
ImportError: No module named _bsddb


Another question: Any tips on getting into the Admin screens via
https? or at least without removing the security.
I'm guessing something like a self signed key will likely work, but
I'm unfamiliar.
I found:
http://web2py.com/AlterEgo/default/show/140
http://web2py.com/AlterEgo/default/show/143

I haven't tried either yet, but I hate running stuff without really
knowing what they're supposed to do since you can end up doing
unforeseen things.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Ext JS REST Grid + WEB2PY CRUD ?

2010-03-04 Thread AsmanCom
Hi,

yeah i´ve to expose CRUD functions by JSON or XML to the JS client.
Like ist done here in PHP:
http://www.extjs.com/deploy/dev/examples/writer/writer.html

But I need an Code example for web2py, I think.

That should be simple right? Because it has all been done before
Should be similar connecting web2py to JQ Datatables?

What i need is an Real-Time DB view such as:
http://www.extjs.com/deploy/dev/examples/direct/direct.php

But connected to web2py

Can anybody help me up?

Thank you in advance.

Dieter Asman

On 3 Mrz., 01:26, "mr.freeze"  wrote:
> I would use an xml service to feed the grid data instead.
>
> http://web2py.com/book/default/section/9/2?search=%40service.xmlhttp://www.extjs.com/deploy/dev/examples/grid/xml-grid.html
>
> On Mar 2, 7:35 am, AsmanCom  wrote:
>
> > Hi,
>
> > any idea how to make the Ext JS Grids woking with 
> > WEB2PY?http://www.extjs.com/deploy/dev/examples/#sample-3
>
> > In particular the RESTful 
> > Store:http://www.extjs.com/deploy/dev/examples/restful/restful.html
>
> > I think it must be connected to CRUD somehow?
> > Any Examples to connect such JS Grids to the WEB2PY DB ?
>
> > Thank you in advance.
>
> > Dieter Asman

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] ajax list/detail view design pattern

2010-03-04 Thread snfctech
I am fond of a design pattern whereby a list of records (such as
orders) is displayed in the top part of a view and the detail for a
highlighted record is displayed in the lower part of the view via AJAX
onclick (such as the customer and product details for the order).

I like web2py because I want a "higher-level" tool that allows be to
do more with less code.  But when I tried implementing my favorite
design pattern with the web2py CRUD and AJAX helpers, I found the code
to be quite awkward, namely:

 I give the list view table and id as a CRUD parameter which I use to
add the onclick event to the table rows on domready:

order_list = crud.select(db.os_order,_id='order_list',...

and:

$('#order_list tbody tr').click(function() {
var order_id = $(this).find('.order_id').attr('id');
ajax('default/orderdetail',[order_id],'order_detail_div');
});

But here's the really ugly part of the design:

In order to get the record id I have to represent my ID field with a
hidden INPUT element:

db.os_order.id.represent = lambda value: (value,
INPUT(_type='hidden', _id=value,_value=value, _class='order_id'))

And in order to uniquely identify the element and pass it's value to
the web2py AJAX helper I give the record ID as both it's "id" and
"value" attributes.  Which leads to the unhappy retrieval in the
controller by means of:

order_id = list(request.vars)[0]

All of this seems a bit un-elegant, don't you think?  I guess I could
do away with the web2py AJAX helper and use a for loop to add
id="order_123" to my table rows, but now I'm back to building forms
from scratch - so what's the point of the web2py high-level helpers?

If somebody could point out a way to implement this design pattern in
a more elegant fashion by still leveraging web2py form helpers, it
would be much appreciated.

Thanks.













-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] ajax list/detail view design pattern

2010-03-04 Thread Thadeus Burgess
I hand write html, and use tr id="123" or tr record_id="123"

and use

jQuery("tr").click(function(){$(this).parent().attr("record_id")})

-Thadeus





On Thu, Mar 4, 2010 at 10:56 AM, snfctech  wrote:
> I am fond of a design pattern whereby a list of records (such as
> orders) is displayed in the top part of a view and the detail for a
> highlighted record is displayed in the lower part of the view via AJAX
> onclick (such as the customer and product details for the order).
>
> I like web2py because I want a "higher-level" tool that allows be to
> do more with less code.  But when I tried implementing my favorite
> design pattern with the web2py CRUD and AJAX helpers, I found the code
> to be quite awkward, namely:
>
>  I give the list view table and id as a CRUD parameter which I use to
> add the onclick event to the table rows on domready:
>
>    order_list = crud.select(db.os_order,_id='order_list',...
>
> and:
>
>    $('#order_list tbody tr').click(function() {
>        var order_id = $(this).find('.order_id').attr('id');
>        ajax('default/orderdetail',[order_id],'order_detail_div');
>    });
>
> But here's the really ugly part of the design:
>
> In order to get the record id I have to represent my ID field with a
> hidden INPUT element:
>
>    db.os_order.id.represent = lambda value: (value,
> INPUT(_type='hidden', _id=value,_value=value, _class='order_id'))
>
> And in order to uniquely identify the element and pass it's value to
> the web2py AJAX helper I give the record ID as both it's "id" and
> "value" attributes.  Which leads to the unhappy retrieval in the
> controller by means of:
>
>    order_id = list(request.vars)[0]
>
> All of this seems a bit un-elegant, don't you think?  I guess I could
> do away with the web2py AJAX helper and use a for loop to add
> id="order_123" to my table rows, but now I'm back to building forms
> from scratch - so what's the point of the web2py high-level helpers?
>
> If somebody could point out a way to implement this design pattern in
> a more elegant fashion by still leveraging web2py form helpers, it
> would be much appreciated.
>
> Thanks.
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: ajax list/detail view design pattern

2010-03-04 Thread snfctech
So the form helpers are only useful for record-level input or basic
list displays, and everything else needs to be hand-coded?  I wish
there was a way to use the helpers in a more flexible fashion, so
there could be "one obvious way" to display forms for creating,
reading, updating and deleting.  As it stands, it looks like some of
my forms will get to live in CRUD, some in SQLFORM, and some in for
loops with markup.  That seems un-elegant to me.

On Mar 4, 9:12 am, Thadeus Burgess  wrote:
> I hand write html, and use tr id="123" or tr record_id="123"
>
> and use
>
> jQuery("tr").click(function(){$(this).parent().attr("record_id")})
>
> -Thadeus
>
> On Thu, Mar 4, 2010 at 10:56 AM, snfctech  wrote:
> > I am fond of a design pattern whereby a list of records (such as
> > orders) is displayed in the top part of a view and the detail for a
> > highlighted record is displayed in the lower part of the view via AJAX
> > onclick (such as the customer and product details for the order).
>
> > I like web2py because I want a "higher-level" tool that allows be to
> > do more with less code.  But when I tried implementing my favorite
> > design pattern with the web2py CRUD and AJAX helpers, I found the code
> > to be quite awkward, namely:
>
> >  I give the list view table and id as a CRUD parameter which I use to
> > add the onclick event to the table rows on domready:
>
> >    order_list = crud.select(db.os_order,_id='order_list',...
>
> > and:
>
> >    $('#order_list tbody tr').click(function() {
> >        var order_id = $(this).find('.order_id').attr('id');
> >        ajax('default/orderdetail',[order_id],'order_detail_div');
> >    });
>
> > But here's the really ugly part of the design:
>
> > In order to get the record id I have to represent my ID field with a
> > hidden INPUT element:
>
> >    db.os_order.id.represent = lambda value: (value,
> > INPUT(_type='hidden', _id=value,_value=value, _class='order_id'))
>
> > And in order to uniquely identify the element and pass it's value to
> > the web2py AJAX helper I give the record ID as both it's "id" and
> > "value" attributes.  Which leads to the unhappy retrieval in the
> > controller by means of:
>
> >    order_id = list(request.vars)[0]
>
> > All of this seems a bit un-elegant, don't you think?  I guess I could
> > do away with the web2py AJAX helper and use a for loop to add
> > id="order_123" to my table rows, but now I'm back to building forms
> > from scratch - so what's the point of the web2py high-level helpers?
>
> > If somebody could point out a way to implement this design pattern in
> > a more elegant fashion by still leveraging web2py form helpers, it
> > would be much appreciated.
>
> > Thanks.
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] did you know?

2010-03-04 Thread Álvaro Justen [Turicas]
Cool!

On Thu, Mar 4, 2010 at 12:08, mdipierro  wrote:
> http://gluonframework.wordpress.com/2010/03/04/web2py-learner/
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>



-- 
Álvaro Justen - Turicas
 http://blog.justen.eng.br/
 21 9898-0141

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: uservoice and decimal

2010-03-04 Thread waTR
That's no big deal, just mark the suggestion as DONE, and put a
comment about the existence of this feature...



On Mar 4, 7:29 am, DenesL  wrote:
> Other that pointing them in the right direction?.
>
> On Mar 4, 8:06 am, mdipierro  wrote:
>
> > There is a comment on uservoice about decimal.
>
> > DAL already has support for decimal although it is not documented in
> > the book. On SQLite it is mapped into "double" because SQLite does not
> > have native "decimal" but it works well on other databases.
>
> >     Field('money','decimal(10,3)') for 3 decimals.
>
> > I did not delete the comment but somebody perhaps should or edit it
> > since it may give the wrong impression to new users.
>
> > There are other comments with wishes that have already been granted or
> > are not clear. This confuses new users. Who should we deal with them?
>
> > Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: uservoice and decimal

2010-03-04 Thread Thadeus Burgess
Can others besides the question creator mark something as DONE?

-Thadeus





On Thu, Mar 4, 2010 at 12:03 PM, waTR  wrote:
> That's no big deal, just mark the suggestion as DONE, and put a
> comment about the existence of this feature...
>
>
>
> On Mar 4, 7:29 am, DenesL  wrote:
>> Other that pointing them in the right direction?.
>>
>> On Mar 4, 8:06 am, mdipierro  wrote:
>>
>> > There is a comment on uservoice about decimal.
>>
>> > DAL already has support for decimal although it is not documented in
>> > the book. On SQLite it is mapped into "double" because SQLite does not
>> > have native "decimal" but it works well on other databases.
>>
>> >     Field('money','decimal(10,3)') for 3 decimals.
>>
>> > I did not delete the comment but somebody perhaps should or edit it
>> > since it may give the wrong impression to new users.
>>
>> > There are other comments with wishes that have already been granted or
>> > are not clear. This confuses new users. Who should we deal with them?
>>
>> > Massimo
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] did you know?

2010-03-04 Thread Thadeus Burgess
I'm pointing my Learner to the web2py mailing list :)

Bowahahahahahahahaha!

Maybe it can start writing web2py code for me >.<

-Thadeus





On Thu, Mar 4, 2010 at 11:53 AM, Álvaro Justen [Turicas]
 wrote:
> Cool!
>
> On Thu, Mar 4, 2010 at 12:08, mdipierro  wrote:
>> http://gluonframework.wordpress.com/2010/03/04/web2py-learner/
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To post to this group, send email to web...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> web2py+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/web2py?hl=en.
>>
>>
>
>
>
> --
> Álvaro Justen - Turicas
>  http://blog.justen.eng.br/
>  21 9898-0141
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: New Code-Editor

2010-03-04 Thread Joschua
ok, I can send him a mail. If this bug is fixed, the editor is okay.

Nevertheless I have some suggestions:

* When try to leaving a page is not saved, ask for saving it.. (Often
I accidently go back and all changes are lost)
* in the views it would be great if there is a "{{ * put the curser
here * }}"-button (this will save time)


On 28 Feb., 23:28, mdipierro  wrote:
> About CodeMirror I am told by one of the authors that:
>
> - lines that are not militantly aligned to 4-space increments are
> flagged as errors.
> - Codemirror has no regexp searching
> - Codemirror is slower than Editarea
>
> Bespin requires HTML5 and therefore is not really compatible with many
> browser.
>
> I'd love to switch but we may have to wait a little bit.
>
> In the short term it may be easier to convince the editArea guys to
> fix the bug that causes the out of sync. If they do not they are going
> to loose a lot of customers.
>
> I have emailed them a few months ago but not reply. Anybody else wants
> to try?
>
> Massimo
>
> On Feb 28, 3:50 pm, Joschua  wrote:
>
> > Hello (I'm new here :),
>
> > the code-editor of web2py often has display errors (on SRWare Iron (a
> > better Chrome) even more)  and is sometimes slow. There are also some
> > good alternatives to the actually used "EditArea":
>
> >http://stackoverflow.com/questions/198271/is-there-a-good-in-browser-...
> > CodeMirror (minimal) and Bespin (new) looks interesting.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: did you know?

2010-03-04 Thread Dragonfyre13
In that case, I have to ask. Does this have a dependency on nltk? I've
been reading a LOT on NLTK lately, and it does almost exactly this in
it's most basic form.

On Mar 4, 12:06 pm, Thadeus Burgess  wrote:
> I'm pointing my Learner to the web2py mailing list :)
>
> Bowahahahahahahahaha!
>
> Maybe it can start writing web2py code for me >.<
>
> -Thadeus
>
> On Thu, Mar 4, 2010 at 11:53 AM, Álvaro Justen [Turicas]
>
>
>
>  wrote:
> > Cool!
>
> > On Thu, Mar 4, 2010 at 12:08, mdipierro  wrote:
> >>http://gluonframework.wordpress.com/2010/03/04/web2py-learner/
>
> >> --
> >> You received this message because you are subscribed to the Google Groups 
> >> "web2py-users" group.
> >> To post to this group, send email to web...@googlegroups.com.
> >> To unsubscribe from this group, send email to 
> >> web2py+unsubscr...@googlegroups.com.
> >> For more options, visit this group 
> >> athttp://groups.google.com/group/web2py?hl=en.
>
> > --
> > Álvaro Justen - Turicas
> >  http://blog.justen.eng.br/
> >  21 9898-0141
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: did you know?

2010-03-04 Thread DenesL
LOL

On Mar 4, 1:06 pm, Thadeus Burgess  wrote:
> I'm pointing my Learner to the web2py mailing list :)
>
> Bowahahahahahahahaha!
>
> Maybe it can start writing web2py code for me >.<
>
> -Thadeus

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: New Code-Editor

2010-03-04 Thread Mengu
"* in the views it would be great if there is a "{{ * put the curser
here * }}"-button (this will save time)"

i think a keyboard shortcut would be better rather than a button.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Anyone interested in backing up / restoring their GAE database?

2010-03-04 Thread waTR
http://web2py.uservoice.com/forums/42577-general/suggestions/525621-plugin-gaebar-on-web2py

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Anyone interested in backing up / restoring their GAE database?

2010-03-04 Thread Wes James
It says it only works with django projects.

On Thu, Mar 4, 2010 at 12:40 PM, waTR  wrote:
> http://web2py.uservoice.com/forums/42577-general/suggestions/525621-plugin-gaebar-on-web2py
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: did you know?

2010-03-04 Thread mdipierro
No. It is very very basic. ~10 lines of code.

On Mar 4, 12:43 pm, Dragonfyre13  wrote:
> In that case, I have to ask. Does this have a dependency on nltk? I've
> been reading a LOT on NLTK lately, and it does almost exactly this in
> it's most basic form.
>
> On Mar 4, 12:06 pm, Thadeus Burgess  wrote:
>
> > I'm pointing my Learner to the web2py mailing list :)
>
> > Bowahahahahahahahaha!
>
> > Maybe it can start writing web2py code for me >.<
>
> > -Thadeus
>
> > On Thu, Mar 4, 2010 at 11:53 AM, Álvaro Justen [Turicas]
>
> >  wrote:
> > > Cool!
>
> > > On Thu, Mar 4, 2010 at 12:08, mdipierro  wrote:
> > >>http://gluonframework.wordpress.com/2010/03/04/web2py-learner/
>
> > >> --
> > >> You received this message because you are subscribed to the Google 
> > >> Groups "web2py-users" group.
> > >> To post to this group, send email to web...@googlegroups.com.
> > >> To unsubscribe from this group, send email to 
> > >> web2py+unsubscr...@googlegroups.com.
> > >> For more options, visit this group 
> > >> athttp://groups.google.com/group/web2py?hl=en.
>
> > > --
> > > Álvaro Justen - Turicas
> > >  http://blog.justen.eng.br/
> > >  21 9898-0141
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > web2py+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Anyone interested in backing up / restoring their GAE database?

2010-03-04 Thread mdipierro
I do not think it is Django specific. Only the examples are.

Massimo

On Mar 4, 1:57 pm, Wes James  wrote:
> It says it only works with django projects.
>
> On Thu, Mar 4, 2010 at 12:40 PM, waTR  wrote:
> >http://web2py.uservoice.com/forums/42577-general/suggestions/525621-p...
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] database is locked

2010-03-04 Thread vince
i always got the error on 1.75.5. i am upgrading to 1.76.3 and see how
it goes.

i am using sqlite and it's not for heavy usage, is it suppose to be
delay instead of return error when the db file is locked?



  File "/home/web2py/gluon/sql.py", line 3042, in select
rows = response(query)
  File "/home/web2py/gluon/sql.py", line 3037, in response
db._execute(query)
  File "/home/web2py/gluon/sql.py", line 895, in 
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
OperationalError: database is locked

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: database is locked

2010-03-04 Thread vince
here's some more errorlog just fyi.

actually it's easy to reproduce when opening page with lots of image
needs to be download via web2py

Traceback (most recent call last):
  File "/home/web2py/gluon/main.py", line 488, in wsgibase
session._try_store_in_db(request, response)
  File "/home/web2py/gluon/globals.py", line 358, in _try_store_in_db
record_id = table.insert(**dd)
  File "/home/web2py/gluon/sql.py", line 1879, in insert
self._db._execute(query)
  File "/home/web2py/applications/skyyer/models/db.py", line 76, in

db['_execute']=lambda *a,**b:
timer(db,lambda:db._cursor.execute(*a,**b))
  File "/home/web2py/applications/skyyer/models/db.py", line 73, in
timer
f()
  File "/home/web2py/applications/skyyer/models/db.py", line 76, in

db['_execute']=lambda *a,**b:
timer(db,lambda:db._cursor.execute(*a,**b))
OperationalError: database is locked


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: database is locked

2010-03-04 Thread Thadeus Burgess
The issue is that sqlite database is locked every time it is accessed.
So if you have a-lot of concurrent requests, some of those will fail
due to it being locked by other threads.

The solution is to use a database that does not rely on locking such
as postgresql or mysql.

-Thadeus





On Thu, Mar 4, 2010 at 2:57 PM, vince  wrote:
> here's some more errorlog just fyi.
>
> actually it's easy to reproduce when opening page with lots of image
> needs to be download via web2py
>
> Traceback (most recent call last):
>  File "/home/web2py/gluon/main.py", line 488, in wsgibase
>    session._try_store_in_db(request, response)
>  File "/home/web2py/gluon/globals.py", line 358, in _try_store_in_db
>    record_id = table.insert(**dd)
>  File "/home/web2py/gluon/sql.py", line 1879, in insert
>    self._db._execute(query)
>  File "/home/web2py/applications/skyyer/models/db.py", line 76, in
> 
>    db['_execute']=lambda *a,**b:
> timer(db,lambda:db._cursor.execute(*a,**b))
>  File "/home/web2py/applications/skyyer/models/db.py", line 73, in
> timer
>    f()
>  File "/home/web2py/applications/skyyer/models/db.py", line 76, in
> 
>    db['_execute']=lambda *a,**b:
> timer(db,lambda:db._cursor.execute(*a,**b))
> OperationalError: database is locked
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: database is locked

2010-03-04 Thread Jonathan Lundell
On Mar 4, 2010, at 1:08 PM, Thadeus Burgess wrote:

> The issue is that sqlite database is locked every time it is accessed.
> So if you have a-lot of concurrent requests, some of those will fail
> due to it being locked by other threads.
> 
> The solution is to use a database that does not rely on locking such
> as postgresql or mysql.

Vince is right, though: there's no reason to crash. The locking is just for 
serializing. Something seems wrong; if this were normal, SQLite would be 
useless.

> 
> -Thadeus
> 
> 
> 
> 
> 
> On Thu, Mar 4, 2010 at 2:57 PM, vince  wrote:
>> here's some more errorlog just fyi.
>> 
>> actually it's easy to reproduce when opening page with lots of image
>> needs to be download via web2py
>> 
>> Traceback (most recent call last):
>>  File "/home/web2py/gluon/main.py", line 488, in wsgibase
>>session._try_store_in_db(request, response)
>>  File "/home/web2py/gluon/globals.py", line 358, in _try_store_in_db
>>record_id = table.insert(**dd)
>>  File "/home/web2py/gluon/sql.py", line 1879, in insert
>>self._db._execute(query)
>>  File "/home/web2py/applications/skyyer/models/db.py", line 76, in
>> 
>>db['_execute']=lambda *a,**b:
>> timer(db,lambda:db._cursor.execute(*a,**b))
>>  File "/home/web2py/applications/skyyer/models/db.py", line 73, in
>> timer
>>f()
>>  File "/home/web2py/applications/skyyer/models/db.py", line 76, in
>> 
>>db['_execute']=lambda *a,**b:
>> timer(db,lambda:db._cursor.execute(*a,**b))
>> OperationalError: database is locked


-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: database is locked

2010-03-04 Thread Thadeus Burgess
Vince has had this problem in the past, and it was due to the .table
files being locked, he solved it by setting migrate=False.

Has he forgotten about this?

I just did a quick search on the groups for "lots of images"

-Thadeus





On Thu, Mar 4, 2010 at 3:23 PM, Jonathan Lundell  wrote:
> On Mar 4, 2010, at 1:08 PM, Thadeus Burgess wrote:
>
>> The issue is that sqlite database is locked every time it is accessed.
>> So if you have a-lot of concurrent requests, some of those will fail
>> due to it being locked by other threads.
>>
>> The solution is to use a database that does not rely on locking such
>> as postgresql or mysql.
>
> Vince is right, though: there's no reason to crash. The locking is just for 
> serializing. Something seems wrong; if this were normal, SQLite would be 
> useless.
>
>>
>> -Thadeus
>>
>>
>>
>>
>>
>> On Thu, Mar 4, 2010 at 2:57 PM, vince  wrote:
>>> here's some more errorlog just fyi.
>>>
>>> actually it's easy to reproduce when opening page with lots of image
>>> needs to be download via web2py
>>>
>>> Traceback (most recent call last):
>>>  File "/home/web2py/gluon/main.py", line 488, in wsgibase
>>>    session._try_store_in_db(request, response)
>>>  File "/home/web2py/gluon/globals.py", line 358, in _try_store_in_db
>>>    record_id = table.insert(**dd)
>>>  File "/home/web2py/gluon/sql.py", line 1879, in insert
>>>    self._db._execute(query)
>>>  File "/home/web2py/applications/skyyer/models/db.py", line 76, in
>>> 
>>>    db['_execute']=lambda *a,**b:
>>> timer(db,lambda:db._cursor.execute(*a,**b))
>>>  File "/home/web2py/applications/skyyer/models/db.py", line 73, in
>>> timer
>>>    f()
>>>  File "/home/web2py/applications/skyyer/models/db.py", line 76, in
>>> 
>>>    db['_execute']=lambda *a,**b:
>>> timer(db,lambda:db._cursor.execute(*a,**b))
>>> OperationalError: database is locked
>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] firebird error when tries to execute auth.defines_tables()

2010-03-04 Thread salbefe
Hello,

I'm testing web2py with firebird 2.1 and I get the following error
when I try to connect:

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 173, in restricted
exec ccode in environment
  File "C:/web2py/applications/init/models/db.py", line 34, in

auth.define_tables() # creates all needed
tables
  File "C:\web2py\gluon\tools.py", line 797, in define_tables
format='%(first_name)s %(last_name)s (%(id)s)')
  File "C:\web2py\gluon\sql.py", line 1275, in define_table
t._create(migrate=migrate, fake_migrate=fake_migrate)
  File "C:\web2py\gluon\sql.py", line 1694, in _create
self._db._execute(query)
  File "C:\web2py\gluon\sql.py", line 1067, in 
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
ProgrammingError: (-104, 'isc_dsql_prepare: \n  Dynamic SQL Error\n
SQL error code = -104\n  Token unknown - line 6, column 5\n
password')

The problem comes with auth.define_tables(). If I comment this line,
web2py connects fine to firebird but it do not creates the necessary
tables to perform auth control.

In my case, the connection string is as follows: db = DAL('firebird://
SYSDBA:master...@localhost/c:\programas\ctodb.fdb')

I'm using web2py 1.76.3 on windows and kinterbasdb 3.3.0-win32-py2.6.
I do not if its a bug or if I'm doing something wrong.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: database is locked

2010-03-04 Thread vince
when migrate=False it fixed the .table locking problem. but this
database locking issue is just another one, actually it's just a
single user application and i still have this problem.

i think it should be delay instead of return error when the file is
locked. same case apply to .table files although migrate=False can fix
it.

On Mar 5, 5:50 am, Thadeus Burgess  wrote:
> Vince has had this problem in the past, and it was due to the .table
> files being locked, he solved it by setting migrate=False.
>
> Has he forgotten about this?
>
> I just did a quick search on the groups for "lots of images"
>
> -Thadeus
>
>
>
> On Thu, Mar 4, 2010 at 3:23 PM, Jonathan Lundell  wrote:
> > On Mar 4, 2010, at 1:08 PM, Thadeus Burgess wrote:
>
> >> The issue is that sqlite database is locked every time it is accessed.
> >> So if you have a-lot of concurrent requests, some of those will fail
> >> due to it being locked by other threads.
>
> >> The solution is to use a database that does not rely on locking such
> >> as postgresql or mysql.
>
> > Vince is right, though: there's no reason to crash. The locking is just for 
> > serializing. Something seems wrong; if this were normal, SQLite would be 
> > useless.
>
> >> -Thadeus
>
> >> On Thu, Mar 4, 2010 at 2:57 PM, vince  wrote:
> >>> here's some more errorlog just fyi.
>
> >>> actually it's easy to reproduce when opening page with lots of image
> >>> needs to be download via web2py
>
> >>> Traceback (most recent call last):
> >>>  File "/home/web2py/gluon/main.py", line 488, in wsgibase
> >>>    session._try_store_in_db(request, response)
> >>>  File "/home/web2py/gluon/globals.py", line 358, in _try_store_in_db
> >>>    record_id = table.insert(**dd)
> >>>  File "/home/web2py/gluon/sql.py", line 1879, in insert
> >>>    self._db._execute(query)
> >>>  File "/home/web2py/applications/skyyer/models/db.py", line 76, in
> >>> 
> >>>    db['_execute']=lambda *a,**b:
> >>> timer(db,lambda:db._cursor.execute(*a,**b))
> >>>  File "/home/web2py/applications/skyyer/models/db.py", line 73, in
> >>> timer
> >>>    f()
> >>>  File "/home/web2py/applications/skyyer/models/db.py", line 76, in
> >>> 
> >>>    db['_execute']=lambda *a,**b:
> >>> timer(db,lambda:db._cursor.execute(*a,**b))
> >>> OperationalError: database is locked
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: * web2py's Brand *

2010-03-04 Thread John Heenan
A brand must outlast individuals. As such Web2py is not a recognised
and accepted brand.

Web2py is exclusively managed by a single academic who gets uptight
about issues that are not relevant to Web2py and for which the time he
puts into Web2py does not provide him with significant financial or
academic reward.

I expect it will only be a matter of time before Massimo decides he
has had enough and decides to moves on. I am not complaining. I am
only stating what I expect.  Will web2py will continue to survive?
Hardly.

>From an enterprise perspective having a project largely tied to a
single person is never good. For example I have seen an earnings
forecast from a multi billion dollar corporation pushing new
technologies stating a risk for prospectors is whether key personnel
continue to stay with the company or not.

I and many others do not care what the real motivations for web2py
are. Frankly they are irrelevant. The fact that Massimo has chosen in
his reply below to concentrate on a narrow and irrelevant aspect of
web2py speaks volumes. That irrelevant aspect is the failure of web2py
to be accepted in the desired manner at PyCon. PyCon itself is
irrelevant and unimportant to the vast majority of us.

John Heenan

On Mar 4, 1:02 pm, mdipierro  wrote:
> On Mar 3, 7:23 pm, John Heenan  wrote:
>
> > On Mar 4, 2:17 am, mdipierro  wrote:
>
> > > Some of the answers are funny. Mostly they are consistent with one
> > > exception.
> > > Perhaps a web2py hat is better than a t-shirt. I lost mine last
> > > summer. :-(
>
> > Rather flippant given that someone has gone to some effort to set up a
> > survey to help out Web2py and that the survey responses were careful.
>
> Perhaps my comment did not come out right. This was a good idea. When
> I said some some of the answers are "funny" I meant it in a positive
> sense. Perhaps I did not translated the concept I have in my mind
> ("simpatiche" in Italian) in the proper english.
>
> > As I see it the real goal of Web2py is to become more popular than
> > Django. I do not see this as healthy.
>
> I do not think this is the goal. I think the future of python
> frameworks is correlated, not anti-correlated.
>
> > Like it or not, for whatever reasons the Python community is
> > interested in Django and not in Web2py, as evidenced through
> > democratic votes of PyCon participants about what participants want to
> > attend presentations about.
>
> I was part of the process so I have something to add about this. For
> three years there has been no talk and no tutorials about web2py,
> although for three years I have submitted proposals. I was on a panel
> discussion at PyCon 2009 because Guido stepped in and told them
> excluding web2py was unfair. I was invited to a panel discussion at
> PyCon 2010 but I did not go because 5 minutes of air time are not
> worth the costs.
> It is not the participants making the choice but a small set of
> organizers. The decision process by the organizers is indeed
> democratic (one person one vote) and I was one of them, but the rules
> are debatable because the goal is unclear. One problem is that
> basically few people participate to all rounds of discussions and in
> practice it takes only one or two people to essentially veto a talk.
> Some people when confronted with the choice tend to give a preference
> to talks that they perceive to be more popular (for example Django vs
> TG or web.py or web2py) and to "good speakers" defined as those who
> have already presented at PyCon before. I have argued that the goal of
> PyCon should be to broaden the audience (identify medium/large sub-
> communities and give them representation) as opposed to consolidate
> existing audience by giving a majority premium to largest communities
> (such as ~24 hours of Django tutorials/talks and almost nothing to
> other web frameworks). Of course the Django tutorials were the most
> popular since by filtering out smaller communities the Django users
> were the largest community represented at PyCon. The result is that
> almost nobody from our list of 1600 people attended PyCon 2010. This
> is not a problem for us as much as it is a problem for PyCon and the
> Python community in general.
>
> Although I have published some technical comparisons between web2py
> and Django (as well as between web2py and other web frameworks) you
> will not find any post from me or other members less than deferential
> towards Django. Although, unfortunately, the opposite is not true,
> negative remarks tend to come from the low end of the food chain. In
> fact top Django developers and contributors are nice, intelligent and
> friendly people.
>
> Moreover I am not convinced at all that the Django community is
> particularly hostile to web2py. It is just very large so it is more
> likely that some particularly vocal people belong to it. The people
> who have been most annoying online (and I know who they are) are not
> Django cheerleaders either.
>
> Some people have been 

[web2py] Re: * web2py's Brand *

2010-03-04 Thread villas
Hi John

I'm sure that many of us are grateful for your own contributions with
slices etc and realise that you wouldn't be making them if you didn't
see any future; that wouldn't make any sense at all, so your comments
are probably a little tongue in cheek.

Similarly if you thought that Pycon was such an irrelevancy,  perhaps
you shouldn't have brought up the topic in the first place.  It seems
perverse to bring it up and then criticize someone else for discussing
it.  But many of us will just smile at that!

You seem to have missed the fact that many great projects begin with
the inspiration of one person who picks up followers on his route to
success.  Most of us believe that Web2py will be a great success, but
who knows?  Many of us choose Web2py despite any extra future risk,
because we believe it has sufficient merits to compensate.

I am not sure about the relevancy of your own observations here about
multi-billion corporations, but one thing's for sure,  they not
evolving at our pace, and most of us are streets behind Massimo!

--David


On Mar 4, 10:40 pm, John Heenan  wrote:
> A brand must outlast individuals. As such Web2py is not a recognised
> and accepted brand.
>
> Web2py is exclusively managed by a single academic who gets uptight
> about issues that are not relevant to Web2py and for which the time he
> puts into Web2py does not provide him with significant financial or
> academic reward.
>
> I expect it will only be a matter of time before Massimo decides he
> has had enough and decides to moves on. I am not complaining. I am
> only stating what I expect.  Will web2py will continue to survive?
> Hardly.
>
> From an enterprise perspective having a project largely tied to a
> single person is never good. For example I have seen an earnings
> forecast from a multi billion dollar corporation pushing new
> technologies stating a risk for prospectors is whether key personnel
> continue to stay with the company or not.
>
> I and many others do not care what the real motivations for web2py
> are. Frankly they are irrelevant. The fact that Massimo has chosen in
> his reply below to concentrate on a narrow and irrelevant aspect of
> web2py speaks volumes. That irrelevant aspect is the failure of web2py
> to be accepted in the desired manner at PyCon. PyCon itself is
> irrelevant and unimportant to the vast majority of us.
>
> John Heenan
>
> On Mar 4, 1:02 pm, mdipierro  wrote:
>
> > On Mar 3, 7:23 pm, John Heenan  wrote:
>
> > > On Mar 4, 2:17 am, mdipierro  wrote:
>
> > > > Some of the answers are funny. Mostly they are consistent with one
> > > > exception.
> > > > Perhaps a web2py hat is better than a t-shirt. I lost mine last
> > > > summer. :-(
>
> > > Rather flippant given that someone has gone to some effort to set up a
> > > survey to help out Web2py and that the survey responses were careful.
>
> > Perhaps my comment did not come out right. This was a good idea. When
> > I said some some of the answers are "funny" I meant it in a positive
> > sense. Perhaps I did not translated the concept I have in my mind
> > ("simpatiche" in Italian) in the proper english.
>
> > > As I see it the real goal of Web2py is to become more popular than
> > > Django. I do not see this as healthy.
>
> > I do not think this is the goal. I think the future of python
> > frameworks is correlated, not anti-correlated.
>
> > > Like it or not, for whatever reasons the Python community is
> > > interested in Django and not in Web2py, as evidenced through
> > > democratic votes of PyCon participants about what participants want to
> > > attend presentations about.
>
> > I was part of the process so I have something to add about this. For
> > three years there has been no talk and no tutorials about web2py,
> > although for three years I have submitted proposals. I was on a panel
> > discussion at PyCon 2009 because Guido stepped in and told them
> > excluding web2py was unfair. I was invited to a panel discussion at
> > PyCon 2010 but I did not go because 5 minutes of air time are not
> > worth the costs.
> > It is not the participants making the choice but a small set of
> > organizers. The decision process by the organizers is indeed
> > democratic (one person one vote) and I was one of them, but the rules
> > are debatable because the goal is unclear. One problem is that
> > basically few people participate to all rounds of discussions and in
> > practice it takes only one or two people to essentially veto a talk.
> > Some people when confronted with the choice tend to give a preference
> > to talks that they perceive to be more popular (for example Django vs
> > TG or web.py or web2py) and to "good speakers" defined as those who
> > have already presented at PyCon before. I have argued that the goal of
> > PyCon should be to broaden the audience (identify medium/large sub-
> > communities and give them representation) as opposed to consolidate
> > existing audience by giving a majority premium to largest communiti

[web2py] Re: web2py 1.76.2 is OUT - testing cron

2010-03-04 Thread Rowdy

mdipierro wrote:

ok, in trunk. Thanks for your help with this.

On Mar 3, 8:42 pm, Rowdy  wrote:


Bad news.  I left it running overnight with the 5 and 10 minute jobs and
the check for >= 59 seconds, logging the extra debug messages.

The lowest values for the interval were (these are just the debug
messages where I log the values used in the calculation and comparison):

DEBUG:root:   self.now - start = 59.441123 (sb >= 59)
DEBUG:root:   self.now - start = 59.7331020832 (sb >= 59)
DEBUG:root:   self.now - start = 59.8089871407 (sb >= 59)
DEBUG:root:   self.now - start = 59.9066801071 (sb >= 59)
DEBUG:root:   self.now - start = 59.9478530884 (sb >= 59)
DEBUG:root:   self.now - start = 59.9600059986 (sb >= 59)
DEBUG:root:   self.now - start = 59.9605009556 (sb >= 59)
DEBUG:root:   self.now - start = 59.9644701481 (sb >= 59)
DEBUG:root:   self.now - start = 59.9700820446 (sb >= 59)
DEBUG:root:   self.now - start = 59.970317 (sb >= 59)
DEBUG:root:   self.now - start = 59.9742279053 (sb >= 59)
DEBUG:root:   self.now - start = 59.9745769501 (sb >= 59)
DEBUG:root:   self.now - start = 59.9763190746 (sb >= 59)
DEBUG:root:   self.now - start = 59.9764039516 (sb >= 59)
DEBUG:root:   self.now - start = 59.9764339924 (sb >= 59)
DEBUG:root:   self.now - start = 59.9844388962 (sb >= 59)
DEBUG:root:   self.now - start = 59.9874939919 (sb >= 59)
DEBUG:root:   self.now - start = 59.9896328449 (sb >= 59)
DEBUG:root:   self.now - start = 59.9899420738 (sb >= 59)
DEBUG:root:   self.now - start = 59.9899940491 (sb >= 59)
DEBUG:root:   self.now - start = 59.9899971485 (sb >= 59)
DEBUG:root:   self.now - start = 59.9899971485 (sb >= 59)

Testing for a delay of 59.99 seconds would mean that any cron jobs
scheduled to run on the above 22 occasions would not run as
Token.acquire() would not obtain a lock.

To me this is significant, as the possibility exists that a once a day
job might fall on an execution time where the interval is between 59 and
59.99 seconds (as in the above 23 seconds) and not run.  When cron
starts up a minute later, the job has lost its opportunity to run, and
that day is skipped (for the once a day job).

I have not started writing the cron jobs for my app yet (there are about
a dozen), so I will see how it goes when the jobs are in place.

But the main problem with jobs running every minute and regularly
skipping have been solved.

Thanx again.

Rowdy

--
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: New Code-Editor

2010-03-04 Thread Wiiboy
Anyone you could do a check for browsers (as far as I know, the only
browser the wouldn't work with Bespin would be IE, so...) and use
Bespin or something if it's not IE, and Editarea if it is?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: New Code-Editor

2010-03-04 Thread Wiiboy


On Mar 4, 5:57 pm, Wiiboy  wrote:
> Anyone you could do a check for browsers

Oops, typoed.  Make that "Anyway you could do a check for browser" =p

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] KeyError on select after an insert()

2010-03-04 Thread compassiontara
Hi everyone.  I'm having an issue with select() working after an
insert.

See below for what I'm doing:

zulu ~/web2py % ./web2py.py -S welcome
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2010
Version 1.76.3 (2010-03-03 10:47:17)
Database drivers available: SQLite3
WARNING:root:import IPython error, use default python shell
Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> db=DAL('sqlite://test.db')
>>> db.define_table('test',Field('first','string'),Field('last','string'))

>>> db().select(db.test.id>0)

>>> db.test.insert(first='tara',last='birl')
1
>>> db().select(db.test.id>0)
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/tara/web2py/gluon/sql.py", line 3056, in select
return self.parse(db,rows,self.colnames)
  File "/Users/tara/web2py/gluon/sql.py", line 3073, in parse
field = table[fieldname]
  File "/Users/tara/web2py/gluon/sql.py", line 1556, in __getitem__
return dict.__getitem__(self, str(key))
KeyError: 'id>0'
>>> db.commit()
>>> db().select(db.test.id>0)
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/tara/web2py/gluon/sql.py", line 3056, in select
return self.parse(db,rows,self.colnames)
  File "/Users/tara/web2py/gluon/sql.py", line 3073, in parse
field = table[fieldname]
  File "/Users/tara/web2py/gluon/sql.py", line 1556, in __getitem__
return dict.__getitem__(self, str(key))
KeyError: 'id>0'

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: firebird error when tries to execute auth.defines_tables()

2010-03-04 Thread villas
'Password' is a reserved word and causes a problem in Firebird.  Try
this:

auth=Auth(globals(),db)
auth.settings.password_field='password2'   # Insert this line here.
auth.define_tables(migrate=False)

You can then work with a 'password2' field instead  :-)

Regards,
--David

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: CRUD.update TypeError: list indices must be integers, not str

2010-03-04 Thread mdipierro
Somehow one of your variables does not contain what you expect. Try
logging them:

@auth.requires_login()
def edit():
  print request.vars['tbl'], request.vars['id']
  form_edit = crud.update(db[request.vars['tbl']],
request.vars['id'])

what do you see?

On Mar 4, 9:10 am, kachna  wrote:
> Hi all,
> I use CRUD.update to generate update form. After submit this form a
> receive:
>
> TypeError: list indices must be integers, not str
>
> MODEL:
>
> db.define_table('runner',
>   Field('name','string'),
>   Field('male','integer',requires=IS_INT_IN_RANGE(0, 2))
> )
>
> CONTROLLER:
>
> @auth.requires_login()
> def edit():
>   form_edit = crud.update(db[request.vars['tbl']], request.vars['id'])
>
>   return dict(form=form_edit)
>
> COMPLETE ERROR:
> Traceback (most recent call last):
>   File "/home/kachna/work/web2py/gluon/restricted.py", line 173, in
> restricted
>     exec ccode in environment
>   File "/home/kachna/work/web2py/applications/CHTrainCup/controllers/
> admin.py", line 42, in 
>   File "/home/kachna/work/web2py/gluon/globals.py", line 96, in
> 
>     self._caller = lambda f: f()
>   File "/home/kachna/work/web2py/gluon/tools.py", line 1863, in f
>     return action(*a, **b)
>   File "/home/kachna/work/web2py/applications/CHTrainCup/controllers/
> admin.py", line 38, in edit
>     form_edit = crud.update(db[request.vars['tbl']],
> request.vars['id'])
>   File "/home/kachna/work/web2py/gluon/tools.py", line 2353, in update
>     upload=self.settings.download_url,
>   File "/home/kachna/work/web2py/gluon/sqlhtml.py", line 640, in
> __init__
>     self.record_id = str(record['id'])
>
> Can anybody help me? thx

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: online book correction protocol

2010-03-04 Thread mdipierro
The fact is that some new users may want to be able to report issues
(and they can edit errata) but they cannot edit the book.

On Mar 4, 9:51 am, DenesL  wrote:
> Inhttp://groups.google.com/group/web2py/msg/7b9661eac4f788e0Massimo
> said:
>
> - - - - - -  - - - - - -
> I made some of you editors (if you are not and want to be just ask)
>
> Please follow these few rules:
>
> - Try use wiki instead of editing book section
> - Do not rearrange or edit text in book sections (*) but limit
> yourself to
> - Fix errors
> - Add paragraphs about new features
> - If you save many times go to the "log" page (bottom of section) and
> delete intermediate archived pages. You can also see the history of
> changes there.
>
> (*) because it would make a nightmare for me to diff and correct the
> latex book.
> - - - - - -  - - - - - -
>
> Alsohttp://web2py.com/book/default/wikipage/how-to-contribute
>
> - - - - - -  - - - - - -
> How to contribute
>
> You have contributed code to web2py and want to contribute with
> documentation about that code, it should go in the main book, not in a
> wiki page. Please email me if you need need full editor permissions.
>
> The wiki are mostly for recipes and test cases.
>
> The threaded discussion IS NOT a place to ask questions. Questions
> will be deleted.
> - - - - - -  - - - - - -
>
> But there ishttp://web2py.com/book/default/wikipage/errata
> which IMO should not exist, all errata corrections must be done to the
> book itself.
>
> Denes.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: * web2py's Brand *

2010-03-04 Thread mdipierro
I agree with most of this with some caveats.

 Even if a project is open source somebody must be responsible for
ownership of the trademark and copyright (even if it is declared to be
GPL somebody has to be responsible for making that statement). Usually
it is a company or a foundation (which is also a company) and
companies unless they are public are owned by one or few people (look
ate Rails and 37 signals). I have not formed a company yet because I
do not see what difference it makes if I own the trademark of if a
company that I own owns the trademark.

I am interested instead in forming a company or perhaps an association
or a consortium for the purpose of helping users get consulting
contracts, help them with legal matters, and prove long term support
to their clients.

I am not sure what the best way to go about this. I am not sure what
the legal status of such entity should be. One year ago we had long
discussion on this list about creating an Open Source Corporation,
whatever that means. Some have suggested a consortium of small
companies that provide web2py support, some have proposed an
association that provides certification. Nothing happened but I am
still very much interested in this and very much interested in
suggestions.

Massimo

On Mar 4, 4:40 pm, John Heenan  wrote:
> A brand must outlast individuals. As such Web2py is not a recognised
> and accepted brand.
>
> Web2py is exclusively managed by a single academic who gets uptight
> about issues that are not relevant to Web2py and for which the time he
> puts into Web2py does not provide him with significant financial or
> academic reward.
>
> I expect it will only be a matter of time before Massimo decides he
> has had enough and decides to moves on. I am not complaining. I am
> only stating what I expect.  Will web2py will continue to survive?
> Hardly.
>
> From an enterprise perspective having a project largely tied to a
> single person is never good. For example I have seen an earnings
> forecast from a multi billion dollar corporation pushing new
> technologies stating a risk for prospectors is whether key personnel
> continue to stay with the company or not.
>
> I and many others do not care what the real motivations for web2py
> are. Frankly they are irrelevant. The fact that Massimo has chosen in
> his reply below to concentrate on a narrow and irrelevant aspect of
> web2py speaks volumes. That irrelevant aspect is the failure of web2py
> to be accepted in the desired manner at PyCon. PyCon itself is
> irrelevant and unimportant to the vast majority of us.
>
> John Heenan
>
> On Mar 4, 1:02 pm, mdipierro  wrote:
>
> > On Mar 3, 7:23 pm, John Heenan  wrote:
>
> > > On Mar 4, 2:17 am, mdipierro  wrote:
>
> > > > Some of the answers are funny. Mostly they are consistent with one
> > > > exception.
> > > > Perhaps a web2py hat is better than a t-shirt. I lost mine last
> > > > summer. :-(
>
> > > Rather flippant given that someone has gone to some effort to set up a
> > > survey to help out Web2py and that the survey responses were careful.
>
> > Perhaps my comment did not come out right. This was a good idea. When
> > I said some some of the answers are "funny" I meant it in a positive
> > sense. Perhaps I did not translated the concept I have in my mind
> > ("simpatiche" in Italian) in the proper english.
>
> > > As I see it the real goal of Web2py is to become more popular than
> > > Django. I do not see this as healthy.
>
> > I do not think this is the goal. I think the future of python
> > frameworks is correlated, not anti-correlated.
>
> > > Like it or not, for whatever reasons the Python community is
> > > interested in Django and not in Web2py, as evidenced through
> > > democratic votes of PyCon participants about what participants want to
> > > attend presentations about.
>
> > I was part of the process so I have something to add about this. For
> > three years there has been no talk and no tutorials about web2py,
> > although for three years I have submitted proposals. I was on a panel
> > discussion at PyCon 2009 because Guido stepped in and told them
> > excluding web2py was unfair. I was invited to a panel discussion at
> > PyCon 2010 but I did not go because 5 minutes of air time are not
> > worth the costs.
> > It is not the participants making the choice but a small set of
> > organizers. The decision process by the organizers is indeed
> > democratic (one person one vote) and I was one of them, but the rules
> > are debatable because the goal is unclear. One problem is that
> > basically few people participate to all rounds of discussions and in
> > practice it takes only one or two people to essentially veto a talk.
> > Some people when confronted with the choice tend to give a preference
> > to talks that they perceive to be more popular (for example Django vs
> > TG or web.py or web2py) and to "good speakers" defined as those who
> > have already presented at PyCon before. I have argued that the goal of
> > PyCon s

[web2py] Re: web2py 1.76.2 is OUT - testing cron

2010-03-04 Thread mdipierro
Let's think about this some more

On Mar 4, 5:43 pm, Rowdy  wrote:
> mdipierro wrote:
> > ok, in trunk. Thanks for your help with this.
>
> > On Mar 3, 8:42 pm, Rowdy  wrote:
>
> Bad news.  I left it running overnight with the 5 and 10 minute jobs and
> the check for >= 59 seconds, logging the extra debug messages.
>
> The lowest values for the interval were (these are just the debug
> messages where I log the values used in the calculation and comparison):
>
> DEBUG:root:       self.now - start = 59.441123 (sb >= 59)
> DEBUG:root:       self.now - start = 59.7331020832 (sb >= 59)
> DEBUG:root:       self.now - start = 59.8089871407 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9066801071 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9478530884 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9600059986 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9605009556 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9644701481 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9700820446 (sb >= 59)
> DEBUG:root:       self.now - start = 59.970317 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9742279053 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9745769501 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9763190746 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9764039516 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9764339924 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9844388962 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9874939919 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9896328449 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9899420738 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9899940491 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9899971485 (sb >= 59)
> DEBUG:root:       self.now - start = 59.9899971485 (sb >= 59)
>
> Testing for a delay of 59.99 seconds would mean that any cron jobs
> scheduled to run on the above 22 occasions would not run as
> Token.acquire() would not obtain a lock.
>
> To me this is significant, as the possibility exists that a once a day
> job might fall on an execution time where the interval is between 59 and
> 59.99 seconds (as in the above 23 seconds) and not run.  When cron
> starts up a minute later, the job has lost its opportunity to run, and
> that day is skipped (for the once a day job).
>
> I have not started writing the cron jobs for my app yet (there are about
> a dozen), so I will see how it goes when the jobs are in place.
>
> But the main problem with jobs running every minute and regularly
> skipping have been solved.
>
> Thanx again.
>
> Rowdy

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: KeyError on select after an insert()

2010-03-04 Thread mdipierro
It is not

>>> db().select(db.test.id>0)

but

>>> db(db.test.id>0).select()

db(condition).select(*fields,orderby=..,groupby=...,limitby=...,cache=...,distinct=...)

On Mar 4, 5:26 pm, compassiontara  wrote:
> Hi everyone.  I'm having an issue with select() working after an
> insert.
>
> See below for what I'm doing:
>
> zulu ~/web2py % ./web2py.py -S welcome
> web2py Enterprise Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2010
> Version 1.76.3 (2010-03-03 10:47:17)
> Database drivers available: SQLite3
> WARNING:root:import IPython error, use default python shell
> Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12)
> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)>>> db=DAL('sqlite://test.db')
> >>> db.define_table('test',Field('first','string'),Field('last','string'))
>
> >>> db().select(db.test.id>0)
>
> >>> 
> db.test.insert(first='tara',last='birl')
> 1
> >>> db().select(db.test.id>0)
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/Users/tara/web2py/gluon/sql.py", line 3056, in select
>     return self.parse(db,rows,self.colnames)
>   File "/Users/tara/web2py/gluon/sql.py", line 3073, in parse
>     field = table[fieldname]
>   File "/Users/tara/web2py/gluon/sql.py", line 1556, in __getitem__
>     return dict.__getitem__(self, str(key))
> KeyError: 'id>0'>>> db.commit()
> >>> db().select(db.test.id>0)
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/Users/tara/web2py/gluon/sql.py", line 3056, in select
>     return self.parse(db,rows,self.colnames)
>   File "/Users/tara/web2py/gluon/sql.py", line 3073, in parse
>     field = table[fieldname]
>   File "/Users/tara/web2py/gluon/sql.py", line 1556, in __getitem__
>     return dict.__getitem__(self, str(key))
> KeyError: 'id>0'

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: ajax list/detail view design pattern

2010-03-04 Thread mdipierro
true you have a choice but they are all the same:

class FORM it is built on helpers
class SQLFORM(FORM) extends a FORM

crud.update and crud.create are just two functions that to

form=SQLFORM(...)
if form.accepts(...):
return form

so they return a SQLFORM with is a FORM and which can be manipulated
as any other helper, for example

form=crud.create(db.mytable)
form.element(_name='myfield')['_class']='myclass'

(it adds a class 'myclass' to the INPUT field for field 'myfield')


On Mar 4, 11:39 am, snfctech  wrote:
> So the form helpers are only useful for record-level input or basic
> list displays, and everything else needs to be hand-coded?  I wish
> there was a way to use the helpers in a more flexible fashion, so
> there could be "one obvious way" to display forms for creating,
> reading, updating and deleting.  As it stands, it looks like some of
> my forms will get to live in CRUD, some in SQLFORM, and some in for
> loops with markup.  That seems un-elegant to me.
>
> On Mar 4, 9:12 am, Thadeus Burgess  wrote:
>
> > I hand write html, and use tr id="123" or tr record_id="123"
>
> > and use
>
> > jQuery("tr").click(function(){$(this).parent().attr("record_id")})
>
> > -Thadeus
>
> > On Thu, Mar 4, 2010 at 10:56 AM, snfctech  wrote:
> > > I am fond of a design pattern whereby a list of records (such as
> > > orders) is displayed in the top part of a view and the detail for a
> > > highlighted record is displayed in the lower part of the view via AJAX
> > > onclick (such as the customer and product details for the order).
>
> > > I like web2py because I want a "higher-level" tool that allows be to
> > > do more with less code.  But when I tried implementing my favorite
> > > design pattern with the web2py CRUD and AJAX helpers, I found the code
> > > to be quite awkward, namely:
>
> > >  I give the list view table and id as a CRUD parameter which I use to
> > > add the onclick event to the table rows on domready:
>
> > >    order_list = crud.select(db.os_order,_id='order_list',...
>
> > > and:
>
> > >    $('#order_list tbody tr').click(function() {
> > >        var order_id = $(this).find('.order_id').attr('id');
> > >        ajax('default/orderdetail',[order_id],'order_detail_div');
> > >    });
>
> > > But here's the really ugly part of the design:
>
> > > In order to get the record id I have to represent my ID field with a
> > > hidden INPUT element:
>
> > >    db.os_order.id.represent = lambda value: (value,
> > > INPUT(_type='hidden', _id=value,_value=value, _class='order_id'))
>
> > > And in order to uniquely identify the element and pass it's value to
> > > the web2py AJAX helper I give the record ID as both it's "id" and
> > > "value" attributes.  Which leads to the unhappy retrieval in the
> > > controller by means of:
>
> > >    order_id = list(request.vars)[0]
>
> > > All of this seems a bit un-elegant, don't you think?  I guess I could
> > > do away with the web2py AJAX helper and use a for loop to add
> > > id="order_123" to my table rows, but now I'm back to building forms
> > > from scratch - so what's the point of the web2py high-level helpers?
>
> > > If somebody could point out a way to implement this design pattern in
> > > a more elegant fashion by still leveraging web2py form helpers, it
> > > would be much appreciated.
>
> > > Thanks.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > web2py+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Ext JS REST Grid + WEB2PY CRUD ?

2010-03-04 Thread mdipierro
Although this can be done I need to look more in details at thos ExtJS
libraries.
As a related issue I think we can improve crud to make it more
restful. Currently crud create and crud update do take json imput
(look at the code) but no json output (unless you make your own *.json
view). I will try write some examples asap.

On Mar 4, 10:52 am, AsmanCom  wrote:
> Hi,
>
> yeah i´ve to expose CRUD functions by JSON or XML to the JS client.
> Like ist done here in 
> PHP:http://www.extjs.com/deploy/dev/examples/writer/writer.html
>
> But I need an Code example for web2py, I think.
>
> That should be simple right? Because it has all been done before
> Should be similar connecting web2py to JQ Datatables?
>
> What i need is an Real-Time DB view such 
> as:http://www.extjs.com/deploy/dev/examples/direct/direct.php
>
> But connected to web2py
>
> Can anybody help me up?
>
> Thank you in advance.
>
> Dieter Asman
>
> On 3 Mrz., 01:26, "mr.freeze"  wrote:
>
> > I would use an xml service to feed the grid data instead.
>
> >http://web2py.com/book/default/section/9/2?search=%40service.xmlhttp:...
>
> > On Mar 2, 7:35 am, AsmanCom  wrote:
>
> > > Hi,
>
> > > any idea how to make the Ext JS Grids woking with 
> > > WEB2PY?http://www.extjs.com/deploy/dev/examples/#sample-3
>
> > > In particular the RESTful 
> > > Store:http://www.extjs.com/deploy/dev/examples/restful/restful.html
>
> > > I think it must be connected to CRUD somehow?
> > > Any Examples to connect such JS Grids to the WEB2PY DB ?
>
> > > Thank you in advance.
>
> > > Dieter Asman

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] cas_auth.py

2010-03-04 Thread mdipierro
thanks to Gyuris Szabolcs we have a working gluon/contrib/
login_methods/cas_auth.py

Let us know if you give it a try.

massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: cas_auth.py

2010-03-04 Thread mdipierro
btw... the cas service is not at https://web2py.com/cas

On Mar 4, 9:48 pm, mdipierro  wrote:
> thanks to Gyuris Szabolcs we have a working gluon/contrib/
> login_methods/cas_auth.py
>
> Let us know if you give it a try.
>
> massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: cas_auth.py

2010-03-04 Thread mdipierro
btw... the cas service is *NOW* at https://web2py.com/cas

On Mar 4, 9:49 pm, mdipierro  wrote:
> btw... the cas service is not athttps://web2py.com/cas
>
> On Mar 4, 9:48 pm, mdipierro  wrote:
>
> > thanks to Gyuris Szabolcs we have a working gluon/contrib/
> > login_methods/cas_auth.py
>
> > Let us know if you give it a try.
>
> > massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Dream Host Deployment

2010-03-04 Thread Jesse
Looks like setting up self signed SSL on dreamhost requires a unique
IP (for extra $) which I'm not exactly up for just to learn web2py
(yes I know I can run it on my own computer).

As for I believe doing an SSH tunnel I don't entirely see how that
would let me log into the admin pages.

Any other ways?

On Mar 4, 12:45 pm, Jesse  wrote:
> Using virtualenv seemed to do the trick.
>
> Although, I'm sure it doesn't matter now when I ran "import dbhash" I
> got a several line long error:
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/home/username/opt//lib/python2.5/dbhash.py", line 5, in
> 
>     import bsddb
>   File "/home/username/opt//lib/python2.5/bsddb/__init__.py", line 51,
> in 
>     import _bsddb
> ImportError: No module named _bsddb
>
> Another question: Any tips on getting into the Admin screens via
> https? or at least without removing the security.
> I'm guessing something like a self signed key will likely work, but
> I'm unfamiliar.
> I 
> found:http://web2py.com/AlterEgo/default/show/140http://web2py.com/AlterEgo/default/show/143
>
> I haven't tried either yet, but I hate running stuff without really
> knowing what they're supposed to do since you can end up doing
> unforeseen things.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: online book correction protocol

2010-03-04 Thread DenesL

So the entries in errata are finding their way into the book and are
being deleted afte, right?.

On Mar 4, 9:39 pm, mdipierro  wrote:
> The fact is that some new users may want to be able to report issues
> (and they can edit errata) but they cannot edit the book.
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: firebird error when tries to execute auth.defines_tables()

2010-03-04 Thread Thadeus Burgess
Also I added support so the DAL can check reserved SQL keywords.

http://web2py.com/book/default/section/6/2

-Thadeus





On Thu, Mar 4, 2010 at 7:35 PM, villas  wrote:
> 'Password' is a reserved word and causes a problem in Firebird.  Try
> this:
>
> auth=Auth(globals(),db)
> auth.settings.password_field='password2'   # Insert this line here.
> auth.define_tables(migrate=False)
>
> You can then work with a 'password2' field instead  :-)
>
> Regards,
> --David
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: uservoice and decimal

2010-03-04 Thread Richard
admins (which includes Massimo) can set it to done.

I think the decimal question was a fair one given it wasn't documented
yet.


On Mar 5, 5:05 am, Thadeus Burgess  wrote:
> Can others besides the question creator mark something as DONE?
>
> -Thadeus
>
>
>
> On Thu, Mar 4, 2010 at 12:03 PM, waTR  wrote:
> > That's no big deal, just mark the suggestion as DONE, and put a
> > comment about the existence of this feature...
>
> > On Mar 4, 7:29 am, DenesL  wrote:
> >> Other that pointing them in the right direction?.
>
> >> On Mar 4, 8:06 am, mdipierro  wrote:
>
> >> > There is a comment on uservoice about decimal.
>
> >> > DAL already has support for decimal although it is not documented in
> >> > the book. On SQLite it is mapped into "double" because SQLite does not
> >> > have native "decimal" but it works well on other databases.
>
> >> >     Field('money','decimal(10,3)') for 3 decimals.
>
> >> > I did not delete the comment but somebody perhaps should or edit it
> >> > since it may give the wrong impression to new users.
>
> >> > There are other comments with wishes that have already been granted or
> >> > are not clear. This confuses new users. Who should we deal with them?
>
> >> > Massimo
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: Dream Host Deployment

2010-03-04 Thread Thadeus Burgess
When I ran web2py  on dreamhost I just edited my admin application and
removed the checks for https.

Of course your best option is to use a ssh tunnel, forward the port 80
of the server to your local port 8080 or something, since admin allows
any localhost connections to access it will work.

-Thadeus





On Thu, Mar 4, 2010 at 10:01 PM, Jesse  wrote:
> Looks like setting up self signed SSL on dreamhost requires a unique
> IP (for extra $) which I'm not exactly up for just to learn web2py
> (yes I know I can run it on my own computer).
>
> As for I believe doing an SSH tunnel I don't entirely see how that
> would let me log into the admin pages.
>
> Any other ways?
>
> On Mar 4, 12:45 pm, Jesse  wrote:
>> Using virtualenv seemed to do the trick.
>>
>> Although, I'm sure it doesn't matter now when I ran "import dbhash" I
>> got a several line long error:
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File "/home/username/opt//lib/python2.5/dbhash.py", line 5, in
>> 
>>     import bsddb
>>   File "/home/username/opt//lib/python2.5/bsddb/__init__.py", line 51,
>> in 
>>     import _bsddb
>> ImportError: No module named _bsddb
>>
>> Another question: Any tips on getting into the Admin screens via
>> https? or at least without removing the security.
>> I'm guessing something like a self signed key will likely work, but
>> I'm unfamiliar.
>> I 
>> found:http://web2py.com/AlterEgo/default/show/140http://web2py.com/AlterEgo/default/show/143
>>
>> I haven't tried either yet, but I hate running stuff without really
>> knowing what they're supposed to do since you can end up doing
>> unforeseen things.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] ticket FLOAT8

2010-03-04 Thread weheh
This didn't used to issue a ticket until today. The only change I made
was to add a new table to my db. Any idea what might be causing this?
The db field is this:

  db.Field('offset','double',requires=IS_FLOAT_IN_RANGE(-12.0,12.0)),


Traceback (most recent call last):
  File "gluon/restricted.py", line 173, in restricted
exec ccode in environment
  File "/web2py/applications/myapp/models/C_db.py", line 175, in

 
db.Field('offset','double',requires=IS_FLOAT_IN_RANGE(-12.0,12.0)),
  File "gluon/sql.py", line 1275, in define_table
t._create(migrate=migrate, fake_migrate=fake_migrate)
  File "gluon/sql.py", line 1694, in _create
self._db._execute(query)
  File "gluon/sql.py", line 958, in 
self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
ProgrammingError: syntax error at or near "offset"
LINE 4: offset FLOAT8

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



Re: [web2py] Re: cas_auth.py

2010-03-04 Thread Andrew Thompson

On 3/4/2010 10:49 PM, mdipierro wrote:

btw... the cas service is *NOW* at https://web2py.com/cas
   
When you say the service is *NOW* at https://web2py.com/cas, you mean 
it's no longer at https://mdp.cti.depaul.edu/cas the link on wikipedia, 
correct?


(I had to look up CAS to find out what it was.)

--
Andrew Thompson

--
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: online book correction protocol

2010-03-04 Thread mdipierro
more then deleted, marked as fixed.

On Mar 4, 10:07 pm, DenesL  wrote:
> So the entries in errata are finding their way into the book and are
> being deleted afte, right?.
>
> On Mar 4, 9:39 pm, mdipierro  wrote:
>
> > The fact is that some new users may want to be able to report issues
> > (and they can edit errata) but they cannot edit the book.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: uservoice and decimal

2010-03-04 Thread mdipierro
good to know. thanks


On Mar 4, 10:17 pm, Richard  wrote:
> admins (which includes Massimo) can set it to done.
>
> I think the decimal question was a fair one given it wasn't documented
> yet.
>
> On Mar 5, 5:05 am, Thadeus Burgess  wrote:
>
> > Can others besides the question creator mark something as DONE?
>
> > -Thadeus
>
> > On Thu, Mar 4, 2010 at 12:03 PM, waTR  wrote:
> > > That's no big deal, just mark the suggestion as DONE, and put a
> > > comment about the existence of this feature...
>
> > > On Mar 4, 7:29 am, DenesL  wrote:
> > >> Other that pointing them in the right direction?.
>
> > >> On Mar 4, 8:06 am, mdipierro  wrote:
>
> > >> > There is a comment on uservoice about decimal.
>
> > >> > DAL already has support for decimal although it is not documented in
> > >> > the book. On SQLite it is mapped into "double" because SQLite does not
> > >> > have native "decimal" but it works well on other databases.
>
> > >> >     Field('money','decimal(10,3)') for 3 decimals.
>
> > >> > I did not delete the comment but somebody perhaps should or edit it
> > >> > since it may give the wrong impression to new users.
>
> > >> > There are other comments with wishes that have already been granted or
> > >> > are not clear. This confuses new users. Who should we deal with them?
>
> > >> > Massimo
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > web2py+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: ticket FLOAT8

2010-03-04 Thread mdipierro
'offset' is a keyword and cannot be used as a field name

On Mar 4, 10:34 pm, weheh  wrote:
> This didn't used to issue a ticket until today. The only change I made
> was to add a new table to my db. Any idea what might be causing this?
> The db field is this:
>
>   db.Field('offset','double',requires=IS_FLOAT_IN_RANGE(-12.0,12.0)),
>
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 173, in restricted
>     exec ccode in environment
>   File "/web2py/applications/myapp/models/C_db.py", line 175, in
> 
>
> db.Field('offset','double',requires=IS_FLOAT_IN_RANGE(-12.0,12.0)),
>   File "gluon/sql.py", line 1275, in define_table
>     t._create(migrate=migrate, fake_migrate=fake_migrate)
>   File "gluon/sql.py", line 1694, in _create
>     self._db._execute(query)
>   File "gluon/sql.py", line 958, in 
>     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> ProgrammingError: syntax error at or near "offset"
> LINE 4:     offset FLOAT8

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: cas_auth.py

2010-03-04 Thread mdipierro
I cannot control the DNS for mdp.cti.depaul.edu and currently it is
down.
I will try point it to web2py.com.

On Mar 4, 10:36 pm, Andrew Thompson  wrote:
> On 3/4/2010 10:49 PM, mdipierro wrote:> btw... the cas service is *NOW* 
> athttps://web2py.com/cas
>
> When you say the service is *NOW* athttps://web2py.com/cas, you mean
> it's no longer athttps://mdp.cti.depaul.edu/casthe link on wikipedia,
> correct?
>
> (I had to look up CAS to find out what it was.)
>
> --
> Andrew Thompson

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: ticket FLOAT8 [CLOSED]

2010-03-04 Thread weheh
urg. thanks. I just moved from MySQL to postgresql, so that must be
why it's being flagged, now.

On Mar 4, 11:46 pm, mdipierro  wrote:
> 'offset' is a keyword and cannot be used as a field name
>
> On Mar 4, 10:34 pm, weheh  wrote:
>
> > This didn't used to issue a ticket until today. The only change I made
> > was to add a new table to my db. Any idea what might be causing this?
> > The db field is this:
>
> >   db.Field('offset','double',requires=IS_FLOAT_IN_RANGE(-12.0,12.0)),
>
> > Traceback (most recent call last):
> >   File "gluon/restricted.py", line 173, in restricted
> >     exec ccode in environment
> >   File "/web2py/applications/myapp/models/C_db.py", line 175, in
> > 
>
> > db.Field('offset','double',requires=IS_FLOAT_IN_RANGE(-12.0,12.0)),
> >   File "gluon/sql.py", line 1275, in define_table
> >     t._create(migrate=migrate, fake_migrate=fake_migrate)
> >   File "gluon/sql.py", line 1694, in _create
> >     self._db._execute(query)
> >   File "gluon/sql.py", line 958, in 
> >     self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
> > ProgrammingError: syntax error at or near "offset"
> > LINE 4:     offset FLOAT8

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: * web2py's Brand *

2010-03-04 Thread Mengu
The question here is how do we get more people know and use web2py. is
it releasing some widely used and mostly needed applications developed
with web2py? or a big web site that is developed with web2py? as far
as i know django doesn't power, for example a social network that is
widely used. but why people prefer django? because of its
documentation? because of it is advertised and suggested everywhere?
should we provide some command line tools? is appadmin a bad idea? are
people scared of it? do they just want to fire up their terminals and
start writing things? another question is what /should/ web2py have
that others don't. we can study on them, we can add more features. we
cannot say web2py is not growing, it is growing pretty fast, we are
seeing new faces every day in the group or IRC. more people know
web2py more they like it.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: New features not documented in Book (2 ed)

2010-03-04 Thread Christopher Steel
How about this,

Create a script to rename the app as follows

Myappname-hide

Now the app will "disappear" in the web2py interface.



The app (and everything in the app directory) remain, but Will no
longer show up in web2py because the folder name contains a "-"
hyphen.

You need to test, but might do the trick easily. To "undelete /
recycle" you remove the hyphen. Will that work for you?

Chris


On Mar 3, 4:35 pm, Jonathan Lundell  wrote:
> On Mar 3, 2010, at 12:22 PM, mdipierro wrote:
>
> > you can already trash an application
>
> We want to trash the application, but not the application state (database, 
> etc).
>
> > On Mar 3, 1:34 pm, Yarko Tymciurak 
> > wrote:
> >> On Mar 3, 11:48 am, Dragonfyre13  wrote:
>
> >>> If it's untarred over the top of the old one, any files that are not
> >>> in the new tar file will be left there. Since an app is supposed to
> >>> kind of be self contained, shouldn't it remove the old app, and then
> >>> untar to the directory?
>
> >> A trivially simple way to handle this would be to have the concept of
> >> an application "trash can", where
> >> a current app would be moved to "trash", and a new one installed.
>
> >> Another way would be to literally have app-area per-application
> >> repositories (hg), and literall just "pull" the new app (including any
> >> file deletions) - but this would mean  the tar / w2p  file format
> >> giving way to /letting mercurial manage updates in these circumstances
> >> (which would probably not be bad).
>
> >> - Yarko
>
> >>> On Feb 16, 11:08 am, Jonathan Lundell  wrote:
>
>  On Feb 16, 2010, at 8:32 AM, DenesL wrote:
>
> > Thanks (it is copy/paste of the original).
> > Do you know of any docs on usage?.
>
>  On the admin app's app-installation page, there's a checkbox to enable 
>  overwriting of an uploaded app. If not checked, the behavior is the same 
>  as before: an attempt to install an app with the same name as an 
>  installed app fails. In the overwrite case, the new app simply gets 
>  untarred over the old app.
>
> > On Feb 16, 11:21 am, Jonathan Lundell  wrote:
> >> On Feb 16, 2010, at 7:16 AM, DenesL wrote:
>
> >>> New features not documented in Book (2nd edition)
>
> >>> 1.75.2
> >>> - no more cron with -S option
> >>> - ability to override/upgrade and app
>
> >> overwrite
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: * web2py's Brand *

2010-03-04 Thread John Heenan
We need to be realistic. Not well meaning.

Feel good statements that "most of us are streets behind Massimo" is
frankly impractical and unhelpful. Nor do I like the implication that
somehow I am 'not behind Massimo'. Also the multi billion company I
was referring to as an example of the has nothing to do with web
technology. It is a company that is part of a ruthless multi trillion
dollar real economy that helps provides the cheap equipment and the
enormous cash that floats around, and so allows web developers to
indulge their fantasies.

Let me spell it out.

A) Web2py is not popular, as evidenced by PyCon.
B) I provided evidence that attempting to make web2py popular is not
healthy and will potentially lead to the destruction of web2py
C) Massimo appears angst ridden by the non inclusion of web2py at
PyCon to a desired level. Regrettably this still needs to be properly
resolved.
D) However PyCon is frankly irrelevant and unimportant to web2py and
to most of us. Who cares about a bunch of largely self-important nerds
who desperatley need to be told they are loved, valued and important,
although some of course are important? I have posted before on this
issue from a social perpective at
http://www.google.com/url?url=http://groups.google.com/g/4247fb7b/t/2581102cdc95e75a/d/b32649dc01623837%3Fq%3D%23b32649dc01623837&ei=85-QS6j-KpjYkATprYHqBg&sa=t&ct=res&cd=2&source=groups&usg=AFQjCNFPrtwZCs9f2TZc-oZEKx5CojE6VQ
E) Projects that depend on a single person are risky, whether they be
opens source projects or private propriety projects backed by multi
billion dollar corpoation who issues warnings to investors they are
dependent on key personnel.
F) We cannot reasonably expect Massimo to keep up the pace he is. Also
there appears to be little in the way of financial and academic reward
for his efforts
G) Web2py is sufficiently different in style and and approach that the
current skill level and interest does not exist to take the load off
Massimo and let him just accept or reject patches. This appears to be
the Linux model and to a certain extent the Python model. For example
Guido do not write the new version of the GIL following the exposure
of the 'Beazly Effect'.
H) Massimo is now open to discussion about a foundation.

As I said, we need to be realistic. Not well meaning.

John Heenan


On Mar 5, 10:33 am, villas  wrote:
> Hi John
>
> I'm sure that many of us are grateful for your own contributions with
> slices etc and realise that you wouldn't be making them if you didn't
> see any future; that wouldn't make any sense at all, so your comments
> are probably a little tongue in cheek.
>
> Similarly if you thought that Pycon was such an irrelevancy,  perhaps
> you shouldn't have brought up the topic in the first place.  It seems
> perverse to bring it up and then criticize someone else for discussing
> it.  But many of us will just smile at that!
>
> You seem to have missed the fact that many great projects begin with
> the inspiration of one person who picks up followers on his route to
> success.  Most of us believe that Web2py will be a great success, but
> who knows?  Many of us choose Web2py despite any extra future risk,
> because we believe it has sufficient merits to compensate.
>
> I am not sure about the relevancy of your own observations here about
> multi-billion corporations, but one thing's for sure,  they not
> evolving at our pace, and most of us are streets behind Massimo!
>
> --David
>
> On Mar 4, 10:40 pm, John Heenan  wrote:
>
> > A brand must outlast individuals. As such Web2py is not a recognised
> > and accepted brand.
>
> > Web2py is exclusively managed by a single academic who gets uptight
> > about issues that are not relevant to Web2py and for which the time he
> > puts into Web2py does not provide him with significant financial or
> > academic reward.
>
> > I expect it will only be a matter of time before Massimo decides he
> > has had enough and decides to moves on. I am not complaining. I am
> > only stating what I expect.  Will web2py will continue to survive?
> > Hardly.
>
> > From an enterprise perspective having a project largely tied to a
> > single person is never good. For example I have seen an earnings
> > forecast from a multi billion dollar corporation pushing new
> > technologies stating a risk for prospectors is whether key personnel
> > continue to stay with the company or not.
>
> > I and many others do not care what the real motivations for web2py
> > are. Frankly they are irrelevant. The fact that Massimo has chosen in
> > his reply below to concentrate on a narrow and irrelevant aspect of
> > web2py speaks volumes. That irrelevant aspect is the failure of web2py
> > to be accepted in the desired manner at PyCon. PyCon itself is
> > irrelevant and unimportant to the vast majority of us.
>
> > John Heenan
>
> > On Mar 4, 1:02 pm, mdipierro  wrote:
>
> > > On Mar 3, 7:23 pm, John Heenan  wrote:
>
> > > > On Mar 4, 2:17 am, mdipierro  wrote:
>
> > > > > Some of the a

[web2py] Re: KeyError on select after an insert()

2010-03-04 Thread compassiontara
Thank you!

Mengu on irc helped make me all smart as well.

For completeness sakes in case someone else gets as dumb as me, a very
very quick reference, based on what I've learned today.

#make the DB.
db.define_table('tablename',Field('fieldname','type',options)


INSERT:
db.TABLENAME.insert(field=value,field=value)

UPDATE:
get object from query
object.update_record(field=value,field=value)

you *can* do this, but well
db.TABLENAME.id[id] = dict(field=value,field=value)


DELETE:
db(db.table.id == 5).delete()

QUERY:
db(WHERE CLAUSE).select(WHAT TO GET)

get first entry:
   object = db(where).select().first()



On Mar 4, 7:10 pm, mdipierro  wrote:
> It is not
>
> >>> db().select(db.test.id>0)
>
> but
>
> >>> db(db.test.id>0).select()
>
> db(condition).select(*fields,orderby=..,groupby=...,limitby=...,cache=...,distinct=...)
>
> On Mar 4, 5:26 pm, compassiontara  wrote:
>
> > Hi everyone.  I'm having an issue with select() working after an
> > insert.
>
> > See below for what I'm doing:
>
> > zulu ~/web2py % ./web2py.py -S welcome
> > web2py Enterprise Web Framework
> > Created by Massimo Di Pierro, Copyright 2007-2010
> > Version 1.76.3 (2010-03-03 10:47:17)
> > Database drivers available: SQLite3
> > WARNING:root:import IPython error, use default python shell
> > Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12)
> > [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.
> > (InteractiveConsole)>>> db=DAL('sqlite://test.db')
> > >>> db.define_table('test',Field('first','string'),Field('last','string'))
>
> > >>> db().select(db.test.id>0)
>
> > >>> 
> > db.test.insert(first='tara',last='birl')
> > 1
> > >>> db().select(db.test.id>0)
>
> > Traceback (most recent call last):
> >   File "", line 1, in 
> >   File "/Users/tara/web2py/gluon/sql.py", line 3056, in select
> >     return self.parse(db,rows,self.colnames)
> >   File "/Users/tara/web2py/gluon/sql.py", line 3073, in parse
> >     field = table[fieldname]
> >   File "/Users/tara/web2py/gluon/sql.py", line 1556, in __getitem__
> >     return dict.__getitem__(self, str(key))
> > KeyError: 'id>0'>>> db.commit()
> > >>> db().select(db.test.id>0)
>
> > Traceback (most recent call last):
> >   File "", line 1, in 
> >   File "/Users/tara/web2py/gluon/sql.py", line 3056, in select
> >     return self.parse(db,rows,self.colnames)
> >   File "/Users/tara/web2py/gluon/sql.py", line 3073, in parse
> >     field = table[fieldname]
> >   File "/Users/tara/web2py/gluon/sql.py", line 1556, in __getitem__
> >     return dict.__getitem__(self, str(key))
> > KeyError: 'id>0'

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] XMLRPC compression

2010-03-04 Thread Richard
Hello,

I am using XMLRPC to communicate between 2 separate apps:
http://web2py.com/book/default/section/9/2

Does this library compress/decompress the data, or would I need to do
that myself? (I will be transferring a lot of text)

Richard

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Polls doesn't work in GAE

2010-03-04 Thread mdmcginn
Thanks. Now the pages display successfully that show the poll results
and the voting options: http://localhost:8080/Polls/default/detail/9
and http://localhost:8080/Polls/default/results/9.
But when I voted, I got errors with http://localhost:8080/Polls/default/detail/9
- my vote wasn't saved. The error said, "non supported on GAE."

(I should say that I have two web2py applications deployed at once on
my local GAE environment: the original Polls and my own variation on
it which adds forms for adding poll questions and voting choices. So
that's how I'm adding question and choice records for Polls. I could
imagine that having two applications using the same tables could be a
problem.)

---

Controller:
@auth.requires_login()
def detail():
poll_id=request.args(0)
p = db.poll[poll_id]
if not p: raise HTTP(404)
# Has this person allready voted???
if db(db.recorded_votes.poll==p.id)
(db.recorded_votes.voter==auth.user.id).select():
session.flash="You have already voted on this question"
redirect(URL(r=request,f='results',args=p.id))
# add this
if request.vars:
selected_choice = db.choice[request.vars.choice]
if not selected_choice or selected_choice.poll!=p.id:
session.flash="Please select a valid choice"
redirect(URL(r=request,f='detail',args=p.id))
else:
selected_choice.update_record(votes=db.choice.votes+1)
# add the following line after adjusting the detail view below

db.recorded_votes.insert(voter=auth.user.id,poll=p.id)
redirect(URL(r=request,f='results',args=p.id))
return dict(poll=p)



Traceback (most recent call last):
  File "/home/michael/mycode/google_appengine/web2py/gluon/
restricted.py", line 173, in restricted
exec ccode in environment
  File "/home/michael/mycode/google_appengine/web2py/applications/
Polls/controllers/default.py:detail", line 93, in 
  File "/home/michael/mycode/google_appengine/web2py/gluon/
globals.py", line 96, in 
self._caller = lambda f: f()
  File "/home/michael/mycode/google_appengine/web2py/gluon/tools.py",
line 1850, in f
return action(*a, **b)
  File "/home/michael/mycode/google_appengine/web2py/applications/
Polls/controllers/default.py:detail", line 32, in detail
  File "/home/michael/mycode/google_appengine/web2py/gluon/sql.py",
line 3145, in 
i = id, **a: update_record(c, t, i, a)
  File "/home/michael/mycode/google_appengine/web2py/gluon/sql.py",
line 3268, in update_record
table._db(table.id==id).update(**c)
  File "/home/michael/mycode/google_appengine/web2py/gluon/contrib/
gql.py", line 718, in update
table[field].type, db)
  File "/home/michael/mycode/google_appengine/web2py/gluon/contrib/
gql.py", line 440, in obj_represent
raise SyntaxError, "non supported on GAE"
SyntaxError: non supported on GAE


On Mar 4, 1:13 am, "mr.freeze"  wrote:
> I think the problems is that poll doesn't have a foreign key to
> choice, it's the other way around. Try this:
> {{poll_choices = db(db.choice.poll==poll.id).select()}}
> {{ for choice in poll_choices: }}
>     {{=choice.choice }} -- {{=choice.votes }} vote{{if
> choice.votes!=1:}}s{{pass}}
> {{ pass }
>
> On Mar 3, 11:51 pm, mdmcginn  wrote:
>
>
>
> > db.define_table('poll',
> >         Field('question',length=200),
>
> > Field('pub_date','datetime',default=request.now,writable=False))
>
> > db.define_table('choice',
> >         Field('poll',db.poll),
> >         Field('choice',length=200),
> >         Field('votes','integer',default=0))
>
> > db.define_table('recorded_votes',
> >     Field('poll',db.poll),
> >     Field('voter',db.auth_user))
>
> > On Mar 1, 9:37 pm, "mr.freeze"  wrote:
>
> > > Can we see your model?
>
> > > On Mar 1, 9:05 pm, mdmcginn  wrote:
>
> > > > From index.html:
> > > > Latest Polls
> > > > Answer the question [vote] [results]
>
> > > > When I click on [results], I'm sent 
> > > > tohttp://localhost:8080/Polls/default/results/67
>
> > > > ERROR    2010-03-02 02:54:08,609 restricted.py:53] In FILE: /home/
> > > > michael/mycode/google_appengine/web2py/applications/Polls/views/
> > > > default/results.html
>
> > > > Traceback (most recent call last):
> > > >   File "/home/michael/mycode/web2py/gluon/restricted.py", line 173, in
> > > > restricted
> > > >     exec ccode in environment
> > > >   File "/home/michael/mycode/google_appengine/web2py/applications/
> > > > Polls/views/default/results.html", line 64, in 
> > > >   File "/home/michael/mycode/web2py/gluon/sql.py", line 3041, in
> > > > select
> > > >     query = self._select(*fields, **attributes)
> > > >   File "/home/michael/mycode/web2py/gluon/sql.py", line 2932, in
> > > > _select
> > > >     raise SyntaxError, 'Set: no tables selected'
> > > > SyntaxError: Set: no tables selected
>
> > > > INFO     2010-03-02 02:54:08,610 gaehandler.py:55]  Request:
> > > > 286.06ms/50.00ms (real time/cpu time)
> > > > INFO     2010-03-02 02:54:08,618 dev_appserver.py:3246] "GET /Polls/
> > > > def

[web2py] Getting out from under web2py.py 's environment building magic.

2010-03-04 Thread compassiontara
I'll probably get flamed for talking about this...

In general I really like the 'magic' that web2py offers, where it
builds a nice structure and imports all the modules and everything.
Having stuff just exist for me is really handy!  I'm not saying that
this should change.

However, there are times, like when an asterisk AGI script needs to
talk to a web2py database.  Rather than use some other DB API, I want
to use web2py's DAL.  Basically I'm getting a telephone to talk to
web2py's DAL.

This is the core of how I did that.  It took me a couple hours of
mucking about and learning web2py's codebase to figure this out.
Perhaps this should be on the wiki, but I can't figure out how to make
the wiki work for me.

I welcome better ways, but this is the cleanest way I could figure out
how to do it.  I didn't try messing about with a smaller subsection of
the gluon codebase.  If importing it to a contrib directory (which is
probably recommended for consistency, you will have to muck about with
the local gluon imports, to come from the module instead of from
local.  This is one area where I would like web2py to change, so that
it can handle being imported easier...

Regardless this is a working(for me) example of how I did it:

#copy web2py's gluon directory to my source tree
cp -R ~/web2py/gluon .
#whenever copying code, make sure you take the license with you!
cp ~/web2py/LICENSE gluon/

here is an example .py file:
##BEGIN FILE:

#!/usr/bin/env python
# encoding: utf-8
"""
db.py - quick simple easy external interface to web2py's DAL.
author: Tara Birl
License: Public Domain
"""
from gluon.sql import DAL,Field
db = DAL('sqlite://test.db')
db.define_table('callers',
Field('userphone','string',unique=True),
Field('status','boolean',default=False),
)

if __name__=='__main__':
db.callers.insert(userphone='18775551212',status=False)
db.callers.insert(userphone='13475551212',status=True)
#DO NOT FORGET TO COMMIT!!
db.commit()
for caller in db(db.callers.id>0).select():
print caller.userphone,caller.status
caller =
db(db.callers.userphone=='18775551212').select().first()
if caller:
caller.update_record(status=True)
#DO NOT FORGET TO COMMIT!!
db.commit()
print caller.userphone,caller.status
else:
print 'caller not found in DB'


##END FILE

I hope this helps someone else, and I welcome smarter better ways to
handle this situation from everyone here!  This is my 1st week with
web2py after all!

With Love,
Tara

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.