Re: [web2py] Re: How to use the new cache-options with SQLFORM.grid?

2012-08-31 Thread Johann Spies
Thanks for the explanation Anthony.

Regards
Johann

-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 





[web2py] Re: Stuck: 'thread._local' object has no attribute 'request'

2012-08-31 Thread Daniel Gonzalez
I have solved my issue. It was a problem with mixed releases of web2py 
(rsync issues). Sorry for bothering.

On Friday, August 31, 2012 8:57:41 AM UTC+2, Daniel Gonzalez wrote:
>
> Sorry, I meant "model file"
>
> On Friday, August 31, 2012 8:54:24 AM UTC+2, Daniel Gonzalez wrote:
>>
>> python 2.7.2. Not in GAE.
>> I have several non-standard modules which my application uses, but the 
>> problem is happening in the module file, which if I understand correctly is 
>> one of the first files to be loaded by web2py.
>>
>> On Friday, August 31, 2012 8:40:37 AM UTC+2, Massimo Di Pierro wrote:
>>>
>>> All your problems in this and other threads are consistent with memory 
>>> corruption.
>>> Which python version are you using?
>>> Are you using any module which is not in the standard library?
>>> I do not think this is a web2py issue although web2py may trigger it.
>>>
>>>
>>> On Friday, August 31, 2012 1:20:55 AM UTC-5, Daniel Gonzalez wrote:

 I am having trouble understanding what is happening here:

  'thread._local' object has no 
 attribute 'request'

 Traceback (most recent call last):
   File "/home/gonvaled/tmp/web2py/gluon/restricted.py", line 209, 
 inrestricted
 exec ccode in environment
   File 
 "/home/gonvaled/tmp/web2py/applications/wavilon_portal/models/db.py",line 
 12, in 
 auth= Auth(db)
   File "applications/wavilon_portal/modules/gluon/tools.py", line 1060, 
 in __init__
 request = current.request
 AttributeError: 'thread._local' object has no attribute 'request'

 I have not made many changes, and the application was working find 
 before. I have moved recently to 2.0.3. Can this be related?
 I have tried a minimal application which uses auth=Auth(db) and that is 
 working fine.
 How can I further investigate this problem?

 Thanks,
 Daniel

>>>

-- 





[web2py] Re: IS_IN_DB limited to parentID==0

2012-08-31 Thread lyn2py
Hi Annet,

I recently encountered this.

You can do this: 
IS_IN_DB(db(db.nav.parentID==0),'nav.id','%(name)s', zero=T('select a value'
))

the first argument can take a db(query)

On Friday, August 31, 2012 2:24:26 PM UTC+8, Annet wrote:
>
> I defined the following table:
>
> db.define_table('nav',
> Field('name',length=32),
> ...
> Field('parentID','reference 
> nav',requires=IS_IN_DB(db,'nav.id','%(name)s',zero=T('select 
> a value'
>
> In the form I'd like to have a drop box which only contains the navs that 
> have a parentID==0
>
> I guess the following comes close to what I need?
>
> IS_IN_DB(db,'nav.id','%(name)s',lambda parentID, row: 
> db(db.nav.parentID==0).select(),zero=T('select a value'))
>
>
> Kind regards,
>
> Annet
>

-- 





[web2py] Re: web2py 2.0.2 is out

2012-08-31 Thread lyn2py
HUGE Thanks to Massimo and all who have contributed to this release!
Long awaited and anticipated!

web2py is my favorite framework because of all you wonderful people!


On Thursday, August 30, 2012 11:41:34 AM UTC+8, Massimo Di Pierro wrote:
>
> After 5 months. It is done. This is the most waited and the most 
> feature-packed release.
>
> I am sure we'll find some corners that need to be ironed but it is 
> considerably better than 1.99.7. It adds lot of new features and improves 
> many existing ones:
>
> - 57,000 new lines of code and closed 279 issues since 1.99.7.
> - Retrieving data from DB should be faster, in particular 
> select(cacheable=True)
> - Has a new scheduler, a built-in wiki, new language and pluralization 
> system, better markmin with oembed support and better scaffolding app, 
> increased security.
> - Lots of experimental features including GIS support, mongodb support, 
> built-in auth.wiki(), and more.
>
> Should be 100% backward compatible. If you run into any issue let us know 
> ASAP.
>
> I personally want to thank the major contributors to this release (in 
> alphabetic order)
> Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic, Iceberg, Jonathan, 
> Marc, Mariano, Marin, Martin, Mark, Michael, Michele, Niphlod, Patrick, 
> Vladyslav, 
> They spend many nights testing, coding, debugging at a very fast pace.
>
> Many many people have contributed.
>
> If your contribution has not been properly acknowledged please let us know 
> ASAP. It is probably an oversight.
>
>
> Massimo
>
>
> Detailed changelog
> ===
>
> ## 2.00.2
>
> ### DAL Improvements
>
> - Support for DAL(lazy_tables=True) and db.define_table(on_define=lambda 
> table:), thanks Jonathan
> - db(...).select(cacheable=True) make select 30% faster
> - db(...).select(cache=(cache.ram,3600)) now caches parsed data 100x faster
> - db(...).count(cache=(cache.ram,3600)) now supported
> - MongoDB support in DAL (experimental), thanks Mark Breedveld
> - geodal and spatialite, thanks Denes and Fran (experimental)
> - db.mytable._before_insert, _after_insert, _before_update, _after_update, 
> _before_delete. _after_delete (list of callbacks)
> - db(...).update_naive(...) same as update but ignores 
> table._before_update and table._after_update
> - DAL BIGINT support and DAL(...,bigint_id=True)
> - IS_IN_DB(..., distinct=True)
> - new syntax: db.mytable.insert(myuploadfield=open()), thank you 
> Iceberg
> - db(...).select(db.mytable.myfield.count(distinct=True))
> - db(db.a)._update(name=db(db.b.a==db.a.id).nested_select(db.b.id))
> - db.mytable.myfield.filter_in, filter_out
> - db.mytable._enable_record_versioning(db) adds versioning to this table
> - teradata adapter, thanks Andrew Willimott
> - experimental Sybase Adapter
> - added db.table.field.avg()
> - Support for Google App Engine projections, thanks Christian
> - Field(... 'upload', default=path) now accepts a path to a local file as 
> default value, if user does not upload a file. Relative path looks inside 
> current application folder, thanks Marin
> - executesql(...,fields=,columns=) allows parsing of results in Rows, 
> thanks Anthony
>
> ### Auth improvements
>
> - auth.enable_record_versioning(db)  adds full versioning to all tables
> - @auth.requires_login(otherwise=URL(...))
> - auth supports salt and compatible with third party data, thanks Dave 
> Stoll
> - CRYPT now defaults to pbkdf2(1000,20,sha1)
> - Built-in wiki with menu, tags, search, media, permissions. def index: 
> return auth.wiki()
> - auth.settings.everybody_group_id
> - allow storage of uploads on any PyFileSystem (including amazon)
>
> ### Form improvements
>
> - FORM.confirm('Are you sure?',{'Back':URL(...)})
> - SQLFORM.smartdictform(dict)
> - form.add_button(value,link)
> - SQLFORM.grid(groupby='...')
> - fixed security issue with SQLFORM.grid and SQLFORM.smartgrid
> - more export options in SQLFORM.grid and SQLFORM.smartgrid (html, xml, 
> csv, ...)
>
> ### Admin improvements
>
> - new admin pages: manage_students, bulk_regsiter, and progress reports
> - increased security in admin against CSRF
> - experimental Git integration
> - experimental OpenShift deployment
> - multi-language pluralization engine 
> - ace text web editor in admin
> - Ukrainian translations, thanks Vladyslav Kozlovskyy
> - Romanian translation for welcome, thanks ionel
> - support for mercurial 2.6, thanks Vlad
>
> ### Scheduler Improvements (thanks to niphlod, ykessler, dhx, toomim)
>
> - web2py.py -K myapp -X starts the myapp scheduler alongside the webserver
> - tasks are marked EXPIRED (if stop_time passed)
> - functions with no result don't end up in scheduler_run
> - more options: web2py.py -E -b -L
> - scheduler can now handle 10k tasks with 20 concurrent workers and with 
> no issues
> - new params:
> tasks can be found in the environment (no need to define the tasks 
> parameter)
> max_empty_runs kills the workers automatically if no new tasks are 
> found in queue (nice for "spik

[web2py] grid/smartgrid field editability

2012-08-31 Thread Dirk Krause
Is there an (easy) way to disable the editability of distinct fields in a 
grid/smartgrid?

I'd like to create a view for an editor (being able to edit all fields), 
and an approver (being able to just view all fields, and change only one 
field like a checkbox).

Thanks, Dirk

-- 





[web2py] Re: grid/smartgrid field editability

2012-08-31 Thread Niphlod
the "default" way of setting db.table.field.writable = False should work...

Il giorno venerdì 31 agosto 2012 11:26:16 UTC+2, Dirk Krause ha scritto:
>
> Is there an (easy) way to disable the editability of distinct fields in a 
> grid/smartgrid?
>
> I'd like to create a view for an editor (being able to edit all fields), 
> and an approver (being able to just view all fields, and change only one 
> field like a checkbox).
>
> Thanks, Dirk
>

-- 





[web2py] Authenticate one application from another application

2012-08-31 Thread Pradeeshnarayan
I have two different web2py application. (different database)

I have a requirement like. My second application (application2) can be used 
by only users whose registered in the first application (application1).

I am planing to implement a login form in my application2. And on submit it 
will send the username and password to a funtion in application1.

Application1 function will recieve two values username and password as 
string, and check in the database, if there is a record with this values in 
auth_user table then return true. 

But in the auth_user table pasword is already encrypted. So please let me 
know how I can encrypt my password string value and match with the database 
value.

Also please let me know if there is any better way to implement this 
requirement.

-- 





[web2py] Re: grid/smartgrid field editability

2012-08-31 Thread Dirk Krause
That was it - thx a bunch!

Am Freitag, 31. August 2012 11:28:34 UTC+2 schrieb Niphlod:
>
> the "default" way of setting db.table.field.writable = False should work...
>
> Il giorno venerdì 31 agosto 2012 11:26:16 UTC+2, Dirk Krause ha scritto:
>>
>> Is there an (easy) way to disable the editability of distinct fields in a 
>> grid/smartgrid?
>>
>> I'd like to create a view for an editor (being able to edit all fields), 
>> and an approver (being able to just view all fields, and change only one 
>> field like a checkbox).
>>
>> Thanks, Dirk
>>
>

-- 





Re: [web2py] Re: web2py 2.0.2 is out

2012-08-31 Thread Alec Taylor
I've got a better flash code using bootstrap components.

It works quite nicely, giving different colours based on severity of
message. [alert-error, alert-success &etc]

Was planning on waiting until the new bootstrap was integrated before
throwing a pull-request, or did you want a pull request now?

On Fri, Aug 31, 2012 at 3:55 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> ace.js does that. Yes it is odd. I am not sure why. Also there is no flash
> because of the box that now flashes green. We may move from ace to
> codemirror.
>
>
> On Friday, 31 August 2012 00:42:14 UTC-5, Annet wrote:
>>
>> I am still having this issue:
>>
>> On Thursday, 30 August 2012 18:03:36 UTC+2, Annet wrote:
>>>
>>>
>>> Please can you post a concrete example?

>>>
>>> In:
>>>
>>> Editing file "init/models/db.py"
>>>
>>> ... when I click the save button, normally a flash showed up in the
>>> top-right corner:
>>>
>>> file saved on Thu Aug 30
>>> 17:55:13 2012
>>>
>>>
>>> In 2.0.2 the  is empty after clicking the save button:
>>>
>>> 
>>>
>>>
>>> I also noticed that when I inspect the footer element there's a 
>>> with the following contents:
>>>
>>> 
>>> **XyXyXyXyXyXyXyXyXyXyXyXyXyXyXy**
>>> XyXyXyXyXyXyXyXyXyXyXyXyXyXyXy**XyXyXyXyXyXyXyXyXyXyXyXyXyX...**.
>>>
>>>
>>> Kind regards,
>>>
>>> Annet
>>>
>>  --
>
>
>
>

-- 





[web2py] Re: Authenticate one application from another application

2012-08-31 Thread Ralo Tannahill
In application1 when the user is registered you can load the session 
variables you need and access them from application2

session.connect(request,response,masterapp='application1')

Put it in a model in application2 and you can access to the session 
variables fro mapplication1, without accessing auth_user_table.

Regards

On Friday, 31 August 2012 12:06:19 UTC+2, Pradeeshnarayan wrote:
>
> I have two different web2py application. (different database)
>
> I have a requirement like. My second application (application2) can be 
> used by only users whose registered in the first application (application1).
>
> I am planing to implement a login form in my application2. And on submit 
> it will send the username and password to a funtion in application1.
>
> Application1 function will recieve two values username and password as 
> string, and check in the database, if there is a record with this values in 
> auth_user table then return true. 
>
> But in the auth_user table pasword is already encrypted. So please let me 
> know how I can encrypt my password string value and match with the database 
> value.
>
> Also please let me know if there is any better way to implement this 
> requirement.
>
>

-- 





Re: [web2py] Removing labels from forms

2012-08-31 Thread Alec Taylor
Is it not possible to display the text "Password"?

Like they do in Twitter-Bootstrap examples:
http://twitter.github.com/bootstrap/base-css.html#forms

On Fri, Aug 31, 2012 at 12:54 AM, Anthony  wrote:

> It doesn't work for password because type="password" for that field. It
> doesn't work for postcode because your dictionary has "post_code" as the
> key instead of "postcode", which is the name of the form field.
>
> Anthony
>
>
> On Thursday, August 30, 2012 12:01:18 AM UTC-4, Alec Taylor wrote:
>
>> Thanks, but unfortunately that didn't work.
>>
>> {{
>> form=auth.register()
>> my_extra_element = CAT('Agree to ', A('terms & conditions', 
>> _href="/legal/agreement/")), 
>> INPUT(_name='agree',value=True**,_type='checkbox')
>> form[0].insert(-1,my_extra_**element)for label in form.elements('label'):
>> label["_style"] = "display:none;"pass
>>
>> placeholders = {
>>"email": "enter a valid email address",
>>"password": "be secure",
>>"post code": "3434343-3434383",
>>"validator": "captcha"}for input in form.elements("input[type='**text']"):
>> input["_placeholder"] = placeholders.get(input["_name"**], "")pass
>> =form}}
>>
>>
>> (this is in my view; and yes, I should move it to a controller, but want
>> to get it working first)
>>
>> On Thu, Aug 30, 2012 at 4:11 AM, Bruno Rocha  wrote:
>> > placeholders = {
>> > "name": "fill in your name",
>> >"email": "enter a valid email address"
>> > }
>> >
>> > for input in form.elements("input[type='**text']"):
>> > input["_placeholder"] = placeholders.get(input["_name"**], "")
>> >
>> >
>> > On Wed, Aug 29, 2012 at 3:07 PM, Alec Taylor 
>> wrote:
>> >>
>> >> Thanks, also would there be a loop I can add before that to set the
>> >> placeholder of each input?
>> >>
>> >> On Thu, Aug 30, 2012 at 3:58 AM, Bruno Rocha 
>>
>> >> wrote:
>> >> > for label in form.elements('label'):
>> >> > label["_style"] = "display:none;"
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > On Wed, Aug 29, 2012 at 2:47 PM, Alec Taylor 
>>
>> >> > wrote:
>> >> >>
>> >> >> How do I remove labels from forms?
>> >> >>
>> >> >> I want to use placeholders instead...
>> >> >>
>> >> >> (this is for the auth.register form)
>> >> >>
>> >> >> Thanks for all suggestions,
>> >> >>
>> >> >> Alec Taylor
>> >> >>
>> >> >> --
>> >> >>
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >>
>> >>
>> >>
>> >
>> >
>> > --
>> >
>> >
>> >
>>
>>  --
>
>
>
>

-- 





Re: [web2py] Removing labels from forms

2012-08-31 Thread Anthony
On Friday, August 31, 2012 6:41:14 AM UTC-4, Alec Taylor wrote:
>
> Is it not possible to display the text "Password"?


Sure you can. My point was that the code Bruno gave you specifically 
selects inputs of type "text", so it's not touching the password field, 
which is type "password".

Anthony

-- 





[web2py] Re: Authenticate one application from another application

2012-08-31 Thread Anthony
Have you looked at 
http://web2py.com/books/default/chapter/29/9#Central-Authentication-Service?

Anthony

On Friday, August 31, 2012 6:06:19 AM UTC-4, Pradeeshnarayan wrote:
>
> I have two different web2py application. (different database)
>
> I have a requirement like. My second application (application2) can be 
> used by only users whose registered in the first application (application1).
>
> I am planing to implement a login form in my application2. And on submit 
> it will send the username and password to a funtion in application1.
>
> Application1 function will recieve two values username and password as 
> string, and check in the database, if there is a record with this values in 
> auth_user table then return true. 
>
> But in the auth_user table pasword is already encrypted. So please let me 
> know how I can encrypt my password string value and match with the database 
> value.
>
> Also please let me know if there is any better way to implement this 
> requirement.
>
>

-- 





Re: [web2py] Re: How to use the new cache-options with SQLFORM.grid?

2012-08-31 Thread Anthony
FYI, grid now sets cacheable=True when doing selects: 
http://code.google.com/p/web2py/source/detail?r=6596fb84ed0fb49fa19879f80de5fb30ee4d0403.
 
Still no caching option, though (I guess you can cache the output of the 
grid itself, though, which is probably better because it avoids all the 
processing of the grid function).

Anthony

On Friday, August 31, 2012 3:01:44 AM UTC-4, Johann Spies wrote:
>
> Thanks for the explanation Anthony.
>
> Regards
> Johann
>
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>
>

-- 





Re: [web2py] Re: How to call controller function upon onClick from html?

2012-08-31 Thread Anthony
On Thursday, August 30, 2012 10:44:51 PM UTC-4, Amit wrote:
>
> As I told you I have created my own custom html without extending 
> layout.html.


"I have created my own custom html" != "I have not loaded jQuery"

  :-)
 

> I am not sure how to load JQuery in that?
>

It's just a Javascript library, so can be loaded like any other Javascript 
library.

To get it from Google's CDN:



or if you have the version included with web2py:



Anthony

-- 





[web2py] Re: Issue rendering URL inside an A

2012-08-31 Thread Anthony
I cannot reproduce this either. Running the latest trunk, here's the output 
I get in the browser:

 



Testing error with URL and A
click me
/test/default/mycallback



Are you running from source, or the Windows or Mac binary?

Anthony

On Friday, August 31, 2012 2:13:01 AM UTC-4, Daniel Gonzalez wrote:
>
> The problem is still there in Version 2.0.3 (2012-08-31 00:31:48) stable
> You can reproduce it with the following minimal application:
> https://github.com/gonvaled/web2py-tests/tree/master/problem_A_URL
>
> On Thursday, August 30, 2012 10:13:11 PM UTC+2, Anthony wrote:
>>
>> I think the issue is not in the onclick but the href. When you set the 
>> callback but don't set an explicit href, the A() helper should set href to 
>> "#null", but for some reason, his code is appending #null to an actual URL. 
>> I can't reproduce that when I run the same code.
>>
>> Anthony
>>
>> On Thursday, August 30, 2012 4:03:29 PM UTC-4, Massimo Di Pierro wrote:
>>>
>>> The quotes are escaped when in between quotes. That is the correct thing 
>>> to do for security. It works fine or does it not?
>>>
>>> On Thursday, 30 August 2012 07:00:25 UTC-5, Daniel Gonzalez wrote:

 Hi,

 I have the  following markup in an html viewfile:

 {{=DIV(A('click me',callback=URL('mycallback'),target="me"),_id="me")}}
 {{=URL('mycallback')}}

 Which is producing the following html:

 http://localhost:8000/web2py_jquery/default/index#null"; onclick="ajax
 ('/web2py_jquery/default/mycallback',[],'me');return 
 false">click me
 /web2py_jquery/default/mycallback

 (web2py_jquery is just my test application)

 I do not understand why =URL('callback') is rendering differently 
 depending on the context. Specially the "#null" makes me worry
 Is this expected?

 Thanks,
 Daniel

>>>

-- 





[web2py] Re: user login tables

2012-08-31 Thread Yebach
Yes

I kid of worked it trough, the login/logout part

It works fine :)

Thanks for all the help Anthony. I read a lot of your posts and got some 
useful answers

I will address my next question shortly :)

On Thursday, August 30, 2012 9:14:29 AM UTC+2, Anthony wrote:
>
> On Thursday, August 30, 2012 2:46:40 AM UTC-4, Yebach wrote:
>>
>> I don't understand what you mean with how is the user loging out? I used 
>> the {{='auth' in globals() and auth.navbar(separators=(' ',' | ',''))}}
>>
>
> Does that mean the user is logging out by clicking the "Logout" link in 
> the navbar generated by auth.navbar()? 
>

-- 





[web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread vinicius...@gmail.com

First of all, I'd like to thank you all. You're making a great job, guys.
I see web2py becoming more reliable to bigger projects and I'm very 
pleased with it.

You all rock! :-)

In spite of this huge effort, isn't it premature to call 2.0.2 or even 
2.0.3 stable? I know there were several months of hard work, but if we 
have bugs detected so fast, we cannot call it stable yet, right?


Maybe some release candidate call or a pre-release period for tests, 
before spreading it as stable would help us.


--
Vinicius Assef


On 08/30/2012 05:49 PM, Massimo Di Pierro wrote:

All bugs reported today have been fixed in 2.0.3 out now (except a minor
issue with markmin that we are investigating).

If you find other issues, please continue report them. We'd rather fix
them sooner rather than later.

Thanks for all your help and testing.

Massimo



On Wednesday, 29 August 2012 22:41:34 UTC-5, Massimo Di Pierro wrote:

After 5 months. It is done. This is the most waited and the most
feature-packed release.

I am sure we'll find some corners that need to be ironed but it is
considerably better than 1.99.7. It adds lot of new features and
improves many existing ones:

- 57,000 new lines of code and closed 279 issues since 1.99.7.
- Retrieving data from DB should be faster, in particular
select(cacheable=True)
- Has a new scheduler, a built-in wiki, new language and
pluralization system, better markmin with oembed support and better
scaffolding app, increased security.
- Lots of experimental features including GIS support, mongodb
support, built-in auth.wiki(), and more.

Should be 100% backward compatible. If you run into any issue let us
know ASAP.

I personally want to thank the major contributors to this release
(in alphabetic order)
Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic, Iceberg,
Jonathan, Marc, Mariano, Marin, Martin, Mark, Michael, Michele,
Niphlod, Patrick, Vladyslav,
They spend many nights testing, coding, debugging at a very fast pace.

Many many people have contributed.

If your contribution has not been properly acknowledged please let
us know ASAP. It is probably an oversight.


Massimo


Detailed changelog
===

## 2.00.2

### DAL Improvements

- Support for DAL(lazy_tables=True) and
db.define_table(on_define=lambda table:), thanks Jonathan
- db(...).select(cacheable=True) make select 30% faster
- db(...).select(cache=(cache.ram,3600)) now caches parsed data 100x
faster
- db(...).count(cache=(cache.ram,3600)) now supported
- MongoDB support in DAL (experimental), thanks Mark Breedveld
- geodal and spatialite, thanks Denes and Fran (experimental)
- db.mytable._before_insert, _after_insert, _before_update,
_after_update, _before_delete. _after_delete (list of callbacks)
- db(...).update_naive(...) same as update but ignores
table._before_update and table._after_update
- DAL BIGINT support and DAL(...,bigint_id=True)
- IS_IN_DB(..., distinct=True)
- new syntax: db.mytable.insert(myuploadfield=open()), thank you
Iceberg
- db(...).select(db.mytable.myfield.count(distinct=True))
- db(db.a)._update(name=db(db.b.a==db.a.id
).nested_select(db.b.id ))
- db.mytable.myfield.filter_in, filter_out
- db.mytable._enable_record_versioning(db) adds versioning to this table
- teradata adapter, thanks Andrew Willimott
- experimental Sybase Adapter
- added db.table.field.avg()
- Support for Google App Engine projections, thanks Christian
- Field(... 'upload', default=path) now accepts a path to a local
file as default value, if user does not upload a file. Relative path
looks inside current application folder, thanks Marin
- executesql(...,fields=,columns=) allows parsing of results in
Rows, thanks Anthony

### Auth improvements

- auth.enable_record_versioning(db)  adds full versioning to all tables
- @auth.requires_login(otherwise=URL(...))
- auth supports salt and compatible with third party data, thanks
Dave Stoll
- CRYPT now defaults to pbkdf2(1000,20,sha1)
- Built-in wiki with menu, tags, search, media, permissions. def
index: return auth.wiki()
- auth.settings.everybody_group_id
- allow storage of uploads on any PyFileSystem (including amazon)

### Form improvements

- FORM.confirm('Are you sure?',{'Back':URL(...)})
- SQLFORM.smartdictform(dict)
- form.add_button(value,link)
- SQLFORM.grid(groupby='...')
- fixed security issue with SQLFORM.grid and SQLFORM.smartgrid
- more export options in SQLFORM.grid and SQLFORM.smartgrid (html,
xml, csv, ...)

### Admin improvements

- new admin pages: manage_students, bulk_regsiter, and progress reports
- increased security in admin against CSRF
- experimental Git integration
- experimental Open

[web2py] Re: Firebird - accessing DB leads to a ticket

2012-08-31 Thread villas
The changed code appears to work well.  
I do not have fdb yet,  but kinterbasdb is now being selected OK, so that's 
good.  
Thank you.  D

On Friday, August 31, 2012 2:24:55 AM UTC+1, Massimo Di Pierro wrote:
>
> Please check trunk.
>
> On Thursday, 30 August 2012 19:27:23 UTC-5, villas wrote:
>>
>> With trunk I now get this:
>> Traceback (most recent call last):
>>   File "C:\Users\David\web2py\gluon\dal.py", line 6726, in __init__
>> self._adapter = ADAPTERS[self._dbname](*args)
>>   File "C:\Users\David\web2py\gluon\dal.py", line 3208, in __init__
>> self.driver = fdb
>> NameError: global name 'fdb' is not defined
>>
>> I have not installed fdb yet, but I think the above is a problem whether 
>> I have installed it or not?
>> Thanks, D
>>
>

-- 





[web2py] Re: Sites not working on http://web2py.com/poweredby

2012-08-31 Thread Anthony
Thanks for reporting. I removed Ourway. todo.kz looks like it was spam, 
which happens occasionally -- I removed it. The other three will be back up 
soon. Note, the better sites are already marked as "featured" and always 
appear at the top of the list. New sites that people add (including spam) 
therefore always end up lower down in the list and are less visible. 
Anyway, the site could certainly use some improvements, including 
pagination.

Anthony

On Friday, August 31, 2012 1:21:00 AM UTC-4, Jemes Hsu wrote:
>
>
> http://animalsystem.com.br
>
> http://ourway.ir
>
> http://movu.ca
>
> http://www.miaudota.com.br
>
> http://todo.kz/web2py/
>
> The above are some I found, I do not check all. I'm new to web2py, and I 
> encounter the above in my first few click and this gives not good feeling 
> about web2py.
>

-- 





[web2py] Re: Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Anthony
On Friday, August 31, 2012 7:44:31 AM UTC-4, viniciusban wrote:
>
> First of all, I'd like to thank you all. You're making a great job, guys. 
> I see web2py becoming more reliable to bigger projects and I'm very 
> pleased with it. 
> You all rock! :-) 
>
> In spite of this huge effort, isn't it premature to call 2.0.2 or even 
> 2.0.3 stable? I know there were several months of hard work, but if we 
> have bugs detected so fast, we cannot call it stable yet, right? 
>
> Maybe some release candidate call or a pre-release period for tests, 
> before spreading it as stable would help us.
>

Nightly builds have been available throughout development, and there have 
been numerous requests for testers. The fact is, people don't really test 
it and try it out with their existing apps until a full release. In 
practice, the .1 version of any new release is effectively a release 
candidate. Usually bugs are found and fixed quickly, and .2, .3, .4, etc. 
come within a few days, stabilizing fairly quickly.

Anthony 

-- 





Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Marin Pranjić
It is called stable since no one using trunk/nightly build detected those
errors.

I agree with you, but you cannot blame anyone.
Web2py has so much features and it is impossible to test everything.


On Fri, Aug 31, 2012 at 1:44 PM, vinicius...@gmail.com <
vinicius...@gmail.com> wrote:

> First of all, I'd like to thank you all. You're making a great job, guys.
> I see web2py becoming more reliable to bigger projects and I'm very
> pleased with it.
> You all rock! :-)
>
> In spite of this huge effort, isn't it premature to call 2.0.2 or even
> 2.0.3 stable? I know there were several months of hard work, but if we have
> bugs detected so fast, we cannot call it stable yet, right?
>
> Maybe some release candidate call or a pre-release period for tests,
> before spreading it as stable would help us.
>
> --
> Vinicius Assef
>
>
> On 08/30/2012 05:49 PM, Massimo Di Pierro wrote:
>
>> All bugs reported today have been fixed in 2.0.3 out now (except a minor
>> issue with markmin that we are investigating).
>>
>> If you find other issues, please continue report them. We'd rather fix
>> them sooner rather than later.
>>
>> Thanks for all your help and testing.
>>
>> Massimo
>>
>>
>>
>> On Wednesday, 29 August 2012 22:41:34 UTC-5, Massimo Di Pierro wrote:
>>
>> After 5 months. It is done. This is the most waited and the most
>> feature-packed release.
>>
>> I am sure we'll find some corners that need to be ironed but it is
>> considerably better than 1.99.7. It adds lot of new features and
>> improves many existing ones:
>>
>> - 57,000 new lines of code and closed 279 issues since 1.99.7.
>> - Retrieving data from DB should be faster, in particular
>> select(cacheable=True)
>> - Has a new scheduler, a built-in wiki, new language and
>> pluralization system, better markmin with oembed support and better
>> scaffolding app, increased security.
>> - Lots of experimental features including GIS support, mongodb
>> support, built-in auth.wiki(), and more.
>>
>> Should be 100% backward compatible. If you run into any issue let us
>> know ASAP.
>>
>> I personally want to thank the major contributors to this release
>> (in alphabetic order)
>> Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic, Iceberg,
>> Jonathan, Marc, Mariano, Marin, Martin, Mark, Michael, Michele,
>> Niphlod, Patrick, Vladyslav,
>> They spend many nights testing, coding, debugging at a very fast pace.
>>
>> Many many people have contributed.
>>
>> If your contribution has not been properly acknowledged please let
>> us know ASAP. It is probably an oversight.
>>
>>
>> Massimo
>>
>>
>> Detailed changelog
>> ===
>>
>> ## 2.00.2
>>
>> ### DAL Improvements
>>
>> - Support for DAL(lazy_tables=True) and
>> db.define_table(on_define=**lambda table:), thanks Jonathan
>> - db(...).select(cacheable=True) make select 30% faster
>> - db(...).select(cache=(cache.**ram,3600)) now caches parsed data
>> 100x
>> faster
>> - db(...).count(cache=(cache.**ram,3600)) now supported
>> - MongoDB support in DAL (experimental), thanks Mark Breedveld
>> - geodal and spatialite, thanks Denes and Fran (experimental)
>> - db.mytable._before_insert, _after_insert, _before_update,
>> _after_update, _before_delete. _after_delete (list of callbacks)
>> - db(...).update_naive(...) same as update but ignores
>> table._before_update and table._after_update
>> - DAL BIGINT support and DAL(...,bigint_id=True)
>> - IS_IN_DB(..., distinct=True)
>> - new syntax: db.mytable.insert(**myuploadfield=open()), thank
>> you
>> Iceberg
>> - db(...).select(db.mytable.**myfield.count(distinct=True))
>> - db(db.a)._update(name=db(db.b.**a==db.a.id
>> ).nested_**select(db.b.id ))
>> - db.mytable.myfield.filter_in, filter_out
>> - db.mytable._enable_record_**versioning(db) adds versioning to this
>> table
>> - teradata adapter, thanks Andrew Willimott
>> - experimental Sybase Adapter
>> - added db.table.field.avg()
>> - Support for Google App Engine projections, thanks Christian
>> - Field(... 'upload', default=path) now accepts a path to a local
>> file as default value, if user does not upload a file. Relative path
>> looks inside current application folder, thanks Marin
>> - executesql(...,fields=,**columns=) allows parsing of results in
>> Rows, thanks Anthony
>>
>> ### Auth improvements
>>
>> - auth.enable_record_versioning(**db)  adds full versioning to all
>> tables
>> - @auth.requires_login(**otherwise=URL(...))
>> - auth supports salt and compatible with third party data, thanks
>> Dave Stoll
>> - CRYPT now defaults to pbkdf2(1000,20,sha1)
>> - Built-in wiki with menu, tags, search, media, permissions. def
>> index: return auth.wiki()
>> - auth.settings.everybody_group_**id
>>   

[web2py] Re: Issue rendering URL inside an A

2012-08-31 Thread Daniel Gonzalez
>From trunk (github)

On Friday, August 31, 2012 1:24:40 PM UTC+2, Anthony wrote:
>
> I cannot reproduce this either. Running the latest trunk, here's the 
> output I get in the browser:
>
>  
> 
> 
> 
> Testing error with URL and A
> click me
> /test/default/mycallback
> 
> 
>
> Are you running from source, or the Windows or Mac binary?
>
> Anthony
>
> On Friday, August 31, 2012 2:13:01 AM UTC-4, Daniel Gonzalez wrote:
>>
>> The problem is still there in Version 2.0.3 (2012-08-31 00:31:48) stable
>> You can reproduce it with the following minimal application:
>> https://github.com/gonvaled/web2py-tests/tree/master/problem_A_URL
>>
>> On Thursday, August 30, 2012 10:13:11 PM UTC+2, Anthony wrote:
>>>
>>> I think the issue is not in the onclick but the href. When you set the 
>>> callback but don't set an explicit href, the A() helper should set href to 
>>> "#null", but for some reason, his code is appending #null to an actual URL. 
>>> I can't reproduce that when I run the same code.
>>>
>>> Anthony
>>>
>>> On Thursday, August 30, 2012 4:03:29 PM UTC-4, Massimo Di Pierro wrote:

 The quotes are escaped when in between quotes. That is the correct 
 thing to do for security. It works fine or does it not?

 On Thursday, 30 August 2012 07:00:25 UTC-5, Daniel Gonzalez wrote:
>
> Hi,
>
> I have the  following markup in an html viewfile:
>
> {{=DIV(A('click me',callback=URL('mycallback'),target="me"),_id="me"
> )}}
> {{=URL('mycallback')}}
>
> Which is producing the following html:
>
> http://localhost:8000/web2py_jquery/default/index#null"; onclick="ajax
> ('/web2py_jquery/default/mycallback',[],'me');return 
> false">click me
> /web2py_jquery/default/mycallback
>
> (web2py_jquery is just my test application)
>
> I do not understand why =URL('callback') is rendering differently 
> depending on the context. Specially the "#null" makes me worry
> Is this expected?
>
> Thanks,
> Daniel
>


-- 





Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread vinicius...@gmail.com
See, guys, I'm not blaming anyone and I'm not saying Web2py is not good, 
or your work failed.


I pay my bills working with web2py for the last year. I use it for 3 
years, now. I really like that and help spread the word.




Web2py has so much features and it is impossible to test everything.


Sorry, but I cannot agree with this statement. Is it the official position?

Remember, one of the strengths is our backward compatibility. It can be 
achieved with detailed tests **before** anouncing a new stable release.


"Stable" means: "you can download and just use it". Anything different 
is "almost stable" or "buggy yet" or, using beautiful words, "release 
candidate" or "pre-release version".


I'd like to hear your oppinions.

--
Vinicius Assef



On 08/31/2012 09:01 AM, Marin Pranjić wrote:

It is called stable since no one using trunk/nightly build detected
those errors.

I agree with you, but you cannot blame anyone.


On Fri, Aug 31, 2012 at 1:44 PM, vinicius...@gmail.com
 mailto:vinicius...@gmail.com>> wrote:

First of all, I'd like to thank you all. You're making a great job,
guys.
I see web2py becoming more reliable to bigger projects and I'm very
pleased with it.
You all rock! :-)

In spite of this huge effort, isn't it premature to call 2.0.2 or
even 2.0.3 stable? I know there were several months of hard work,
but if we have bugs detected so fast, we cannot call it stable yet,
right?

Maybe some release candidate call or a pre-release period for tests,
before spreading it as stable would help us.

--
Vinicius Assef


On 08/30/2012 05:49 PM, Massimo Di Pierro wrote:

All bugs reported today have been fixed in 2.0.3 out now (except
a minor
issue with markmin that we are investigating).

If you find other issues, please continue report them. We'd
rather fix
them sooner rather than later.

Thanks for all your help and testing.

Massimo



On Wednesday, 29 August 2012 22:41:34 UTC-5, Massimo Di Pierro
wrote:

 After 5 months. It is done. This is the most waited and the
most
 feature-packed release.

 I am sure we'll find some corners that need to be ironed
but it is
 considerably better than 1.99.7. It adds lot of new
features and
 improves many existing ones:

 - 57,000 new lines of code and closed 279 issues since 1.99.7.
 - Retrieving data from DB should be faster, in particular
 select(cacheable=True)
 - Has a new scheduler, a built-in wiki, new language and
 pluralization system, better markmin with oembed support
and better
 scaffolding app, increased security.
 - Lots of experimental features including GIS support, mongodb
 support, built-in auth.wiki(), and more.

 Should be 100% backward compatible. If you run into any
issue let us
 know ASAP.

 I personally want to thank the major contributors to this
release
 (in alphabetic order)
 Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic,
Iceberg,
 Jonathan, Marc, Mariano, Marin, Martin, Mark, Michael, Michele,
 Niphlod, Patrick, Vladyslav,
 They spend many nights testing, coding, debugging at a very
fast pace.

 Many many people have contributed.

 If your contribution has not been properly acknowledged
please let
 us know ASAP. It is probably an oversight.


 Massimo


 Detailed changelog
 ===

 ## 2.00.2

 ### DAL Improvements

 - Support for DAL(lazy_tables=True) and
 db.define_table(on_define=__lambda table:), thanks Jonathan
 - db(...).select(cacheable=True) make select 30% faster
 - db(...).select(cache=(cache.__ram,3600)) now caches
parsed data 100x
 faster
 - db(...).count(cache=(cache.__ram,3600)) now supported
 - MongoDB support in DAL (experimental), thanks Mark Breedveld
 - geodal and spatialite, thanks Denes and Fran (experimental)
 - db.mytable._before_insert, _after_insert, _before_update,
 _after_update, _before_delete. _after_delete (list of
callbacks)
 - db(...).update_naive(...) same as update but ignores
 table._before_update and table._after_update
 - DAL BIGINT support and DAL(...,bigint_id=True)
 - IS_IN_DB(..., distinct=True)
 - new syntax:
db.mytable.insert(__myuploadfield=open()), thank you
 Iceberg
 - db(...).select(db.mytable.__myfield.count(distinct=True))
 - db(db.a)._update(name=db(db

Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Marin Pranjić
>
> Web2py has so much features and it is impossible to test everything.
>>
>
> Sorry, but I cannot agree with this statement. Is it the official position?
>
>
Of course not. These are my thoughts only.
It is better when I don't talk much


Marin

-- 





Re: [web2py] Re: How to use the new cache-options with SQLFORM.grid?

2012-08-31 Thread Massimo Di Pierro
I agree. Let's discuss on web2py-developers the best way to do that.

On Friday, August 31, 2012 6:07:30 AM UTC-5, Anthony wrote:
>
> FYI, grid now sets cacheable=True when doing selects: 
> http://code.google.com/p/web2py/source/detail?r=6596fb84ed0fb49fa19879f80de5fb30ee4d0403.
>  
> Still no caching option, though (I guess you can cache the output of the 
> grid itself, though, which is probably better because it avoids all the 
> processing of the grid function).
>
> Anthony
>
> On Friday, August 31, 2012 3:01:44 AM UTC-4, Johann Spies wrote:
>>
>> Thanks for the explanation Anthony.
>>
>> Regards
>> Johann
>>
>> -- 
>> Because experiencing your loyal love is better than life itself, 
>> my lips will praise you.  (Psalm 63:3)
>>
>>

-- 





[web2py] Re: problem upgrading from 1.994 to latest version on mac os

2012-08-31 Thread greaneym
Hello,
I just now downloaded again and get a zip file web2py_osx.zip, which 
uncompressed. I mv'd it to /Applications from ~/Downloads.  When I open, I 
get a similar error but notice that the word Applications is now spelled 
Applicatoins in the error which I copied from a popup screen:

OSError: [Errno20] Not a 
directory:'/Applicatoins/web2py/web2py.app/Contents/Resources/lib/python2.5/site-packages.zip/gluon/contrib/rules'



-- 





Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Massimo Di Pierro
We should have tested the osx and win more. This is my mistake. Other minor 
issues are physiological.
Anyway, I believe all issues have been taken care within 24hrs.

massimo

On Friday, August 31, 2012 7:28:19 AM UTC-5, viniciusban wrote:
>
> See, guys, I'm not blaming anyone and I'm not saying Web2py is not good, 
> or your work failed. 
>
> I pay my bills working with web2py for the last year. I use it for 3 
> years, now. I really like that and help spread the word. 
>
>
> > Web2py has so much features and it is impossible to test everything. 
>
> Sorry, but I cannot agree with this statement. Is it the official 
> position? 
>
> Remember, one of the strengths is our backward compatibility. It can be 
> achieved with detailed tests **before** anouncing a new stable release. 
>
> "Stable" means: "you can download and just use it". Anything different 
> is "almost stable" or "buggy yet" or, using beautiful words, "release 
> candidate" or "pre-release version". 
>
> I'd like to hear your oppinions. 
>
> -- 
> Vinicius Assef 
>
>
>
> On 08/31/2012 09:01 AM, Marin Pranjić wrote: 
> > It is called stable since no one using trunk/nightly build detected 
> > those errors. 
> > 
> > I agree with you, but you cannot blame anyone. 
> > 
> > 
> > On Fri, Aug 31, 2012 at 1:44 PM, vinic...@gmail.com  
> >   
> > > wrote: 
> > 
> > First of all, I'd like to thank you all. You're making a great job, 
> > guys. 
> > I see web2py becoming more reliable to bigger projects and I'm very 
> > pleased with it. 
> > You all rock! :-) 
> > 
> > In spite of this huge effort, isn't it premature to call 2.0.2 or 
> > even 2.0.3 stable? I know there were several months of hard work, 
> > but if we have bugs detected so fast, we cannot call it stable yet, 
> > right? 
> > 
> > Maybe some release candidate call or a pre-release period for tests, 
> > before spreading it as stable would help us. 
> > 
> > -- 
> > Vinicius Assef 
> > 
> > 
> > On 08/30/2012 05:49 PM, Massimo Di Pierro wrote: 
> > 
> > All bugs reported today have been fixed in 2.0.3 out now (except 
> > a minor 
> > issue with markmin that we are investigating). 
> > 
> > If you find other issues, please continue report them. We'd 
> > rather fix 
> > them sooner rather than later. 
> > 
> > Thanks for all your help and testing. 
> > 
> > Massimo 
> > 
> > 
> > 
> > On Wednesday, 29 August 2012 22:41:34 UTC-5, Massimo Di Pierro 
> > wrote: 
> > 
> >  After 5 months. It is done. This is the most waited and the 
> > most 
> >  feature-packed release. 
> > 
> >  I am sure we'll find some corners that need to be ironed 
> > but it is 
> >  considerably better than 1.99.7. It adds lot of new 
> > features and 
> >  improves many existing ones: 
> > 
> >  - 57,000 new lines of code and closed 279 issues since 
> 1.99.7. 
> >  - Retrieving data from DB should be faster, in particular 
> >  select(cacheable=True) 
> >  - Has a new scheduler, a built-in wiki, new language and 
> >  pluralization system, better markmin with oembed support 
> > and better 
> >  scaffolding app, increased security. 
> >  - Lots of experimental features including GIS support, 
> mongodb 
> >  support, built-in auth.wiki(), and more. 
> > 
> >  Should be 100% backward compatible. If you run into any 
> > issue let us 
> >  know ASAP. 
> > 
> >  I personally want to thank the major contributors to this 
> > release 
> >  (in alphabetic order) 
> >  Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic, 
> > Iceberg, 
> >  Jonathan, Marc, Mariano, Marin, Martin, Mark, Michael, 
> Michele, 
> >  Niphlod, Patrick, Vladyslav, 
> >  They spend many nights testing, coding, debugging at a very 
> > fast pace. 
> > 
> >  Many many people have contributed. 
> > 
> >  If your contribution has not been properly acknowledged 
> > please let 
> >  us know ASAP. It is probably an oversight. 
> > 
> > 
> >  Massimo 
> > 
> > 
> >  Detailed changelog 
> >  === 
> > 
> >  ## 2.00.2 
> > 
> >  ### DAL Improvements 
> > 
> >  - Support for DAL(lazy_tables=True) and 
> >  db.define_table(on_define=__lambda table:), thanks Jonathan 
> >  - db(...).select(cacheable=True) make select 30% faster 
> >  - db(...).select(cache=(cache.__ram,3600)) now caches 
> > parsed data 100x 
> >  faster 
> >  - db(...).count(cache=(cache.__ram,

[web2py] Re: Authenticate one application from another application

2012-08-31 Thread Pradeeshnarayan
Thanks Anthony. 
I was not aware of CAS. Nice concept. I think this is the best solution for 
my problem.
Thanks again.

On Friday, 31 August 2012 12:59:22 UTC+2, Anthony wrote:
>
> Have you looked at 
> http://web2py.com/books/default/chapter/29/9#Central-Authentication-Service
> ?
>
> Anthony
>
> On Friday, August 31, 2012 6:06:19 AM UTC-4, Pradeeshnarayan wrote:
>>
>> I have two different web2py application. (different database)
>>
>> I have a requirement like. My second application (application2) can be 
>> used by only users whose registered in the first application (application1).
>>
>> I am planing to implement a login form in my application2. And on submit 
>> it will send the username and password to a funtion in application1.
>>
>> Application1 function will recieve two values username and password as 
>> string, and check in the database, if there is a record with this values in 
>> auth_user table then return true. 
>>
>> But in the auth_user table pasword is already encrypted. So please let me 
>> know how I can encrypt my password string value and match with the database 
>> value.
>>
>> Also please let me know if there is any better way to implement this 
>> requirement.
>>
>>

-- 





Re: [web2py] Re: [Announcement] web2py powered app Vocabilis.NET

2012-08-31 Thread Alexei Vinidiktov
That would be great! :)

On Fri, Aug 31, 2012 at 3:04 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> My wife teaches Italian. Perhaps I get finally get her to use web2py. ;-)
>
>
> On Thursday, 30 August 2012 09:53:56 UTC-5, Alexei Vinidiktov wrote:
>>
>> Hi,
>>
>> I'm glad to announce the launch of my second web2py powered web
>> application www.vocabilis.net.
>>
>> It's a flashcard vocabulary builder for language learners.
>>
>> On the front end I use Flex and on the back end I use web2py.
>>
>> To see the app in action you'll need to register on the site.
>> Registration doesn't require email confirmation at the moment.
>>
>> I'd like to thank the web2py community for all the help I've gotten
>> working on Vocabilis.NET.
>>
>> Massimo and all the contributors, thank you for creating such an
>> indispensable tool!
>>
>> Thanks, guys!
>>
>> --
>> Alexei Vinidiktov
>>
>  --
>
>
>
>



-- 
Alexei Vinidiktov

-- 





Re: [web2py] Re: KeyError: 'index_name`' when upgrading to 2.0.3

2012-08-31 Thread Jim S
Thanks Massimo, that did the trick.  I'm now on to my next error but will 
start a new thread.

-Jim

On Thursday, August 30, 2012 8:19:08 PM UTC-5, Massimo Di Pierro wrote:
>
> Can you check if this works now with trunk?
>
> On Thursday, 30 August 2012 18:05:34 UTC-5, Jim S wrote:
>>
>> Wow, I'm really losing it.  I'm referring to line number 726 instead of 
>> 727 in C:\dev\web2py\gluon\dal.py in create_table.
>>
>> Sorry for the sloppy reporting.
>>
>> -Jim
>>
>>
>> On Thu, Aug 30, 2012 at 5:25 PM, Massimo Di Pierro > > wrote:
>>
>>> In which file? A web2py file?
>>>
>>> On Thursday, 30 August 2012 16:51:52 UTC-5, Jim S wrote:

 Sorry, I had a debug line in db.py.  The actual offending line there is 
 726.

 -Jim

 On Thursday, August 30, 2012 4:44:40 PM UTC-5, Jim S wrote:
>
> Hi – sorry if this gets there multiple times, but I’ve posted twice in 
> the past 6 hours and it hasn’t shown up yet:
>
>  
>
> I’m getting the following:
>
>  
>
> Traceback (most recent call last):
>
>   File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted
>
> exec ccode in environment
>
>   File "C:/dev/web2py/applications/infocenter/models/db.py", line 88, 
> in 
>
> auth.define_tables()   # creates all 
> needed tables
>
>   File "C:\dev\web2py\gluon\tools.py", line 1501, in define_tables
>
> fake_migrate=fake_migrate))
>
>   File "C:\dev\web2py\gluon\dal.py", line 7051, in define_table
>
> table = self.lazy_define_table(tablename,*fields,**args)
>
>   File "C:\dev\web2py\gluon\dal.py", line 7082, in lazy_define_table
>
> polymodel=polymodel)
>
>   File "C:\dev\web2py\gluon\dal.py", line 727, in create_table
>
> on_delete_action=field.ondelete)
>
> KeyError: 'index_name`'
>
>  
>
> Offending line of my code is:
>
> auth.define_tables()
>
>  
>
> Code up to that point:
>
>  
>
> from gluon.custom_import import track_changes
>
> track_changes()
>
>  
>
> import icUtil
>
> import infoCenterUtil
>
> import logging
>
> from dateutil.relativedelta import *
>
> from dateutil.parser import *
>
> import datetime
>
> import os
>
> from plugin_suggest_widget import suggest_widget
>
>  
>
> log = logging.getLogger('InfoCenter')
>
> if len(log.handlers) == 0:
>
> log = icUtil.getLog(loggerName='InfoCenter', level='INFO', 
> echo=True)
>
>  
>
> if infoCenterUtil.migrate():
>
> db = DAL(infoCenterUtil.getDalString(), bigint_id=True)
>
> else:
>
> db = DAL(infoCenterUtil.getDalString(), migrate=False, 
>
>  migrate_enabled=False, bigint_id=True)
>
>  
>
> # by default give a view/generic.extension to all actions from 
> localhost
>
> # none otherwise. a pattern can be 'controller/function.extension'
>
> response.generic_patterns = ['*'] if request.is_local else []
>
>  
>
> #print request.env.path_info
>
>  
>
>
> #
>
> ## Here is sample code if you need for
>
> ## - email capabilities
>
> ## - authentication (registration, login, logout, ... )
>
> ## - authorization (role based authorization)
>
> ## - services (xml, csv, json, xmlrpc, jsonrpc, amf, rss)
>
> ## - crud actions
>
> ## (more options discussed in gluon/tools.py)
>
>
> #
>
>  
>
> from gluon.tools import Mail, Auth, Crud, Service, PluginManager, 
> prettydate
>
>  
>
> mail = Mail()  # mailer
>
> auth = Auth(db)# 
> authentication/authorization
>
> crud = Crud(db)# for CRUD helpers 
> using auth
>
> service = Service()# for json, xml, 
> jsonrpc, xmlrpc, amfrpc
>
> plugins = PluginManager()
>
>  
>
> from gluon.contrib.login_methods.email_auth import email_auth
>
> #auth.settings.login_methods.append((email_auth('smtp.asdfasdf.com:587', 
> '@asdfasd.com')))
>
> auth.settings.login_methods.append((email_auth('mail.asdfasdf.com', '@
> sadfs.com')))
>
>  
>
> mail.settings.server = 'mail.asdfjl.com'  # your SMTP server
>
> mail.settings.sender = 'i...@sadfas.com' # your email
>
> mail.settings.login = 'asdf:alkdsjl'  # your credentials or None
>
>  
>
> auth.settings.hmac_key = 
> 'sha512:9d8d83af-6548-410b-9cf5-e01a163

[web2py] Upgrade to 2.0.x - AttributeError: 'Table' object has no attribute 'permissionid'

2012-08-31 Thread Jim S
Getting the following:

Traceback (most recent call last):
  File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted
exec ccode in environment
  File "C:/dev/web2py/applications/infocenter/models/db.py" 
, line 152, 
in 
format='%(name)s')
  File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
  File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table
polymodel=polymodel)
  File "C:\dev\web2py\gluon\dal.py", line 920, in create_table
fake_migrate=fake_migrate)
  File "C:\dev\web2py\gluon\dal.py", line 988, in migrate_table
and not isinstance(table[key].type, SQLCustomType) \
  File "C:\dev\web2py\gluon\dal.py", line 7559, in __getitem__
return ogetattr(self, str(key))
AttributeError: 'Table' object has no attribute 'permissionid'

Relevant define_table in db.py:

link = db.define_table('link', 
Field('linkId', 'id', readable=False),
Field('name', length=50, required=True, unique=True),
Field('parentLinkId', 'reference link', required=True,
  label='Parent Link'),
Field('controller', length=512, required=True),
Field('method', length=512, required=True),
Field('picture', length=512, required=False),
Field('permissionId', db.auth_permission, label='Rqd Permission'),
Field('groupId', db.auth_group, label='Rqd Group'),
Field('description', 'text', required=True),
format='%(name)s')


This is line 152.  If I change it to the following (added .id to definition 
of permissionId field reference) :

link = db.define_table('link', 
 Field('linkId', 'id', readable=False),
 Field('name', length=50, required=True, unique=True),
 Field('parentLinkId', 'reference link', required=True,
 label='Parent Link'),
 Field('controller', length=512, required=True),
 Field('method', length=512, required=True),
 Field('picture', length=512, required=False),
 Field('permissionId', db.auth_permission.id, label='Rqd Permission'),  
 Field('groupId', db.auth_group, label='Rqd Group'),
 Field('description', 'text', required=True),
 format='%(name)s')

Then I get the following traceback:

Traceback (most recent call last):
  File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted
exec ccode in environment
  File "C:/dev/web2py/applications/infocenter/models/db.py" 
, line 152, 
in 
format='%(name)s')
  File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
  File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table
polymodel=polymodel)
  File "C:\dev\web2py\gluon\dal.py", line 721, in create_table
elif field_type.startswith('reference'):
  File "C:\dev\web2py\gluon\dal.py", line 8122, in startswith
raise SyntaxError, "startswith used with incompatible field type"
SyntaxError: startswith used with incompatible field type

Any ideas where to look for this one?

-Jim

-- 





Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Jim S
For the problems I'm having, I only have myself to blame.  We were given 
plenty of time to test our specific implementations but I didn't make the 
time.  I migrated my 2.0.x yesterday and am having issues but Massimo and 
the team are on top of it, helping me out when I've done nothing to deserve 
it.  

To Massimo and the rest of the team, Thank You.

-Jim

On Friday, August 31, 2012 7:46:29 AM UTC-5, Massimo Di Pierro wrote:
>
> We should have tested the osx and win more. This is my mistake. Other 
> minor issues are physiological.
> Anyway, I believe all issues have been taken care within 24hrs.
>
> massimo
>
> On Friday, August 31, 2012 7:28:19 AM UTC-5, viniciusban wrote:
>>
>> See, guys, I'm not blaming anyone and I'm not saying Web2py is not good, 
>> or your work failed. 
>>
>> I pay my bills working with web2py for the last year. I use it for 3 
>> years, now. I really like that and help spread the word. 
>>
>>
>> > Web2py has so much features and it is impossible to test everything. 
>>
>> Sorry, but I cannot agree with this statement. Is it the official 
>> position? 
>>
>> Remember, one of the strengths is our backward compatibility. It can be 
>> achieved with detailed tests **before** anouncing a new stable release. 
>>
>> "Stable" means: "you can download and just use it". Anything different 
>> is "almost stable" or "buggy yet" or, using beautiful words, "release 
>> candidate" or "pre-release version". 
>>
>> I'd like to hear your oppinions. 
>>
>> -- 
>> Vinicius Assef 
>>
>>
>>
>> On 08/31/2012 09:01 AM, Marin Pranjić wrote: 
>> > It is called stable since no one using trunk/nightly build detected 
>> > those errors. 
>> > 
>> > I agree with you, but you cannot blame anyone. 
>> > 
>> > 
>> > On Fri, Aug 31, 2012 at 1:44 PM, vinic...@gmail.com 
>> >  > > > wrote: 
>> > 
>> > First of all, I'd like to thank you all. You're making a great job, 
>> > guys. 
>> > I see web2py becoming more reliable to bigger projects and I'm very 
>> > pleased with it. 
>> > You all rock! :-) 
>> > 
>> > In spite of this huge effort, isn't it premature to call 2.0.2 or 
>> > even 2.0.3 stable? I know there were several months of hard work, 
>> > but if we have bugs detected so fast, we cannot call it stable yet, 
>> > right? 
>> > 
>> > Maybe some release candidate call or a pre-release period for 
>> tests, 
>> > before spreading it as stable would help us. 
>> > 
>> > -- 
>> > Vinicius Assef 
>> > 
>> > 
>> > On 08/30/2012 05:49 PM, Massimo Di Pierro wrote: 
>> > 
>> > All bugs reported today have been fixed in 2.0.3 out now 
>> (except 
>> > a minor 
>> > issue with markmin that we are investigating). 
>> > 
>> > If you find other issues, please continue report them. We'd 
>> > rather fix 
>> > them sooner rather than later. 
>> > 
>> > Thanks for all your help and testing. 
>> > 
>> > Massimo 
>> > 
>> > 
>> > 
>> > On Wednesday, 29 August 2012 22:41:34 UTC-5, Massimo Di Pierro 
>> > wrote: 
>> > 
>> >  After 5 months. It is done. This is the most waited and 
>> the 
>> > most 
>> >  feature-packed release. 
>> > 
>> >  I am sure we'll find some corners that need to be ironed 
>> > but it is 
>> >  considerably better than 1.99.7. It adds lot of new 
>> > features and 
>> >  improves many existing ones: 
>> > 
>> >  - 57,000 new lines of code and closed 279 issues since 
>> 1.99.7. 
>> >  - Retrieving data from DB should be faster, in particular 
>> >  select(cacheable=True) 
>> >  - Has a new scheduler, a built-in wiki, new language and 
>> >  pluralization system, better markmin with oembed support 
>> > and better 
>> >  scaffolding app, increased security. 
>> >  - Lots of experimental features including GIS support, 
>> mongodb 
>> >  support, built-in auth.wiki(), and more. 
>> > 
>> >  Should be 100% backward compatible. If you run into any 
>> > issue let us 
>> >  know ASAP. 
>> > 
>> >  I personally want to thank the major contributors to this 
>> > release 
>> >  (in alphabetic order) 
>> >  Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic, 
>> > Iceberg, 
>> >  Jonathan, Marc, Mariano, Marin, Martin, Mark, Michael, 
>> Michele, 
>> >  Niphlod, Patrick, Vladyslav, 
>> >  They spend many nights testing, coding, debugging at a 
>> very 
>> > fast pace. 
>> > 
>> >  Many many people have contributed. 
>> > 
>> >  If your contribution has not been properly acknowledged 
>> > please let 
>> >  us know ASAP. It is probably an oversight. 
>> > 
>> > 
>>

Re: [web2py] Upgrade to 2.0.x - AttributeError: 'Table' object has no attribute 'permissionid'

2012-08-31 Thread Bruno Rocha
did you turned lazy_tables to True on your db definition?

Bruno Rocha
http://rochacbruno.com.br
mobile
 Em 31/08/2012 10:02, "Jim S"  escreveu:

> Getting the following:
>
> Traceback (most recent call last):
>   File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted
> exec ccode in environment
>   File "C:/dev/web2py/applications/infocenter/models/db.py" 
> , line 152, 
> in 
> format='%(name)s')
>   File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table
> table = self.lazy_define_table(tablename,*fields,**args)
>   File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table
> polymodel=polymodel)
>   File "C:\dev\web2py\gluon\dal.py", line 920, in create_table
> fake_migrate=fake_migrate)
>   File "C:\dev\web2py\gluon\dal.py", line 988, in migrate_table
> and not isinstance(table[key].type, SQLCustomType) \
>   File "C:\dev\web2py\gluon\dal.py", line 7559, in __getitem__
> return ogetattr(self, str(key))
> AttributeError: 'Table' object has no attribute 'permissionid'
>
> Relevant define_table in db.py:
>
> link = db.define_table('link',
> Field('linkId', 'id', readable=False),
> Field('name', length=50, required=True, unique=True),
> Field('parentLinkId', 'reference link', required=True,
>   label='Parent Link'),
> Field('controller', length=512, required=True),
> Field('method', length=512, required=True),
> Field('picture', length=512, required=False),
> Field('permissionId', db.auth_permission, label='Rqd Permission'),
> Field('groupId', db.auth_group, label='Rqd Group'),
> Field('description', 'text', required=True),
> format='%(name)s')
>
>
> This is line 152.  If I change it to the following (added .id to
> definition of permissionId field reference) :
>
> link = db.define_table('link',
>  Field('linkId', 'id', readable=False),
>  Field('name', length=50, required=True, unique=True),
>  Field('parentLinkId', 'reference link', required=True,
>  label='Parent Link'),
>  Field('controller', length=512, required=True),
>  Field('method', length=512, required=True),
>  Field('picture', length=512, required=False),
>  Field('permissionId', db.auth_permission.id, label='Rqd Permission'),
>  Field('groupId', db.auth_group, label='Rqd Group'),
>  Field('description', 'text', required=True),
>  format='%(name)s')
>
> Then I get the following traceback:
>
> Traceback (most recent call last):
>   File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted
> exec ccode in environment
>   File "C:/dev/web2py/applications/infocenter/models/db.py" 
> , line 152, 
> in 
> format='%(name)s')
>   File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table
> table = self.lazy_define_table(tablename,*fields,**args)
>   File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table
> polymodel=polymodel)
>   File "C:\dev\web2py\gluon\dal.py", line 721, in create_table
> elif field_type.startswith('reference'):
>   File "C:\dev\web2py\gluon\dal.py", line 8122, in startswith
> raise SyntaxError, "startswith used with incompatible field type"
> SyntaxError: startswith used with incompatible field type
>
> Any ideas where to look for this one?
>
> -Jim
>
>  --
>
>
>
>

-- 





Re: [web2py] Upgrade to 2.0.x - AttributeError: 'Table' object has no attribute 'permissionid'

2012-08-31 Thread Jim Steil
No, I made no changes to my code what-so-ever.

-Jim

On Fri, Aug 31, 2012 at 8:20 AM, Bruno Rocha  wrote:

> did you turned lazy_tables to True on your db definition?
>
> Bruno Rocha
> http://rochacbruno.com.br
> mobile
>  Em 31/08/2012 10:02, "Jim S"  escreveu:
>
> Getting the following:
>>
>> Traceback (most recent call last):
>>
>>   File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted
>>
>> exec ccode in environment
>>   File "C:/dev/web2py/applications/infocenter/models/db.py" 
>> , line 
>> 152, in 
>>
>> format='%(name)s')
>>   File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table
>>
>> table = self.lazy_define_table(tablename,*fields,**args)
>>
>>   File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table
>>
>> polymodel=polymodel)
>>   File "C:\dev\web2py\gluon\dal.py", line 920, in create_table
>>
>> fake_migrate=fake_migrate)
>>   File "C:\dev\web2py\gluon\dal.py", line 988, in migrate_table
>>
>> and not isinstance(table[key].type, SQLCustomType) \
>>
>>   File "C:\dev\web2py\gluon\dal.py", line 7559, in __getitem__
>>
>> return ogetattr(self, str(key))
>> AttributeError: 'Table' object has no attribute 'permissionid'
>>
>> Relevant define_table in db.py:
>>
>> link = db.define_table('link',
>> Field('linkId', 'id', readable=False),
>> Field('name', length=50, required=True, unique=True),
>> Field('parentLinkId', 'reference link', required=True,
>>   label='Parent Link'),
>> Field('controller', length=512, required=True),
>> Field('method', length=512, required=True),
>> Field('picture', length=512, required=False),
>> Field('permissionId', db.auth_permission, label='Rqd Permission'),
>> Field('groupId', db.auth_group, label='Rqd Group'),
>> Field('description', 'text', required=True),
>> format='%(name)s')
>>
>>
>> This is line 152.  If I change it to the following (added .id to
>> definition of permissionId field reference) :
>>
>> link = db.define_table('link',
>>  Field('linkId', 'id', readable=False),
>>  Field('name', length=50, required=True, unique=True),
>>  Field('parentLinkId', 'reference link', required=True,
>>  label='Parent Link'),
>>  Field('controller', length=512, required=True),
>>  Field('method', length=512, required=True),
>>  Field('picture', length=512, required=False),
>>  Field('permissionId', db.auth_permission.id, label='Rqd Permission'),
>>  Field('groupId', db.auth_group, label='Rqd Group'),
>>  Field('description', 'text', required=True),
>>  format='%(name)s')
>>
>> Then I get the following traceback:
>>
>> Traceback (most recent call last):
>>
>>   File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted
>>
>> exec ccode in environment
>>   File "C:/dev/web2py/applications/infocenter/models/db.py" 
>> , line 
>> 152, in 
>>
>> format='%(name)s')
>>   File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table
>>
>> table = self.lazy_define_table(tablename,*fields,**args)
>>
>>   File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table
>>
>> polymodel=polymodel)
>>   File "C:\dev\web2py\gluon\dal.py", line 721, in create_table
>>
>> elif field_type.startswith('reference'):
>>
>>   File "C:\dev\web2py\gluon\dal.py", line 8122, in startswith
>>
>> raise SyntaxError, "startswith used with incompatible field type"
>> SyntaxError: startswith used with incompatible field type
>>
>> Any ideas where to look for this one?
>>
>> -Jim
>>
>> --
>>
>>
>>
>>
> --
>
>
>
>

-- 





[web2py] Re: problem upgrading from 1.994 to latest version on mac os

2012-08-31 Thread Massimo Di Pierro
I am pretty sure this is resolved. /Applicatoins is not in web2py. That 
must be a folder in your system. I am pretty sure you downloaded web2py in 
the wrong place and are you still trying to run the one posted yesterday. 
This issue has been fixed since 2012-08-31 00:31:48 EST.

Try download it again in a clean folder.

On Friday, 31 August 2012 07:43:08 UTC-5, greaneym wrote:
>
> Hello,
> I just now downloaded again and get a zip file web2py_osx.zip, which 
> uncompressed. I mv'd it to /Applications from ~/Downloads.  When I open, I 
> get a similar error but notice that the word Applications is now spelled 
> Applicatoins in the error which I copied from a popup screen:
>
> OSError: [Errno20] Not a 
> directory:'/Applicatoins/web2py/web2py.app/Contents/Resources/lib/python2.5/site-packages.zip/gluon/contrib/rules'
>
>
>
>

-- 





Re: [web2py] Upgrade to 2.0.x - AttributeError: 'Table' object has no attribute 'permissionid'

2012-08-31 Thread Massimo Di Pierro
I am using trunk (2.0.3). Your original code is correct.

I cannot reproduce the issue. I tried:

$ python web2py.py -S welcome -M -N
>>> link = db.define_table('link', 
Field('linkId', 'id', readable=False),
Field('name', length=50, required=True, unique=True),
Field('parentLinkId', 'reference link', required=True,
  label='Parent Link'),
Field('controller', length=512, required=True),
Field('method', length=512, required=True),
Field('picture', length=512, required=False),
Field('permissionId', db.auth_permission, label='Rqd Permission'),
Field('groupId', db.auth_group, label='Rqd Group'),
Field('description', 'text', required=True),
format='%(name)s')
>>> link


Could you please perform the same check?

On Friday, 31 August 2012 08:29:32 UTC-5, Jim S wrote:
>
> No, I made no changes to my code what-so-ever.
>
> -Jim
>
> On Fri, Aug 31, 2012 at 8:20 AM, Bruno Rocha 
> > wrote:
>
>> did you turned lazy_tables to True on your db definition?
>>
>> Bruno Rocha
>> http://rochacbruno.com.br
>> mobile
>>  Em 31/08/2012 10:02, "Jim S" > escreveu:
>>
>> Getting the following:
>>>
>>> Traceback (most recent call last):
>>>
>>>
>>>   File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted
>>>
>>>
>>> exec ccode in environment
>>>   File "C:/dev/web2py/applications/infocenter/models/db.py" 
>>> , line 
>>> 152, in 
>>>
>>>
>>> format='%(name)s')
>>>   File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table
>>>
>>>
>>> table = self.lazy_define_table(tablename,*fields,**args)
>>>
>>>
>>>   File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table
>>>
>>>
>>> polymodel=polymodel)
>>>   File "C:\dev\web2py\gluon\dal.py", line 920, in create_table
>>>
>>>
>>> fake_migrate=fake_migrate)
>>>   File "C:\dev\web2py\gluon\dal.py", line 988, in migrate_table
>>>
>>>
>>> and not isinstance(table[key].type, SQLCustomType) \
>>>
>>>
>>>   File "C:\dev\web2py\gluon\dal.py", line 7559, in __getitem__
>>>
>>>
>>> return ogetattr(self, str(key))
>>>
>>> AttributeError: 'Table' object has no attribute 'permissionid'
>>>
>>> Relevant define_table in db.py:
>>>
>>> link = db.define_table('link', 
>>> Field('linkId', 'id', readable=False),
>>> Field('name', length=50, required=True, unique=True),
>>> Field('parentLinkId', 'reference link', required=True,
>>>   label='Parent Link'),
>>> Field('controller', length=512, required=True),
>>> Field('method', length=512, required=True),
>>> Field('picture', length=512, required=False),
>>> Field('permissionId', db.auth_permission, label='Rqd Permission'),
>>> Field('groupId', db.auth_group, label='Rqd Group'),
>>> Field('description', 'text', required=True),
>>> format='%(name)s')
>>>
>>>
>>> This is line 152.  If I change it to the following (added .id to 
>>> definition of permissionId field reference) :
>>>
>>> link = db.define_table('link', 
>>>  Field('linkId', 'id', readable=False),
>>>  Field('name', length=50, required=True, unique=True),
>>>  Field('parentLinkId', 'reference link', required=True,
>>>  label='Parent Link'),
>>>  Field('controller', length=512, required=True),
>>>  Field('method', length=512, required=True),
>>>  Field('picture', length=512, required=False),
>>>  Field('permissionId', db.auth_permission.id, label='Rqd Permission'),  
>>>  Field('groupId', db.auth_group, label='Rqd Group'),
>>>  Field('description', 'text', required=True),
>>>  format='%(name)s')
>>>
>>> Then I get the following traceback:
>>>
>>> Traceback (most recent call last):
>>>
>>>
>>>   File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted
>>>
>>>
>>> exec ccode in environment
>>>   File "C:/dev/web2py/applications/infocenter/models/db.py" 
>>> , line 
>>> 152, in 
>>>
>>>
>>> format='%(name)s')
>>>   File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table
>>>
>>>
>>> table = self.lazy_define_table(tablename,*fields,**args)
>>>
>>>
>>>   File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table
>>>
>>>
>>> polymodel=polymodel)
>>>   File "C:\dev\web2py\gluon\dal.py", line 721, in create_table
>>>
>>>
>>> elif field_type.startswith('reference'):
>>>
>>>
>>>   File "C:\dev\web2py\gluon\dal.py", line 8122, in startswith
>>>
>>>
>>> raise SyntaxError, "startswith used with incompatible field type"
>>> SyntaxError: startswith used with incompatible field type
>>>
>>> Any ideas where to look for this one?
>>>
>>> -Jim
>>>
>>> -- 
>>>  
>>>  
>>>  
>>>
>> -- 
>>  
>>  
>>  
>>
>
>

-- 





Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Anthony

>
> > Web2py has so much features and it is impossible to test everything. 
>
> Sorry, but I cannot agree with this statement. Is it the official 
> position? 
>

Well, we can probably improve the unit test coverage. And there's been 
recent talk of developing a test application to check against for some 
functional testing. But as with any software (particularly as complex as a 
web framework), it's not possible to test every conceivable permutation of 
functionality a user might implement. We have to rely on reports of bugs 
found in the wild to some extent.

"Stable" means: "you can download and just use it". Anything different 
> is "almost stable" or "buggy yet" or, using beautiful words, "release 
> candidate" or "pre-release version".
>

We had two (officially labeled) release candidates (
http://code.google.com/p/web2py/source/detail?r=ed41a29eb7c2e283587c141d0464b6c9be68eb0d).
 
Maybe we should change the "Nightly Build" label on the downloads page to 
"Release Candidate", and perhaps advertise a bit more. Not sure it will 
help, though, as there were already many requests for testers. What do you 
suggest?

Anthony

-- 





Re: [web2py] Upgrade to 2.0.x - AttributeError: 'Table' object has no attribute 'permissionid'

2012-08-31 Thread Jim S
Yes, that works for me.

-Jim

On Friday, August 31, 2012 8:36:51 AM UTC-5, Massimo Di Pierro wrote:
>
> I am using trunk (2.0.3). Your original code is correct.
>
> I cannot reproduce the issue. I tried:
>
> $ python web2py.py -S welcome -M -N
> >>> link = db.define_table('link', 
> Field('linkId', 'id', readable=False),
> Field('name', length=50, required=True, unique=True),
> Field('parentLinkId', 'reference link', required=True,
>   label='Parent Link'),
> Field('controller', length=512, required=True),
> Field('method', length=512, required=True),
> Field('picture', length=512, required=False),
> Field('permissionId', db.auth_permission, label='Rqd Permission'),
> Field('groupId', db.auth_group, label='Rqd Group'),
> Field('description', 'text', required=True),
> format='%(name)s')
> >>> link
>  (linkId,name,parentLinkId,controller,method,picture,permissionId,groupId,description)>
>
> Could you please perform the same check?
>
> On Friday, 31 August 2012 08:29:32 UTC-5, Jim S wrote:
>>
>> No, I made no changes to my code what-so-ever.
>>
>> -Jim
>>
>> On Fri, Aug 31, 2012 at 8:20 AM, Bruno Rocha  wrote:
>>
>>> did you turned lazy_tables to True on your db definition?
>>>
>>> Bruno Rocha
>>> http://rochacbruno.com.br
>>> mobile
>>>  Em 31/08/2012 10:02, "Jim S"  escreveu:
>>>
>>> Getting the following:

 Traceback (most recent call last):


   File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted


 exec ccode in environment
   File "C:/dev/web2py/applications/infocenter/models/db.py" 
 , line 
 152, in 


 format='%(name)s')
   File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table


 table = self.lazy_define_table(tablename,*fields,**args)


   File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table


 polymodel=polymodel)
   File "C:\dev\web2py\gluon\dal.py", line 920, in create_table


 fake_migrate=fake_migrate)
   File "C:\dev\web2py\gluon\dal.py", line 988, in migrate_table


 and not isinstance(table[key].type, SQLCustomType) \


   File "C:\dev\web2py\gluon\dal.py", line 7559, in __getitem__


 return ogetattr(self, str(key))

 AttributeError: 'Table' object has no attribute 'permissionid'

 Relevant define_table in db.py:

 link = db.define_table('link', 
 Field('linkId', 'id', readable=False),
 Field('name', length=50, required=True, unique=True),
 Field('parentLinkId', 'reference link', required=True,
   label='Parent Link'),
 Field('controller', length=512, required=True),
 Field('method', length=512, required=True),
 Field('picture', length=512, required=False),
 Field('permissionId', db.auth_permission, label='Rqd Permission'),
 Field('groupId', db.auth_group, label='Rqd Group'),
 Field('description', 'text', required=True),
 format='%(name)s')


 This is line 152.  If I change it to the following (added .id to 
 definition of permissionId field reference) :

 link = db.define_table('link', 
  Field('linkId', 'id', readable=False),
  Field('name', length=50, required=True, unique=True),
  Field('parentLinkId', 'reference link', required=True,
  label='Parent Link'),
  Field('controller', length=512, required=True),
  Field('method', length=512, required=True),
  Field('picture', length=512, required=False),
  Field('permissionId', db.auth_permission.id, label='Rqd Permission'), 
  Field('groupId', db.auth_group, label='Rqd Group'),
  Field('description', 'text', required=True),
  format='%(name)s')

 Then I get the following traceback:

 Traceback (most recent call last):


   File "C:\dev\web2py\gluon\restricted.py", line 209, in restricted


 exec ccode in environment
   File "C:/dev/web2py/applications/infocenter/models/db.py" 
 , line 
 152, in 


 format='%(name)s')
   File "C:\dev\web2py\gluon\dal.py", line 7047, in define_table


 table = self.lazy_define_table(tablename,*fields,**args)


   File "C:\dev\web2py\gluon\dal.py", line 7078, in lazy_define_table


 polymodel=polymodel)
   File "C:\dev\web2py\gluon\dal.py", line 721, in create_table


 elif field_type.startswith('reference'):


   File "C:\dev\web2py\gluon\dal.py", line 8122, in startswith


 raise SyntaxError, "startswith used with incompatible field type"
 SyntaxError: startswith used with incompatible field type

 Any ideas where to look for this one?

 -Jim

 -

[web2py] Re: Issue rendering URL inside an A

2012-08-31 Thread Anthony
To be clear, when you do "view source" in the browser, you see:

http://localhost:8000/web2py_jquery/default/index#null";

I get:

http://localhost:8000/web2py_jquery/default/index#null>"

and I don't see how web2py could be generating your version. Of course, if 
I hover over the link or actually click it, I do get 
http://localhost:8000/web2py_jquery/default/index#null, as the browser 
ultimately has to resolve the full absolute URL. But the source itself 
includes only "#null".

Here's the relevant code from the A.xml method:

self['_href'] = self['_href'] or '#null'

So, if no _href attribute is passed to the helper (as in your code), then 
_href gets set to '#null' (otherwise, the _href is used as submitted). Your 
output implies code more like:

from gluon import current
self['_href'] = self['_href'] or URL(r=current.request, host=
True) + '/#null'

Anthony

On Friday, August 31, 2012 8:10:49 AM UTC-4, Daniel Gonzalez wrote:
>
> From trunk (github)
>
> On Friday, August 31, 2012 1:24:40 PM UTC+2, Anthony wrote:
>>
>> I cannot reproduce this either. Running the latest trunk, here's the 
>> output I get in the browser:
>>
>>  
>> 
>> 
>> 
>> Testing error with URL and A
>> click me
>> /test/default/mycallback
>> 
>> 
>>
>> Are you running from source, or the Windows or Mac binary?
>>
>> Anthony
>>
>> On Friday, August 31, 2012 2:13:01 AM UTC-4, Daniel Gonzalez wrote:
>>>
>>> The problem is still there in Version 2.0.3 (2012-08-31 00:31:48) stable
>>> You can reproduce it with the following minimal application:
>>> https://github.com/gonvaled/web2py-tests/tree/master/problem_A_URL
>>>
>>> On Thursday, August 30, 2012 10:13:11 PM UTC+2, Anthony wrote:

 I think the issue is not in the onclick but the href. When you set the 
 callback but don't set an explicit href, the A() helper should set href to 
 "#null", but for some reason, his code is appending #null to an actual 
 URL. 
 I can't reproduce that when I run the same code.

 Anthony

 On Thursday, August 30, 2012 4:03:29 PM UTC-4, Massimo Di Pierro wrote:
>
> The quotes are escaped when in between quotes. That is the correct 
> thing to do for security. It works fine or does it not?
>
> On Thursday, 30 August 2012 07:00:25 UTC-5, Daniel Gonzalez wrote:
>>
>> Hi,
>>
>> I have the  following markup in an html viewfile:
>>
>> {{=DIV(A('click me',callback=URL('mycallback'),target="me"),_id="me"
>> )}}
>> {{=URL('mycallback')}}
>>
>> Which is producing the following html:
>>
>> http://localhost:8000/web2py_jquery/default/index#null"; onclick="ajax
>> ('/web2py_jquery/default/mycallback',[],'me');return 
>> false">click me
>> /web2py_jquery/default/mycallback
>>
>> (web2py_jquery is just my test application)
>>
>> I do not understand why =URL('callback') is rendering differently 
>> depending on the context. Specially the "#null" makes me worry
>> Is this expected?
>>
>> Thanks,
>> Daniel
>>
>

-- 





Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Richard Vézina
Hello,

I love web2py and normally I just wait a bit when there is new version to
make sure I don't spend to much time on version issue.

I also test de trunk once in a wild, but I found difficult to proceed that
way. 1) I don't have much time, 2) there is often little issue that will be
gone in a release that are actually artifact of development I think. I
mean, the developer know that there is most probably something wrong with
the new code he produce, but just can't test it in all situation.

For sure, tag a beta testing version before releasing could make more work
and struggle with version control to make sure patch spread over all branch
(trunk, beta), but I think it could be very good to have a beta testing a
week before stable.

Anyway, I don't have to much problem with the actual practices, but I think
beta test could had avoid 1.99.5 for example, since this version has be the
beta test version and 1.99.7 the final.

Richard

On Fri, Aug 31, 2012 at 9:49 AM, Anthony  wrote:

> > Web2py has so much features and it is impossible to test everything.
>>
>> Sorry, but I cannot agree with this statement. Is it the official
>> position?
>>
>
> Well, we can probably improve the unit test coverage. And there's been
> recent talk of developing a test application to check against for some
> functional testing. But as with any software (particularly as complex as a
> web framework), it's not possible to test every conceivable permutation of
> functionality a user might implement. We have to rely on reports of bugs
> found in the wild to some extent.
>
> "Stable" means: "you can download and just use it". Anything different
>> is "almost stable" or "buggy yet" or, using beautiful words, "release
>> candidate" or "pre-release version".
>>
>
> We had two (officially labeled) release candidates (
> http://code.google.com/p/web2py/source/detail?r=ed41a29eb7c2e283587c141d0464b6c9be68eb0d).
> Maybe we should change the "Nightly Build" label on the downloads page to
> "Release Candidate", and perhaps advertise a bit more. Not sure it will
> help, though, as there were already many requests for testers. What do you
> suggest?
>
> Anthony
>
> --
>
>
>
>

-- 





[web2py] Re: problem upgrading from 1.994 to latest version on mac os

2012-08-31 Thread greaneym

Massimo,

I changed nothing on my mac and re-downloaded again just now and it is 
working. I don't have any file on my system named "Applicatoin".  But thank 
you, it's working now.



>>
>>
>>

-- 





Re: [web2py] Re: How to turn retrieved rows into a SELECT?

2012-08-31 Thread Richard Vézina
Hmm there is conflict with the plugin and user_signature feature, that's
not good...

Richard

On Thu, Aug 30, 2012 at 10:27 PM, lyn2py  wrote:

> I finally figured out how. Just remove user_signature=True and it works
>
>
> On Thursday, August 30, 2012 9:48:21 PM UTC+8, Richard wrote:
>
>> Will try to do a dummy app ASAP.
>>
>> Richard
>>
>>
>> On Wed, Aug 29, 2012 at 10:07 PM, lyn2py  wrote:
>>
>>> Ok noted on your points below. I would like to clarify.
>>>
>>> First, the plugin files are only a controller file and a module file.
>>> they are both the same as on the web page.
>>> Second, I have modified the module file so that it recognizes the first
>>> SELECT field, so the widget initialization looks different from the example
>>> on the website.
>>> Third, regarding your comment that the plugin (module file) should be
>>> the one that returns the HTML, this I am not too sure.  When I run the
>>> original code, the ajax call goes to the controller, not the module file.
>>> And the controller looks like
>>>
>>> def index():
>>>
>>> form = SQLFORM(db.product)
>>>
>>> if form.accepts(request.vars, session):
>>>
>>> session.flash = 'submitted %s' % form.vars
>>>
>>> redirect(URL('index'))
>>>
>>> return dict(form=form,
>>>
>>> categories=SQLTABLE(db().selec**t(db.category.ALL)),
>>>
>>> colors=SQLTABLE(db(db.color.id > 0)(db.color.category == 
>>> db.category.id
>>>
>>> ).select(db.color.id, db.category.name, 
>>> db.color.name)))
>>>
>>>
>>> Questions:
>>> Per your reply below, How does the widget "call" itself from the
>>> controller and return the select field?
>>>
>>> I think I don't understand the widget as well as you do. As you already
>>> have my model and controller code, can you give me an example of how my
>>> controller code should look like so that the widget works?
>>>
>>> Thanks.
>>>
>>> On Thursday, August 30, 2012 3:44:58 AM UTC+8, Richard wrote:
>>>
 Here the example about how to initialize the widget :

 db.product.color.widget = lazy_options_widget(


   'product_category__selected', 
 'product_category__unselected',


   lambda category_id: (db.color.category == category_id),


   request.vars.category,


   orderby=db.color.id,


   user_signature=True,


   # If you want to process ajax requests at the time of 
 the object construction (not at the form rendered),


   # specify your target field in the following:
   field=db.product.color,


   )


 I am not sure what are : 'jsChangeOn','jsChangeOff',

 In your widget init...

 And I don't understand why you need to create a lazy_option function??

 Did you install the plugin into your app and make the proper import or
 did you try to just copy/paste the code provided on the web page of
 s-cubism??

 You don't need the your function it suppose to be the
 lazy_option_widget that do this task of making the ajax call and return the
 answer from the database to your view and update you dropbox (html SELECT
 OPTIONS)...

 I am puzzled a bit.

 R

 On Wed, Aug 29, 2012 at 12:02 PM, lyn2py  wrote:

> OK sure :)
>
> MODELS
> db.define_table('quotations',
> Field('company_id','reference companies'),
> Field('contact_id','reference contacts',
> widget=lazy_options_widget('**js**ChangeOn','jsChangeOff',
> lambda customer_id: (db.contacts.customer_id == customer_id),
> trigger=request.vars.customer_id, keyword="id",
> user_signature=True)
> ),
>  Field('name','string',length=**2**55,requires=IS_NOT_EMPTY()),
> )
>
> db.companies and db.contacts are just separate tables, where each
> company can have many different contacts.
>
> CONTROLLER
> def test():
> form=SQLFORM(db.quotations)
> # rows = 
> db(db.contacts.customer_id==request.post_vars.id
> ).select()
> return locals()
>
> def lazy_options():
> if request.env.request_method=='**P**OST':
> rows = 
> db(db.contacts.customer_id==request.post_vars.id
> ).select()
> return SQLTABLE(rows)
> else:
> return None
>
> As I have no intentions to save the form, dbio codes has been left out.
>
> I am using a generic view.
> I made changes to the plugin to recognize the javascript onchange, so
> there is no problems with detecting and making the ajax call. The ajax 
> call
> goes to a separate page "lazy_options" in the same controller.

Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Anthony

>
> but I think it could be very good to have a beta testing a week before 
> stable.
>

July 15: 
https://groups.google.com/forum/#!msg/web2py/oJWdhd9WENE/vqLrMgnmLT4J
August 17: 
https://groups.google.com/forum/#!msg/web2py/YNfreBJ2LYo/vr59ctrKYboJ
August 26: 
https://groups.google.com/forum/?fromgroups=#!searchin/web2py/testers/web2py/7PuwtVZXBZE/xwS1qk1mNT0J

All well before the 2.0.2 stable release.

Anthony

-- 





Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Richard Vézina
I know, I had test a couple of time...

I have many difficulties to migrate since 1.99.7, before this version I was
following web2py cycle with not so much difficulties...

I could just develop a dummy app to test the new features, but it takes
time.

If there were testing app, were we could all implement part of new features
and that contain old implementation too, maybe it could be easier to test
carefully the new version.

Richard

On Fri, Aug 31, 2012 at 10:35 AM, Anthony  wrote:

> but I think it could be very good to have a beta testing a week before
>> stable.
>>
>
> July 15:
> https://groups.google.com/forum/#!msg/web2py/oJWdhd9WENE/vqLrMgnmLT4J
> August 17:
> https://groups.google.com/forum/#!msg/web2py/YNfreBJ2LYo/vr59ctrKYboJ
> August 26:
> https://groups.google.com/forum/?fromgroups=#!searchin/web2py/testers/web2py/7PuwtVZXBZE/xwS1qk1mNT0J
>
> All well before the 2.0.2 stable release.
>
> Anthony
>
> --
>
>
>
>

-- 





Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Anthony
It's also worth noting that with this release, 2.0.1 was not released as 
"stable" but was only ever labeled as a release candidate (rc4 and rc5). 
The first "stable" release was actually 2.0.2. This is a little different 
from how it was done in the past (in the past, .1 would have been released 
as "stable"), yet we see mostly the same behavior (more extensive trial, 
testing, and bug reporting once the first "stable" release comes out). 
Perhaps we can improve on this a bit with more explicit advertising about 
the release candidate.

Anthony

On Friday, August 31, 2012 9:49:18 AM UTC-4, Anthony wrote:
>
> > Web2py has so much features and it is impossible to test everything. 
>>
>> Sorry, but I cannot agree with this statement. Is it the official 
>> position? 
>>
>
> Well, we can probably improve the unit test coverage. And there's been 
> recent talk of developing a test application to check against for some 
> functional testing. But as with any software (particularly as complex as a 
> web framework), it's not possible to test every conceivable permutation of 
> functionality a user might implement. We have to rely on reports of bugs 
> found in the wild to some extent.
>
> "Stable" means: "you can download and just use it". Anything different 
>> is "almost stable" or "buggy yet" or, using beautiful words, "release 
>> candidate" or "pre-release version".
>>
>
> We had two (officially labeled) release candidates (
> http://code.google.com/p/web2py/source/detail?r=ed41a29eb7c2e283587c141d0464b6c9be68eb0d).
>  
> Maybe we should change the "Nightly Build" label on the downloads page to 
> "Release Candidate", and perhaps advertise a bit more. Not sure it will 
> help, though, as there were already many requests for testers. What do you 
> suggest?
>
> Anthony
>

-- 





Re: [web2py] Re: How to turn retrieved rows into a SELECT?

2012-08-31 Thread Massimo Di Pierro
You may be making all your data publicly readable/writable and deletable if 
you do that.

On Thursday, 30 August 2012 21:27:29 UTC-5, lyn2py wrote:
>
> I finally figured out how. Just remove user_signature=True and it works
>
> On Thursday, August 30, 2012 9:48:21 PM UTC+8, Richard wrote:
>>
>> Will try to do a dummy app ASAP.
>>
>> Richard
>>
>> On Wed, Aug 29, 2012 at 10:07 PM, lyn2py  wrote:
>>
>>> Ok noted on your points below. I would like to clarify.
>>>
>>> First, the plugin files are only a controller file and a module file. 
>>> they are both the same as on the web page.
>>> Second, I have modified the module file so that it recognizes the first 
>>> SELECT field, so the widget initialization looks different from the example 
>>> on the website.
>>> Third, regarding your comment that the plugin (module file) should be 
>>> the one that returns the HTML, this I am not too sure.  When I run the 
>>> original code, the ajax call goes to the controller, not the module file. 
>>> And the controller looks like
>>>
>>> def index():
>>>
>>> form = SQLFORM(db.product)
>>>
>>> if form.accepts(request.vars, session):
>>>
>>> session.flash = 'submitted %s' % form.vars
>>>
>>> redirect(URL('index'))
>>>
>>> return dict(form=form,
>>>
>>> categories=SQLTABLE(db().select(db.category.ALL)),
>>>
>>> colors=SQLTABLE(db(db.color.id > 0)(db.color.category == 
>>> db.category.id
>>>
>>> ).select(db.color.id, db.category.name, 
>>> db.color.name)))
>>>
>>>
>>> Questions:
>>> Per your reply below, How does the widget "call" itself from the 
>>> controller and return the select field?
>>>
>>> I think I don't understand the widget as well as you do. As you already 
>>> have my model and controller code, can you give me an example of how my 
>>> controller code should look like so that the widget works?
>>>
>>> Thanks.
>>>
>>> On Thursday, August 30, 2012 3:44:58 AM UTC+8, Richard wrote:
>>>
 Here the example about how to initialize the widget :

 db.product.color.widget = lazy_options_widget(


   'product_category__selected', 
 'product_category__unselected'**,


   lambda category_id: (db.color.category == category_id),


   request.vars.category,


   orderby=db.color.id,


   user_signature=True,


   # If you want to process ajax requests at the time of 
 the object construction (not at the form rendered),


   # specify your target field in the following:
   field=db.product.color,


   )


 I am not sure what are : 'jsChangeOn','jsChangeOff',

 In your widget init...

 And I don't understand why you need to create a lazy_option function??

 Did you install the plugin into your app and make the proper import or 
 did you try to just copy/paste the code provided on the web page of 
 s-cubism??

 You don't need the your function it suppose to be the 
 lazy_option_widget that do this task of making the ajax call and return 
 the 
 answer from the database to your view and update you dropbox (html SELECT 
 OPTIONS)...

 I am puzzled a bit.

 R

 On Wed, Aug 29, 2012 at 12:02 PM, lyn2py  wrote:

> OK sure :)
>
> MODELS
> db.define_table('quotations', 
> Field('company_id','reference companies'),
> Field('contact_id','reference contacts',
> widget=lazy_options_widget('**jsChangeOn','jsChangeOff',
> lambda customer_id: (db.contacts.customer_id == customer_id),
> trigger=request.vars.customer_**id, keyword="id",
> user_signature=True)
> ), 
>  Field('name','string',length=**255,requires=IS_NOT_EMPTY()),
> )
>
> db.companies and db.contacts are just separate tables, where each 
> company can have many different contacts.
>
> CONTROLLER
> def test():
> form=SQLFORM(db.quotations)
> # rows = 
> db(db.contacts.customer_id==re**quest.post_vars.id
> ).select()
> return locals()
>
> def lazy_options():
> if request.env.request_method=='**POST':
> rows = 
> db(db.contacts.customer_id==re**quest.post_vars.id
> ).select()
> return SQLTABLE(rows)
> else:
> return None
>
> As I have no intentions to save the form, dbio codes has been left out.
>
> I am using a generic view.
> I made changes to the plugin to recognize the javascript onchange, so 
> there is no problems with detecting and making the ajax call. The ajax 
> call 
> goes to a separate page "lazy_options" in the same c

Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread greaneym
Web2py and its support community are fantastic. I will try to participate 
more in testing.


On Friday, August 31, 2012 7:46:29 AM UTC-5, Massimo Di Pierro wrote:
>
> We should have tested the osx and win more. This is my mistake. Other 
> minor issues are physiological.
> Anyway, I believe all issues have been taken care within 24hrs.
>
> massimo
>
> On Friday, August 31, 2012 7:28:19 AM UTC-5, viniciusban wrote:
>>
>> See, guys, I'm not blaming anyone and I'm not saying Web2py is not good, 
>> or your work failed. 
>>
>> I pay my bills working with web2py for the last year. I use it for 3 
>> years, now. I really like that and help spread the word. 
>>
>>
>> > Web2py has so much features and it is impossible to test everything. 
>>
>> Sorry, but I cannot agree with this statement. Is it the official 
>> position? 
>>
>> Remember, one of the strengths is our backward compatibility. It can be 
>> achieved with detailed tests **before** anouncing a new stable release. 
>>
>> "Stable" means: "you can download and just use it". Anything different 
>> is "almost stable" or "buggy yet" or, using beautiful words, "release 
>> candidate" or "pre-release version". 
>>
>> I'd like to hear your oppinions. 
>>
>> -- 
>> Vinicius Assef 
>>
>>
>>
>> On 08/31/2012 09:01 AM, Marin Pranjić wrote: 
>> > It is called stable since no one using trunk/nightly build detected 
>> > those errors. 
>> > 
>> > I agree with you, but you cannot blame anyone. 
>> > 
>> > 
>> > On Fri, Aug 31, 2012 at 1:44 PM, vinic...@gmail.com 
>> >  > > > wrote: 
>> > 
>> > First of all, I'd like to thank you all. You're making a great job, 
>> > guys. 
>> > I see web2py becoming more reliable to bigger projects and I'm very 
>> > pleased with it. 
>> > You all rock! :-) 
>> > 
>> > In spite of this huge effort, isn't it premature to call 2.0.2 or 
>> > even 2.0.3 stable? I know there were several months of hard work, 
>> > but if we have bugs detected so fast, we cannot call it stable yet, 
>> > right? 
>> > 
>> > Maybe some release candidate call or a pre-release period for 
>> tests, 
>> > before spreading it as stable would help us. 
>> > 
>> > -- 
>> > Vinicius Assef 
>> > 
>> > 
>> > On 08/30/2012 05:49 PM, Massimo Di Pierro wrote: 
>> > 
>> > All bugs reported today have been fixed in 2.0.3 out now 
>> (except 
>> > a minor 
>> > issue with markmin that we are investigating). 
>> > 
>> > If you find other issues, please continue report them. We'd 
>> > rather fix 
>> > them sooner rather than later. 
>> > 
>> > Thanks for all your help and testing. 
>> > 
>> > Massimo 
>> > 
>> > 
>> > 
>> > On Wednesday, 29 August 2012 22:41:34 UTC-5, Massimo Di Pierro 
>> > wrote: 
>> > 
>> >  After 5 months. It is done. This is the most waited and 
>> the 
>> > most 
>> >  feature-packed release. 
>> > 
>> >  I am sure we'll find some corners that need to be ironed 
>> > but it is 
>> >  considerably better than 1.99.7. It adds lot of new 
>> > features and 
>> >  improves many existing ones: 
>> > 
>> >  - 57,000 new lines of code and closed 279 issues since 
>> 1.99.7. 
>> >  - Retrieving data from DB should be faster, in particular 
>> >  select(cacheable=True) 
>> >  - Has a new scheduler, a built-in wiki, new language and 
>> >  pluralization system, better markmin with oembed support 
>> > and better 
>> >  scaffolding app, increased security. 
>> >  - Lots of experimental features including GIS support, 
>> mongodb 
>> >  support, built-in auth.wiki(), and more. 
>> > 
>> >  Should be 100% backward compatible. If you run into any 
>> > issue let us 
>> >  know ASAP. 
>> > 
>> >  I personally want to thank the major contributors to this 
>> > release 
>> >  (in alphabetic order) 
>> >  Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic, 
>> > Iceberg, 
>> >  Jonathan, Marc, Mariano, Marin, Martin, Mark, Michael, 
>> Michele, 
>> >  Niphlod, Patrick, Vladyslav, 
>> >  They spend many nights testing, coding, debugging at a 
>> very 
>> > fast pace. 
>> > 
>> >  Many many people have contributed. 
>> > 
>> >  If your contribution has not been properly acknowledged 
>> > please let 
>> >  us know ASAP. It is probably an oversight. 
>> > 
>> > 
>> >  Massimo 
>> > 
>> > 
>> >  Detailed changelog 
>> >  === 
>> > 
>> >  ## 2.00.2 
>> > 
>> >  ### DAL Improvements 
>> > 
>> >  - Support for DAL(lazy_tables=True) and 
>> > 

[web2py] plugin_detect_mobile in Coockbook

2012-08-31 Thread andrej burja
in the book Application development cookbock
there is plugin_detec_mobile (page 324)

and there is a line, 
if switch_view:
view = '%(controller)s/%(function)s.mobile.%(extension)s' %
request
if os.path.exists(os.path.join(request.folder, 'views',view)):
   response.view = view

there is something wrong, but i don know how to correct this

andrej

-- 





[web2py] Async processing options

2012-08-31 Thread Yarin
I have an app where the user uploads a large photo using web2py's normal 
upload mechanism. After that, the program needs to do some image 
manipulation, upload it to cloudfiles, and update the db when it's 
complete. But I don't want to require the user to wait around for all that 
to finish before receiving a response. 

What are the options for getting a response back when the initial upload 
completes, yet at the same time kicking off an async process that finishes 
the job of processing the image on the server side?

(I could use the scheduler, but I'm wondering if there's a more basic 
approach for this type of case)

-- 





[web2py] Re: Async processing options

2012-08-31 Thread Niphlod
I'll try to be as little biased as I can: you can embed an ajax call in 
your response page that points to a "hidden" page that does all the work of 
resizing/uploading/updatingthedb. Basically the users uploads the large 
image, you redirect him to "Thanks for posting" page, in that page there is 
an Ajax call to "myprohibitedfunction" - better if protected with 
auth_signature - that takes a parameter of the uploaded image and does all 
the work.

Assuming that you can spare a process/thread for this "hidden" call, the 
real problem is that if the function - myprohibitedfunction - takes a long 
time, the webserver can "see" it as a blocked thread/process and terminate 
it abruptly. That's the main reason behind the existence of all various 
tasks schedulers (and cron scripts). 

Il giorno venerdì 31 agosto 2012 18:24:10 UTC+2, Yarin ha scritto:
>
> I have an app where the user uploads a large photo using web2py's normal 
> upload mechanism. After that, the program needs to do some image 
> manipulation, upload it to cloudfiles, and update the db when it's 
> complete. But I don't want to require the user to wait around for all that 
> to finish before receiving a response. 
>
> What are the options for getting a response back when the initial upload 
> completes, yet at the same time kicking off an async process that finishes 
> the job of processing the image on the server side?
>
> (I could use the scheduler, but I'm wondering if there's a more basic 
> approach for this type of case)
>

-- 





[web2py] Re: web2py 2.02 ( stable) install right next to web2py 1.99.7 (stable) under home/www-data/ ....

2012-08-31 Thread Don_X
For those of you who wish to do the same thing ...and have web2py running 
under apache2 with ubuntu ( in my case it is ubuntu 12.04 LTS )

While the upgrade action is not possible or a bit buggy from 1.99.7 to 
2.02+,
this thread is about installing the latest web2py  in parallel ( or next to 
) your previous installation under the defined location --> /home/www-data/ 
[web2py_folder]  !

 
It is pretty straight forward !
1) make a duplicate of the file /etc/apache2/site-available/default  
#in my case the default was the web2py 1.99.7 and I renamed it web2py.loc
2) change the original default you just renamed to whatever it was before, 
for example, make it point to the default /var/www/ folder for other local 
sites you may have like  html/php  sites etc ...
3) in the web2py.loc file created, change the lines 
   from
 NameVirtualHost *:80
 NameVirtualHost  *:443
   to
  NameVirtualHost web2py.loc:80
  NameVirtualHost web2py.loc:443

by replacing the "*" with the name you want to use locally for that web2py 
version installation ! 
4) save !  then do  sudo a2ensite web2py.loc   
# ( use the same name you have chosen in step 1 & 3  .. off course )
5) restart apache server with ( sudo /etc/init.d/apache2 restart )

Then ...
check to see on your browser if your same web2py install works under the 
new name chosen

install the new web2py 2.02+ in the same directory ( /home/www-data/ 
[web2py2]  )# I chose that name .. you could choose another one ... 
whatever ! .. )
make sure all files are owned by www-data with all related permissions !
Repeat the same steps above but by using the new file copied  ( in the 
example above the file copied  is web2py.loc .. duplicate it and rename )  
so now I have web2py2.loc
go to step 3 above and change the web2py.loc with your new name  ( in this 
case web2py2.loc )
in addition to that ... all reference to the /home/www-data/ [web2py] .. 
should be changed to /home/www-data/ [the_new_name]  like  
/home/www-data/web2py2

all reference to web2py should be changed to the name of the new directory 
created
like in :
   
WSGIDaemonProcess web2py user=www-data group=www-data
WSGIProcessGroup web2py
WSGIScriptAlias / /home/www-data/web2py/wsgihandler.py  
 ( bla bla bla .. )

you would change it to 

WSGIDaemonProcess web2py2 user=www-data group=www-data
WSGIProcessGroup web2py2
WSGIScriptAlias / /home/www-data/web2py2/wsgihandler.py  
 ( bla bla bla .. )

then do step 4 (  with a  sudo a2ensite web2py2.loc  )

restart apache2

and because it is a new install of web2py ( the latest version .. ) 
cd into this new directory before testing it :
 --> cd /home/www-data/web2py2


PS. DO NOT FORGET TO HAVE THAT NEW DIRECTORY and all its contents BE OWNED 
BY  www-data !

and do these 2 additional steps otherwise you will not be able to login the 
admin of 2.02+:

1) sudo -u www-data python -c "from gluon.widget import console; console();"
2) sudo -u www-data python -c "from gluon.main import save_password; 
save_password(raw_input('admin password: '),443)"

and you are done ! .. 

happy coding with the new ! without breaking your old web2py install !

-- 





[web2py] Re: IS_IN_DB limited to parentID==0

2012-08-31 Thread Annet
Hi,

Thanks for your reply, I'll give your solution a try.


Kind regards,

Annet

-- 





Re: [web2py] Removing labels from forms

2012-08-31 Thread Alec Taylor
Perfect, thanks to you both :)

-- 





[web2py] Re: Async processing options

2012-08-31 Thread Yarin
No I'd much rather use the scheduler than introduce ajax- It's the server's 
responsibility after all. Not a big deal, just wanted to make sure I wasn't 
missing something obvious. -Thanks

On Friday, August 31, 2012 12:37:42 PM UTC-4, Niphlod wrote:
>
> I'll try to be as little biased as I can: you can embed an ajax call in 
> your response page that points to a "hidden" page that does all the work of 
> resizing/uploading/updatingthedb. Basically the users uploads the large 
> image, you redirect him to "Thanks for posting" page, in that page there is 
> an Ajax call to "myprohibitedfunction" - better if protected with 
> auth_signature - that takes a parameter of the uploaded image and does all 
> the work.
>
> Assuming that you can spare a process/thread for this "hidden" call, the 
> real problem is that if the function - myprohibitedfunction - takes a long 
> time, the webserver can "see" it as a blocked thread/process and terminate 
> it abruptly. That's the main reason behind the existence of all various 
> tasks schedulers (and cron scripts). 
>
> Il giorno venerdì 31 agosto 2012 18:24:10 UTC+2, Yarin ha scritto:
>>
>> I have an app where the user uploads a large photo using web2py's normal 
>> upload mechanism. After that, the program needs to do some image 
>> manipulation, upload it to cloudfiles, and update the db when it's 
>> complete. But I don't want to require the user to wait around for all that 
>> to finish before receiving a response. 
>>
>> What are the options for getting a response back when the initial upload 
>> completes, yet at the same time kicking off an async process that finishes 
>> the job of processing the image on the server side?
>>
>> (I could use the scheduler, but I'm wondering if there's a more basic 
>> approach for this type of case)
>>
>

-- 





Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Le Don X
Well .. so far  all the mini apps  I have done on web2py 1.99.7  are
working fine with 2.02+ ...  I have not found any issues yet ! ... except
for that upgrade button on 1.99.7 that is not working on any platform or
browser !! ( well .. maybe with a mac platform ! - I did not test it on a
mac ) ... ... so a new install has to be made in parallel for the time
being ! ... or another option is to follow the directives on the web2py app
dev cookbook  on chapter 11 page 304 !  ( please note that I don't
recommend an upgrade ... a new install or parallel install is better and
safer ! ) .. it depends also on how far you are in your main app dev !

GOOD JOB WEB2PY DEVELOPERS ... & THANK YOU MASSIMO ... ANTHONY ... BRUNO
... and all the others .. who have always been there, somehow,  for me with
my learning curve of  web2py & python ...

-- 





[web2py] Re: 2.02 can't edit examples - no languages folder

2012-08-31 Thread Nico Zanferrari
I'm sorry but the folder:web2py/applications/examples/languages

is still missing in the 2.0.3 source code (web2py_src.zip  of 2012-08-30 
21:45:50 ) . After creating it manually, editing examples application works 
fine.

Nico

Il giorno giovedì 30 agosto 2012 22:07:51 UTC+2, Massimo Di Pierro ha 
scritto:
>
> This should be fixed in trunk and will be fixed in 2.0.3 (to be released 
> today). can you please check it?
>
> On Thursday, 30 August 2012 10:34:52 UTC-5, Adi wrote:
>>
>>  [Errno 2] No such file or directory: 
>> '/Users/adnan/web2py-branch9/applications/examples/languages'
>>
>>

-- 





[web2py] Re: Deploying as RPM

2012-08-31 Thread LightDot
Sure, I can clean up my spec file for web2py and post it as a starting 
point / reference. What I'd really like to do is bring it up closer to 
general Fedora standards in the process, perhaps aiming at an inclusion 
into Fedora/EPEL later on.

The main difference now (a major one) is that I package web2py for a 
specific single application on RHEL 6. I'd like to evolve this into a 
general package, which can be used by more than one system user, on 
different paths, with more than one web server etc.. So, a whole different 
set of issues arise. Here is my to-do / issues list:

- aim for packaging web2py to use it's internal web server by default (with 
added instructions / scripts to use apache/mod_wsgi)
- patch web2py to disable updates trough admin app (i see no difficulties 
here, I just didn't do this yet)
- clean up bundled libraries and package those that are necessary or nice 
to have
- decouple /gluon from /applications.

About the bundled libraries - Fedora doesn't allow library bundling, unless 
an exception is requested and granted, which is rare. So:
- what from the gluon/contrib doesn't exist in Fedora and is essential for 
running core web2py (if any?)
- what from the gluon/contrib doesn't exist in Fedora but would be nice to 
have
- what from /scripts would be nice to have?

About decoupling /gluon from /applications, is the way debian's package 
does it a good way to go on about this? Is anyone here using debian 
packages..? How about existing Issue 
791
?

I would really appreciate some feedback, especially on the library bundling 
and gluon/app decoupling. If these questions/issues can be properly 
resolved, I'd be glad to support the RPMs for the foreseeable future.

Regards,
Ales


On Wednesday, August 29, 2012 4:39:55 PM UTC+2, Massimo Di Pierro wrote:
>
> Can you tell us more. Perhaps share an example that packages web2py
>
> On Tuesday, 28 August 2012 23:05:16 UTC-5, LightDot wrote:
>>
>> I'm distributing and supporting a project made with web2py as a set of 
>> RPMs (RHEL/CentOS/SL) for a while now. No big problems... I use Mock on SL6 
>> to generate the RPMs.
>>
>> This project is fairly complex and involves much more than just web2py 
>> app, so my spec files wouldn't be applicaple straight away. But the parts 
>> that concern web2py itself are straightforward. I just wrote the spec files 
>> from blank, according to Fedora / RHEL standards. Their rpm/spec 
>> documentation is pretty good.
>>
>> As to your error - it seems that the string "of secure database-driven 
>> web-based applications, written and" gets misinterpreted as a tag. I assume 
>> it's a part of the textual description that should be under a %*
>> description* tag..? Can't say what causes this without looking at the 
>> spec file, though.
>>
>> Regards,
>> Ales
>>
>>
>> On Wednesday, August 29, 2012 5:26:12 AM UTC+2, thinkwell wrote:
>>>
>>> Hello everyone,
>>>
>>> The report feature I've been toiling over is now finished - YEA! and 
>>> ready to be to deployed to the /opt/www/web2py directory of the various 
>>> machines. This is a task for puppet, which we use for config & package 
>>> management as it handles RPMs and custom repos extremely well, so that was 
>>> my plan for deploying this project.
>>>
>>> My thought was to make an RPM by running setup.py bdist_rpm, but even a 
>>> fresh copy of web2py throws errors like:
>>>
>>> error: line 7: Unknown tag: of secure database-driven web-based 
>>> applications, written and
>>> error: query of specfile build/bdist.linux-i686/rpm/SPECS/web2py.spec 
>>> failed, can't parse
>>> error: Failed to execute: "rpm -q --qf 
>>> '%{name}-%{version}-%{release}.src.rpm 
>>> %{arch}/%{name}-%{version}-%{release}.%{arch}.rpm\\n' --specfile 
>>> 'build/bdist.linux-i686/rpm/SPECS/web2py.spec'"
>>>
>>> Any suggestions? I'm green when it comes to making noarch RPMs with 
>>> rpmbuild. This is a nonstandard use-case I suppose because it's getting 
>>> deployed somewhat as an application on many servers. I'm open to advice.
>>>
>>

-- 





[web2py] Customizing Auth

2012-08-31 Thread Annet
I defined the following table:


db.define_table(
auth.settings.table_user_name,
Field('title',length=8,requires=IS_IN_SET(['de 
heer','mevrouw'],zero=T('select a value')),label='Aanheft * '),

Field('firstName',length=32,requires=IS_LENGTH(32,error_message=T('length 
exceeds 32 characters')),label='Voornaam'),

Field('lastName',length=64,default='',requires=[IS_LENGTH(64,error_message=T('length
 
exceeds 64 charactrer')),IS_NOT_EMPTY()],notnull=True,label='Achternaam * 
'),

Field('shortname',default='',requires=[IS_LENGTH(128,error_message=T('length 
exceeds 128 
characters')),IS_EMPTY_OR(IS_NOT_IN_DB(db,'custom_auth_table.shortname',error_message=T('shortname
 
already in database')))],notnull=True,unique=True),
Field('phone',length=16,requires=IS_LENGTH(16,error_message='length 
exceeds 16 characters'),label='Telefoon'),

Field('email',length=128,default='',requires=[IS_LENGTH(128,error_message=T('length
 
exceeds 128 characters')),IS_EMAIL(error_message=T('invalid 
email')),IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'custom_auth_table.email',error_message=T('email
 
already in database'))],notnull=True,unique=True,label='E-mail * '),

Field('username',length=32,default='',requires=[IS_LENGTH(32,error_message=T('length
 
exceeds 32 
charactrer')),IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'custom_auth_table.username',error_message=T('username
 
already in 
database'))],notnull=True,unique=True,writable=False,readable=False,label='Gebruikersnaam
 
* '),
Field('password', 
type='password',length=512,requires=[IS_STRONG(),CRYPT()],readable=False,label='Wachtwoord
 
* '),
Field('nodeID','reference 
node',default='',requires=[IS_IN_DB(db,'node.id','%(id)s',zero=T('select a 
value'))],ondelete='CASCADE',notnull=True,writable=False,readable=False),

Field('comment',type='text',requires=IS_LENGTH(512,error_message=T('length 
exceeds 512 characters')),

Field('registration_key',length=512,default='',writable=False,readable=False),

Field('reset_password_key',length=512,default='',writable=False,readable=False),

Field('registration_id',length=512,default='',writable=False,readable=False),
Field('createdOn',type='datetime',default=request.now),

Field('modifiedOn',type='datetime',default=request.now,update=request.now))

## get the custom_auth_table
custom_auth_table = db[auth.settings.table_user_name]
## tell auth to use custom_auth_table
auth.settings.table_user = custom_auth_table
## to prevent the auth_cas table from being created
auth.settings.cas_domains = None

## create all tables needed by auth if not custom tables
auth.define_tables(username=True, signature=False)


When I save the file, the 'Last saved on' field colors yellow and the line:

custom_auth_table = db[auth.settings.table_user_name]

... becomes gray. When I go to 'edit application init' and click the 
'database administration' button I get the following error:

Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/web2py/gluon/restricted.py", line 
208, in restricted
ccode = compile2(code,layer)
  File "/Library/Python/2.6/site-packages/web2py/gluon/restricted.py", line 
193, in compile2
return compile(code.rstrip().replace('\r\n','\n')+'\n', layer, 'exec')
  File 
"/Library/Python/2.6/site-packages/web2py/applications/init/models/20_auth_db.py"
 , line 36
custom_auth_table = db[auth.settings.table_user_name]
^
SyntaxError: invalid syntax

 Error snapshot [image: help]  

(invalid syntax (20_auth_db.py, line 36)) 

inspect attributes 
 Frames 
   
   -  
   
   *File /Library/Python/2.6/site-packages/web2py/gluon/restricted.py in 
   restricted at line 208* code arguments variables 
-  
   
   *File /Library/Python/2.6/site-packages/web2py/gluon/restricted.py in 
   compile2 at line 193* code arguments variables 
Function argument list 
   
   (code="# -*- coding: utf-8 
   
-*-\n\n###...use_janrain(auth,filename='private/janrain.key')\n",
 
   
layer='/Library/Python/2.6/site-packages/web2py/applications/init/models/20_auth_db.py')
Code listing 
   
   188.
   189.
   190.
   191.
   192.
   193.
   
   194.
   195.
   196.
   197.
   
   
   def compile2(code,layer):
   """
   The +'\n' is necessary else compile fails when code ends in a comment.
   """
   return compile(code.rstrip().replace('\r\n','\n')+'\n', layer, 'exec')
   
   
   def restricted(code, environment=None, layer='Unknown'):
   """
   runs code in environment and returns the output. if an exception occurs
   
Variables  builtincompile   code "# -*- 
   coding: utf-8 
   
-*-\n\n###...use_janrain(auth,filename='private/janrain.key')\n"
  
   code.rstrip   
   ).replace undefined  layer 
   
'/Library/Python/2.6/site-packages/web2py/applications/init/models/20_auth_db.py'
   

I don't need to use OpenID, Facebook etc. so I commented 

Re: [web2py] 'Auth' object has no attribute 'use_username'

2012-08-31 Thread Annet
I encountered a similar issue:


 'DAL' object has no attribute 'auth_user' 
Version  web2py™ (2, 0, 3, datetime.datetime(2012, 8, 30, 21, 45, 50), 
'stable')  Python Python 2.6.1: /usr/bin/python2.6  Traceback 

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

Traceback (most recent call last):
  File "/Library/Python/2.6/site-packages/web2py/gluon/restricted.py", line 
209, in restricted
exec ccode in environment
  File 
"/Library/Python/2.6/site-packages/web2py/applications/init/views/appadmin.html"
 , line 53, 
in 
{{=form}}
  File "/Library/Python/2.6/site-packages/web2py/gluon/tools.py", line 1263, in 
navbar
self.use_username = 'username' in self.table_user().fields
  File "/Library/Python/2.6/site-packages/web2py/gluon/tools.py", line 1155, in 
table_user
return self.db[self.settings.table_user_name]
  File "/Library/Python/2.6/site-packages/web2py/gluon/dal.py", line 7101, in 
__getitem__
return self.__getattr__(str(key))
  File "/Library/Python/2.6/site-packages/web2py/gluon/dal.py", line 7108, in 
__getattr__
return ogetattr(self, key)
AttributeError: 'DAL' object has no attribute 'auth_user'

 Error snapshot [image: help]  

('DAL' object has no attribute 
'auth_user') 

inspect attributes 
 Frames 
   
   -  
   
   *File /Library/Python/2.6/site-packages/web2py/gluon/restricted.py in 
   restricted at line 209* code arguments variables 
-  
   
   *File 
   
/Library/Python/2.6/site-packages/web2py/applications/init/views/appadmin.html 
   in  at line 53* code arguments variables 
-  
   
   *File /Library/Python/2.6/site-packages/web2py/gluon/tools.py in navbar 
   at line 1263* code arguments variables 
-  
   
   *File /Library/Python/2.6/site-packages/web2py/gluon/tools.py in 
   table_user at line 1155* code arguments variables 
-  
   
   *File /Library/Python/2.6/site-packages/web2py/gluon/dal.py in 
   __getitem__ at line 7101* code arguments variables 
-  
   
   *File /Library/Python/2.6/site-packages/web2py/gluon/dal.py in 
   __getattr__ at line 7108* code arguments variables 
Function argument list 
   
   (self=, 
   key='auth_user')
Code listing 
   
   7103.
   7104.
   7105.
   7106.
   7107.
   7108.
   
   7109.
   7110.
   7111.
   7112.
   
   def __getattr__(self, key):
   if ogetattr(self,'_lazy_tables') and \
   key in ogetattr(self,'_LAZY_TABLES'):
   tablename, fields, args = self._LAZY_TABLES.pop(key)
   return self.lazy_define_table(tablename,*fields,**args)
   return ogetattr(self, key)
   
   
   def __setitem__(self, key, value):
   osetattr(self, str(key), value)
   
Variables  self   global ogetattr 
  key 'auth_user'
   


Kind regards,

Annet

-- 





Re: [web2py] Customizing Auth

2012-08-31 Thread vinicius...@gmail.com

Your error is here:
(invalid syntax (20_auth_db.py, line 36))



On 08/31/2012 02:25 PM, Annet wrote:

|(invalid syntax (20_auth_db.py, line 36))|


--





Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread vinicius...@gmail.com

+1

Again, note that I'm not against our team. I'm on it, too.

I'm not criticizing. I'm suggesting quality improvement.

--
Vinicius Assef



On 08/31/2012 11:07 AM, Richard Vézina wrote:

Hello,

I love web2py and normally I just wait a bit when there is new version
to make sure I don't spend to much time on version issue.

I also test de trunk once in a wild, but I found difficult to proceed
that way. 1) I don't have much time, 2) there is often little issue that
will be gone in a release that are actually artifact of development I
think. I mean, the developer know that there is most probably something
wrong with the new code he produce, but just can't test it in all situation.

For sure, tag a beta testing version before releasing could make more
work and struggle with version control to make sure patch spread over
all branch (trunk, beta), but I think it could be very good to have a
beta testing a week before stable.

Anyway, I don't have to much problem with the actual practices, but I
think beta test could had avoid 1.99.5 for example, since this version
has be the beta test version and 1.99.7 the final.

Richard

On Fri, Aug 31, 2012 at 9:49 AM, Anthony mailto:abasta...@gmail.com>> wrote:

> Web2py has so much features and it is impossible to test everything.

Sorry, but I cannot agree with this statement. Is it the
official position?


Well, we can probably improve the unit test coverage. And there's
been recent talk of developing a test application to check against
for some functional testing. But as with any software (particularly
as complex as a web framework), it's not possible to test every
conceivable permutation of functionality a user might implement. We
have to rely on reports of bugs found in the wild to some extent.

"Stable" means: "you can download and just use it". Anything
different
is "almost stable" or "buggy yet" or, using beautiful words,
"release
candidate" or "pre-release version".


We had two (officially labeled) release candidates

(http://code.google.com/p/web2py/source/detail?r=ed41a29eb7c2e283587c141d0464b6c9be68eb0d).
Maybe we should change the "Nightly Build" label on the downloads
page to "Release Candidate", and perhaps advertise a bit more. Not
sure it will help, though, as there were already many requests for
testers. What do you suggest?

Anthony

--




--





--





[web2py] Re: 2.02 can't edit examples - no languages folder

2012-08-31 Thread Massimo Di Pierro
Where did you get the code from (web2py_src.zip, github, googlecode)?

On Friday, 31 August 2012 12:03:11 UTC-5, Nico Zanferrari wrote:
>
> I'm sorry but the folder:web2py/applications/examples/languages
>
> is still missing in the 2.0.3 source code (web2py_src.zip  of 2012-08-30 
> 21:45:50 ) . After creating it manually, editing examples application 
> works fine.
>
> Nico
>

-- 





Re: [web2py] 'Auth' object has no attribute 'use_username'

2012-08-31 Thread Massimo Di Pierro
As stated before this is not a web2py 2.0.x issue. The problem is that you 
have

   auth =Auth()

but you commented out

   auth.define_tables()

yet you have a 

   {{=auth.navbar()}} in the layout.

You cannot have a navbar without defining tables. This would never have 
worked and it should not work.

On Friday, 31 August 2012 12:28:44 UTC-5, Annet wrote:
>
> I encountered a similar issue:
>
>
>  'DAL' object has no attribute 
> 'auth_user' Version  web2py™ (2, 0, 3, datetime.datetime(2012, 8, 30, 21, 
> 45, 50), 'stable')  Python Python 2.6.1: /usr/bin/python2.6  Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
>
> Traceback (most recent call last):
>   File "/Library/Python/2.6/site-packages/web2py/gluon/restricted.py", line 
> 209, in restricted
> exec ccode in environment
>   File 
> "/Library/Python/2.6/site-packages/web2py/applications/init/views/appadmin.html"
>  , line 
> 53, in 
> {{=form}}
>   File "/Library/Python/2.6/site-packages/web2py/gluon/tools.py", line 1263, 
> in navbar
> self.use_username = 'username' in self.table_user().fields
>   File "/Library/Python/2.6/site-packages/web2py/gluon/tools.py", line 1155, 
> in table_user
> return self.db[self.settings.table_user_name]
>   File "/Library/Python/2.6/site-packages/web2py/gluon/dal.py", line 7101, in 
> __getitem__
> return self.__getattr__(str(key))
>   File "/Library/Python/2.6/site-packages/web2py/gluon/dal.py", line 7108, in 
> __getattr__
> return ogetattr(self, key)
> AttributeError: 'DAL' object has no attribute 'auth_user'
>
>  Error snapshot [image: help]  
>
> ('DAL' object has no attribute 
> 'auth_user') 
>
> inspect attributes 
>  Frames 
>
>-  
>
>*File /Library/Python/2.6/site-packages/web2py/gluon/restricted.py in 
>restricted at line 209* code arguments variables 
> -  
>
>*File 
>
> /Library/Python/2.6/site-packages/web2py/applications/init/views/appadmin.html
>  
>in  at line 53* code arguments variables 
> -  
>
>*File /Library/Python/2.6/site-packages/web2py/gluon/tools.py in 
>navbar at line 1263* code arguments variables 
> -  
>
>*File /Library/Python/2.6/site-packages/web2py/gluon/tools.py in 
>table_user at line 1155* code arguments variables 
> -  
>
>*File /Library/Python/2.6/site-packages/web2py/gluon/dal.py in 
>__getitem__ at line 7101* code arguments variables 
> -  
>
>*File /Library/Python/2.6/site-packages/web2py/gluon/dal.py in 
>__getattr__ at line 7108* code arguments variables 
> Function argument list 
>
>(self=, 
>key='auth_user')
> Code listing 
>
>7103.
>7104.
>7105.
>7106.
>7107.
>7108.
>
>7109.
>7110.
>7111.
>7112.
>
>def __getattr__(self, key):
>if ogetattr(self,'_lazy_tables') and \
>key in ogetattr(self,'_LAZY_TABLES'):
>tablename, fields, args = self._LAZY_TABLES.pop(key)
>return self.lazy_define_table(tablename,*fields,**args)
>return ogetattr(self, key)
>
>
>def __setitem__(self, key, value):
>osetattr(self, str(key), value)
>
> Variables  self postgres://leonexus:Jag56#xj65@localhost:5432/leonexus>  global 
>ogetattr   key 
>'auth_user'
>
>
>
> Kind regards,
>
> Annet
>

-- 





[web2py] Re: Customizing Auth

2012-08-31 Thread Massimo Di Pierro
Line

Field('comment',type='text',requires=IS_LENGTH(512,error_message=T('length 
exceeds 512 characters'))

is missing a closed ),

Field('comment',type='text',requires=IS_LENGTH(512,error_message=T('length 
exceeds 512 characters'))),

There may be more typos I did not catch.

On Friday, 31 August 2012 12:25:24 UTC-5, Annet wrote:
>
> I defined the following table:
>
>
> db.define_table(
> auth.settings.table_user_name,
> Field('title',length=8,requires=IS_IN_SET(['de 
> heer','mevrouw'],zero=T('select a value')),label='Aanheft * '),
> 
> Field('firstName',length=32,requires=IS_LENGTH(32,error_message=T('length 
> exceeds 32 characters')),label='Voornaam'),
> 
> Field('lastName',length=64,default='',requires=[IS_LENGTH(64,error_message=T('length
>  
> exceeds 64 charactrer')),IS_NOT_EMPTY()],notnull=True,label='Achternaam * 
> '),
> 
> Field('shortname',default='',requires=[IS_LENGTH(128,error_message=T('length 
> exceeds 128 
> characters')),IS_EMPTY_OR(IS_NOT_IN_DB(db,'custom_auth_table.shortname',error_message=T('shortname
>  
> already in database')))],notnull=True,unique=True),
> Field('phone',length=16,requires=IS_LENGTH(16,error_message='length 
> exceeds 16 characters'),label='Telefoon'),
> 
> Field('email',length=128,default='',requires=[IS_LENGTH(128,error_message=T('length
>  
> exceeds 128 characters')),IS_EMAIL(error_message=T('invalid 
> email')),IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'custom_auth_table.email',error_message=T('email
>  
> already in database'))],notnull=True,unique=True,label='E-mail * '),
> 
> Field('username',length=32,default='',requires=[IS_LENGTH(32,error_message=T('length
>  
> exceeds 32 
> charactrer')),IS_NOT_EMPTY(),IS_NOT_IN_DB(db,'custom_auth_table.username',error_message=T('username
>  
> already in 
> database'))],notnull=True,unique=True,writable=False,readable=False,label='Gebruikersnaam
>  
> * '),
> Field('password', 
> type='password',length=512,requires=[IS_STRONG(),CRYPT()],readable=False,label='Wachtwoord
>  
> * '),
> Field('nodeID','reference node',default='',requires=[IS_IN_DB(db,'
> node.id','%(id)s',zero=T('select a 
> value'))],ondelete='CASCADE',notnull=True,writable=False,readable=False),
> 
> Field('comment',type='text',requires=IS_LENGTH(512,error_message=T('length 
> exceeds 512 characters')),
> 
> Field('registration_key',length=512,default='',writable=False,readable=False),
> 
> Field('reset_password_key',length=512,default='',writable=False,readable=False),
> 
> Field('registration_id',length=512,default='',writable=False,readable=False),
> Field('createdOn',type='datetime',default=request.now),
> 
> Field('modifiedOn',type='datetime',default=request.now,update=request.now))
>
> ## get the custom_auth_table
> custom_auth_table = db[auth.settings.table_user_name]
> ## tell auth to use custom_auth_table
> auth.settings.table_user = custom_auth_table
> ## to prevent the auth_cas table from being created
> auth.settings.cas_domains = None
>
> ## create all tables needed by auth if not custom tables
> auth.define_tables(username=True, signature=False)
>
>
> When I save the file, the 'Last saved on' field colors yellow and the line:
>
> custom_auth_table = db[auth.settings.table_user_name]
>
> ... becomes gray. When I go to 'edit application init' and click the 
> 'database administration' button I get the following error:
>
> Traceback (most recent call last):
>   File "/Library/Python/2.6/site-packages/web2py/gluon/restricted.py", line 
> 208, in restricted
> ccode = compile2(code,layer)
>   File "/Library/Python/2.6/site-packages/web2py/gluon/restricted.py", line 
> 193, in compile2
> return compile(code.rstrip().replace('\r\n','\n')+'\n', layer, 'exec')
>   File 
> "/Library/Python/2.6/site-packages/web2py/applications/init/models/20_auth_db.py"
>  , line 36
> custom_auth_table = db[auth.settings.table_user_name]
> ^
> SyntaxError: invalid syntax
>
>  Error snapshot [image: help]  
>
> (invalid syntax (20_auth_db.py, line 36)) 
>
> inspect attributes 
>  Frames 
>
>-  
>
>*File /Library/Python/2.6/site-packages/web2py/gluon/restricted.py in 
>restricted at line 208* code arguments variables 
> -  
>
>*File /Library/Python/2.6/site-packages/web2py/gluon/restricted.py in 
>compile2 at line 193* code arguments variables 
> Function argument list 
>
>(code="# -*- coding: utf-8 
>
> -*-\n\n###...use_janrain(auth,filename='private/janrain.key')\n",
>  
>
> layer='/Library/Python/2.6/site-packages/web2py/applications/init/models/20_auth_db.py')
> Code listing 
>
>188.
>189.
>190.
>191.
>192.
>193.
>
>194.
>195.
>196.
>197.
>
>
>def compile2(code,layer):
>"""
>The +'\n' is necessary else compile fails when code ends in a comment.
>"""

Re: [web2py] 'Auth' object has no attribute 'use_username'

2012-08-31 Thread Anthony

>
> You cannot have a navbar without defining tables. This would never have 
> worked and it should not work.
>

Looks like it would be easy to make an alteration so navbar wouldn't 
require the auth tables to be defined. We could add an 
auth.settings.use_username setting and use it as an alternative way to do 
auth.define_tables(username=True). The navbar function could then check 
that setting instead of inspecting the table.

Anthony 

-- 





Re: [web2py] Is 2.0.2 or 2.0.3 really a stable version?

2012-08-31 Thread Massimo Di Pierro
Do no worry nobody is offended. :-)

We can do better and we should make better. Anyway let me summarize the 
status:

- There was a problem building OSX and Windows binary. This was because of 
the different folder structure in those distributions. This problem should 
have been caught long ago. I am surprised we did not. Here we can do 
better. (*)
- Remember we changed 57000 lines of code. As a result we had a few 
backward compatibility issues, we test a lot but we cannot test everything 
(default adapter in firebird, unable to create self references when the id 
field is renamed, markmin failure on ` strings). These are minor issues 
that are expected. Affect a small minority of users. So far we have 
addresses them all within 24 hrs. 
- We had some false positives. Bug reports that seem bad but have nothing 
to do with 2.0.x and therefore confused the issue. They are pre-existing 
conditions or bugs in user code.
- There is also a problem with upgrades. The automatic upgrade from admin 
does not detect the presence of the new 2.0.x version. You have to upgrade 
manually. This was a bug in 1.99.7 not in 2.0.x. We are thinking about how 
to address it but we do not have a solution. We may be able to fix it by 
calling 2.0.3 as 1.99.8. Yet does not seem like a good idea.

The real issue was (*). Because of that I have rebuilt the windows and mac 
distributions with slightly different versions than the source distribution 
using a later web2py version. If the problem is resolved, tomorrow, I will 
repost 2.0.4 and make sure everything is again in sync.

Massimo




On Friday, 31 August 2012 13:08:41 UTC-5, viniciusban wrote:
>
> +1 
>
> Again, note that I'm not against our team. I'm on it, too. 
>
> I'm not criticizing. I'm suggesting quality improvement. 
>
> -- 
> Vinicius Assef 
>
>
>
> On 08/31/2012 11:07 AM, Richard Vézina wrote: 
> > Hello, 
> > 
> > I love web2py and normally I just wait a bit when there is new version 
> > to make sure I don't spend to much time on version issue. 
> > 
> > I also test de trunk once in a wild, but I found difficult to proceed 
> > that way. 1) I don't have much time, 2) there is often little issue that 
> > will be gone in a release that are actually artifact of development I 
> > think. I mean, the developer know that there is most probably something 
> > wrong with the new code he produce, but just can't test it in all 
> situation. 
> > 
> > For sure, tag a beta testing version before releasing could make more 
> > work and struggle with version control to make sure patch spread over 
> > all branch (trunk, beta), but I think it could be very good to have a 
> > beta testing a week before stable. 
> > 
> > Anyway, I don't have to much problem with the actual practices, but I 
> > think beta test could had avoid 1.99.5 for example, since this version 
> > has be the beta test version and 1.99.7 the final. 
> > 
> > Richard 
> > 
> > On Fri, Aug 31, 2012 at 9:49 AM, Anthony  
> > > wrote: 
> > 
> > > Web2py has so much features and it is impossible to test 
> everything. 
> > 
> > Sorry, but I cannot agree with this statement. Is it the 
> > official position? 
> > 
> > 
> > Well, we can probably improve the unit test coverage. And there's 
> > been recent talk of developing a test application to check against 
> > for some functional testing. But as with any software (particularly 
> > as complex as a web framework), it's not possible to test every 
> > conceivable permutation of functionality a user might implement. We 
> > have to rely on reports of bugs found in the wild to some extent. 
> > 
> > "Stable" means: "you can download and just use it". Anything 
> > different 
> > is "almost stable" or "buggy yet" or, using beautiful words, 
> > "release 
> > candidate" or "pre-release version". 
> > 
> > 
> > We had two (officially labeled) release candidates 
> > (
> http://code.google.com/p/web2py/source/detail?r=ed41a29eb7c2e283587c141d0464b6c9be68eb0d).
>  
>
> > Maybe we should change the "Nightly Build" label on the downloads 
> > page to "Release Candidate", and perhaps advertise a bit more. Not 
> > sure it will help, though, as there were already many requests for 
> > testers. What do you suggest? 
> > 
> > Anthony 
> > 
> > -- 
> > 
> > 
> > 
> > 
> > -- 
> > 
> > 
> > 
>

-- 





Re: [web2py] 'Auth' object has no attribute 'use_username'

2012-08-31 Thread Massimo Di Pierro
what is the point of  auth = Auth(db) in your code without having an 
auth_user table? I must be missing something about what you are trying to 
do.

On Friday, 31 August 2012 13:58:19 UTC-5, Anthony wrote:
>
> You cannot have a navbar without defining tables. This would never have 
>> worked and it should not work.
>>
>
> Looks like it would be easy to make an alteration so navbar wouldn't 
> require the auth tables to be defined. We could add an 
> auth.settings.use_username setting and use it as an alternative way to do 
> auth.define_tables(username=True). The navbar function could then check 
> that setting instead of inspecting the table.
>
> Anthony 
>

-- 





Re: [web2py] Re: 2.02 can't edit examples - no languages folder

2012-08-31 Thread Adnan Smajlovic
Nico, I noticed you use yesterday's build... I took today's from github,
and all works fine..
On Aug 31, 2012 2:37 PM, "Massimo Di Pierro" 
wrote:

> Where did you get the code from (web2py_src.zip, github, googlecode)?
>
> On Friday, 31 August 2012 12:03:11 UTC-5, Nico Zanferrari wrote:
>>
>> I'm sorry but the folder:web2py/applications/examples/**languages
>>
>> is still missing in the 2.0.3 source code (web2py_src.zip  of 2012-08-30
>> 21:45:50 ) . After creating it manually, editing examples application
>> works fine.
>>
>> Nico
>>
>  --
>
>
>
>

-- 





[web2py] Too many values to unpack -- regression?

2012-08-31 Thread Brad Miller
I just upgraded my app to the latest 2.0.3 (stable)  and while checking 
some of my pages got the following error:

Traceback (most recent call last):
  File "/Users/bmiller/Beta/web2py/gluon/restricted.py", line 209, in 
restricted
exec ccode in environment
  File 
"/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
line 160, in 
  File "/Users/bmiller/Beta/web2py/gluon/globals.py", line 185, in 
self._caller = lambda f: f()
  File "/Users/bmiller/Beta/web2py/gluon/tools.py", line 2780, in f
return action(*a, **b)
  File 
"/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
line 116, in studentactivity
db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 8692, in select
return adapter.select(self.query,fields,attributes)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 2029, in select
return super(SQLiteAdapter, self).select(query, fields, attributes)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1529, in select
return self._select_aux(sql,fields,attributes)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1510, in _select_aux
return processor(rows,fields,self._colnames,cacheable=cacheable)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1886, in parse
fields[j].type,blob_decode)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1718, in parse_value
return self.parsemap[key](value,field_type)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1753, in 
parse_datetime
value,tz = value.split('-')
ValueError: too many values to unpack

This is the result of this this query code, which continues to work under 
1.99.7

count = db.useinfo.id.count()
last = db.useinfo.timestamp.max()
res = db(db.useinfo.course_id==course.course_id).select(
db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)

I'm assuming this is some kind of regression since the same code is working 
in 1.99.7, but maybe I'm doing something that I could do  but no longer 
should??

Brad

-- 





Re: [web2py] Re: 2.02 can't edit examples - no languages folder

2012-08-31 Thread Nico Zanferrari
Yes, you're right. The problem is already fixed in the nightly build, but 
not in the  Current version: 2.0.3 (2012-08-30 21:45:50) stable  available 
in the download page.

thank you,
Nico

-- 





[web2py] Re: Too many values to unpack -- regression?

2012-08-31 Thread Niphlod
seems more a problem with returned values than a different form of select 
.
can you please the output of res with the _select (mind the underscore) 
with both versions ?

count = db.useinfo.id.count()
last = db.useinfo.timestamp.max()
res = db(db.useinfo.course_id==course.course_id)._select(
db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)



On Friday, August 31, 2012 9:53:16 PM UTC+2, Brad Miller wrote:
>
> I just upgraded my app to the latest 2.0.3 (stable)  and while checking 
> some of my pages got the following error:
>
> Traceback (most recent call last):
>   File "/Users/bmiller/Beta/web2py/gluon/restricted.py", line 209, in 
> restricted
> exec ccode in environment
>   File 
> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
> line 160, in 
>   File "/Users/bmiller/Beta/web2py/gluon/globals.py", line 185, in 
> self._caller = lambda f: f()
>   File "/Users/bmiller/Beta/web2py/gluon/tools.py", line 2780, in f
> return action(*a, **b)
>   File 
> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
> line 116, in studentactivity
> db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 8692, in select
> return adapter.select(self.query,fields,attributes)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 2029, in select
> return super(SQLiteAdapter, self).select(query, fields, attributes)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1529, in select
> return self._select_aux(sql,fields,attributes)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1510, in _select_aux
> return processor(rows,fields,self._colnames,cacheable=cacheable)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1886, in parse
> fields[j].type,blob_decode)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1718, in parse_value
> return self.parsemap[key](value,field_type)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1753, in 
> parse_datetime
> value,tz = value.split('-')
> ValueError: too many values to unpack
>
> This is the result of this this query code, which continues to work under 
> 1.99.7
>
> count = db.useinfo.id.count()
> last = db.useinfo.timestamp.max()
> res = db(db.useinfo.course_id==course.course_id).select(
> db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
>
> I'm assuming this is some kind of regression since the same code is 
> working in 1.99.7, but maybe I'm doing something that I could do  but no 
> longer should??
>
> Brad
>
>

-- 





[web2py] Re: Too many values to unpack -- regression?

2012-08-31 Thread Massimo Di Pierro
This is the code that causes the problem to you:

def parse_datetime(self, value, field_type):
if not isinstance(value, datetime.datetime):

elif '-' in value:
value,tz = value.split('-')

This function is called when parsing data retrieved from database. The 
reason it is failing is that data is corrupted (contains more than one dash 
and that is not allowed by ISO standard). What database (my guess is 
sqlite, which allows you to change a string field into a datetime while 
leaving data in there). Can you add a print statement and see what the data 
looks like:

def parse_datetime(self, value, field_type):
if not isinstance(value, datetime.datetime):
print value


Let me know it may help understand how the data got in there.

On Friday, 31 August 2012 14:53:16 UTC-5, Brad Miller wrote:
>
> I just upgraded my app to the latest 2.0.3 (stable)  and while checking 
> some of my pages got the following error:
>
> Traceback (most recent call last):
>   File "/Users/bmiller/Beta/web2py/gluon/restricted.py", line 209, in 
> restricted
> exec ccode in environment
>   File 
> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
> line 160, in 
>   File "/Users/bmiller/Beta/web2py/gluon/globals.py", line 185, in 
> self._caller = lambda f: f()
>   File "/Users/bmiller/Beta/web2py/gluon/tools.py", line 2780, in f
> return action(*a, **b)
>   File 
> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
> line 116, in studentactivity
> db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 8692, in select
> return adapter.select(self.query,fields,attributes)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 2029, in select
> return super(SQLiteAdapter, self).select(query, fields, attributes)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1529, in select
> return self._select_aux(sql,fields,attributes)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1510, in _select_aux
> return processor(rows,fields,self._colnames,cacheable=cacheable)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1886, in parse
> fields[j].type,blob_decode)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1718, in parse_value
> return self.parsemap[key](value,field_type)
>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1753, in 
> parse_datetime
> value,tz = value.split('-')
> ValueError: too many values to unpack
>
> This is the result of this this query code, which continues to work under 
> 1.99.7
>
> count = db.useinfo.id.count()
> last = db.useinfo.timestamp.max()
> res = db(db.useinfo.course_id==course.course_id).select(
> db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
>
> I'm assuming this is some kind of regression since the same code is 
> working in 1.99.7, but maybe I'm doing something that I could do  but no 
> longer should??
>
> Brad
>
>

-- 





[web2py] Re: Smartgrid web2py_console element placement change

2012-08-31 Thread Massimo Di Pierro
Do you use a custom form? Not sure. Can you email the generate html?

On Friday, 31 August 2012 15:05:12 UTC-5, Jim S wrote:
>
> Prior to upgrading to 2.0.x yesterday I was running 2.00.0 dated 
> 5/17/2012.  Up to then the placement of the elements in div 
> class="web2py_console" were ordered this way:
>
> searchForm
> buttonList
> counter
>
> Now, at 2.0.x they are:
>
> buttonList
> searchWidget
> counter
>
> I preferred the earlier sequence because I could then put the buttonl list 
> and row counter on the same row on my page.
>
> Now that they are separated by the searchWidget each I can't get them to 
> appear on the same row, thereby wasting real estate on my page.
>
> Was this done intentionally?  If not, could the order be set back to the 
> way it used to be?
>
> Attached are screenshots of the before and after for my app.
>
> Or, am I just too dense to realize how to handle this with css or jquery?
>
> -Jim
>
>

-- 





[web2py] Re: Too many values to unpack -- regression?

2012-08-31 Thread Brad Miller
Here is the value that printed:

2012-07-05 02:36:50

This field is declared in the model as:Field('timestamp','datetime'),

The old parse_datetime function seems to skip over the date part before it 
does the split on the -

Here's the old one:

def parse_datetime(self, value, field_type):
if not isinstance(value, datetime.datetime):
(y, m, d) = map(int,str(value)[:10].strip().split('-'))
time_items = map(int,str(value)[11:19].strip().split(':')[:3])
if len(time_items) == 3:
(h, mi, s) = time_items
else:
(h, mi, s) = time_items + [0]
value = datetime.datetime(y, m, d, h, mi, s)
return value

Brad

On Friday, August 31, 2012 3:33:22 PM UTC-5, Massimo Di Pierro wrote:
>
> This is the code that causes the problem to you:
>
> def parse_datetime(self, value, field_type):
> if not isinstance(value, datetime.datetime):
> 
> elif '-' in value:
> value,tz = value.split('-')
>
> This function is called when parsing data retrieved from database. The 
> reason it is failing is that data is corrupted (contains more than one dash 
> and that is not allowed by ISO standard). What database (my guess is 
> sqlite, which allows you to change a string field into a datetime while 
> leaving data in there). Can you add a print statement and see what the data 
> looks like:
>
> def parse_datetime(self, value, field_type):
> if not isinstance(value, datetime.datetime):
> print value
> 
>
> Let me know it may help understand how the data got in there.
>
> On Friday, 31 August 2012 14:53:16 UTC-5, Brad Miller wrote:
>>
>> I just upgraded my app to the latest 2.0.3 (stable)  and while checking 
>> some of my pages got the following error:
>>
>> Traceback (most recent call last):
>>   File "/Users/bmiller/Beta/web2py/gluon/restricted.py", line 209, in 
>> restricted
>> exec ccode in environment
>>   File 
>> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
>> line 160, in 
>>   File "/Users/bmiller/Beta/web2py/gluon/globals.py", line 185, in 
>> 
>> self._caller = lambda f: f()
>>   File "/Users/bmiller/Beta/web2py/gluon/tools.py", line 2780, in f
>> return action(*a, **b)
>>   File 
>> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
>> line 116, in studentactivity
>> db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 8692, in select
>> return adapter.select(self.query,fields,attributes)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 2029, in select
>> return super(SQLiteAdapter, self).select(query, fields, attributes)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1529, in select
>> return self._select_aux(sql,fields,attributes)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1510, in 
>> _select_aux
>> return processor(rows,fields,self._colnames,cacheable=cacheable)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1886, in parse
>> fields[j].type,blob_decode)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1718, in 
>> parse_value
>> return self.parsemap[key](value,field_type)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1753, in 
>> parse_datetime
>> value,tz = value.split('-')
>> ValueError: too many values to unpack
>>
>> This is the result of this this query code, which continues to work under 
>> 1.99.7
>>
>> count = db.useinfo.id.count()
>> last = db.useinfo.timestamp.max()
>> res = db(db.useinfo.course_id==course.course_id).select(
>> db.useinfo.sid, count, last, groupby=db.useinfo.sid, 
>> orderby=count)
>>
>> I'm assuming this is some kind of regression since the same code is 
>> working in 1.99.7, but maybe I'm doing something that I could do  but no 
>> longer should??
>>
>> Brad
>>
>>

-- 





Re: [web2py] Re: Lazy_tables with virtual fields

2012-08-31 Thread paolo.vall...@gmail.com
Hi Massimo,
I made a simple app, accordingly this example the error seems related
to the cache, because without the cache all works fine.

The model:
db.define_table('reviews_like_s',
 Field('review_id', 'reference reviews'),
 Field('helpful', 'boolean'))

db.define_table('reviews_s',
Field('title'))
db.reviews_s.pos = Field.Lazy(lambda row:
db((db.reviews_like_s.review_id == row.reviews_s.id) &
(db.reviews_like_s.helpful == True)).count() )
db.reviews_s.neg = Field.Lazy(lambda row:
db((db.reviews_like_s.review_id == row.reviews_s.id) &
(db.reviews_like_s.helpful == False)).count() )


Function:
def test():
id = db.reviews_s.insert(title='xxx')
db.reviews_like_s.insert(review_id=id, helpful=True)
rows = db(db.reviews_s.id > 0).select( cache=(cache.ram,3600) )
return dict(reviews=rows)

The view:
{{for review in reviews:}}
{{=review.pos()}}
{{pass}}

On my side the first time works well, the second rises the error.

Best,
Paolo


2012/8/30 paolo.vall...@gmail.com :
> Hi Massimo,
> no, I do not have multiple models, I have defined the string
> connection only once in db.py, that's all.
> I have a few try...except but in other places, I do not thing they are
> connected.
> I will try to make a simple app ables to reproduce the problem as soon
> as possible.
>
> Paolo
>
> 2012/8/30 Massimo Di Pierro :
>> Can you make a simple app to reproduce this?
>>
>> Do you have try  except anywhere? Do you have multiple models wich
>> define the same db = DAL(...) connection?
>>
>>
>> On Thursday, 30 August 2012 15:49:01 UTC-5, Paolo wrote:
>>>
>>> Hi Bruno, a simple db with sqlite without modules
>>>
>>> db = DAL('sqlite://storage.sqlite', lazy_tables=True )
>>>
>>> sorry, but I've just discovered that the same problem is happened even
>>> with lazy_tables=False
>>> Paolo
>>>
>>> 2012/8/30 Bruno Rocha :
>>> > How are you defining the db connection? are you using models or modules?
>>> > which db?
>>> >
>>> > --
>>> >
>>> >
>>> >
>>>
>>>
>>>
>>> --
>>>  Paolo
>>
>> --
>>
>>
>>
>
>
>
> --
>  Paolo



-- 
 Paolo

-- 





[web2py] Re: Too many values to unpack -- regression?

2012-08-31 Thread Brad Miller
Here's the select output by the query causing the problem.  It looks 
exactly how I would right it.  So it must be right.  :-)

It seems to me that this new parse_datetime is broken.  The data sure 
doesn't look corrupt, and I can see how the old logic would work just fine 
on the data I printed.

SELECT  useinfo.sid, COUNT(useinfo.id), MAX(useinfo.timestamp) FROM useinfo 
WHERE (useinfo.course_id = 'devcourse') GROUP BY useinfo.sid ORDER BY 
COUNT(useinfo.id);

On Friday, August 31, 2012 3:29:55 PM UTC-5, Niphlod wrote:
>
> seems more a problem with returned values than a different form of select 
> .
> can you please the output of res with the _select (mind the 
> underscore) with both versions ?
>
> count = db.useinfo.id.count()
> last = db.useinfo.timestamp.max()
> res = db(db.useinfo.course_id==course.course_id)._select(
> db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
>
>
>
> On Friday, August 31, 2012 9:53:16 PM UTC+2, Brad Miller wrote:
>>
>> I just upgraded my app to the latest 2.0.3 (stable)  and while checking 
>> some of my pages got the following error:
>>
>> Traceback (most recent call last):
>>   File "/Users/bmiller/Beta/web2py/gluon/restricted.py", line 209, in 
>> restricted
>> exec ccode in environment
>>   File 
>> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
>> line 160, in 
>>   File "/Users/bmiller/Beta/web2py/gluon/globals.py", line 185, in 
>> 
>> self._caller = lambda f: f()
>>   File "/Users/bmiller/Beta/web2py/gluon/tools.py", line 2780, in f
>> return action(*a, **b)
>>   File 
>> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
>> line 116, in studentactivity
>> db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 8692, in select
>> return adapter.select(self.query,fields,attributes)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 2029, in select
>> return super(SQLiteAdapter, self).select(query, fields, attributes)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1529, in select
>> return self._select_aux(sql,fields,attributes)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1510, in 
>> _select_aux
>> return processor(rows,fields,self._colnames,cacheable=cacheable)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1886, in parse
>> fields[j].type,blob_decode)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1718, in 
>> parse_value
>> return self.parsemap[key](value,field_type)
>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1753, in 
>> parse_datetime
>> value,tz = value.split('-')
>> ValueError: too many values to unpack
>>
>> This is the result of this this query code, which continues to work under 
>> 1.99.7
>>
>> count = db.useinfo.id.count()
>> last = db.useinfo.timestamp.max()
>> res = db(db.useinfo.course_id==course.course_id).select(
>> db.useinfo.sid, count, last, groupby=db.useinfo.sid, 
>> orderby=count)
>>
>> I'm assuming this is some kind of regression since the same code is 
>> working in 1.99.7, but maybe I'm doing something that I could do  but no 
>> longer should??
>>
>> Brad
>>
>>

-- 





Re: [web2py] Re: Lazy_tables with virtual fields

2012-08-31 Thread Massimo Di Pierro
What's the error? Works for me.

On Friday, 31 August 2012 16:00:24 UTC-5, Paolo wrote:
>
> Hi Massimo, 
> I made a simple app, accordingly this example the error seems related 
> to the cache, because without the cache all works fine. 
>
> The model: 
> db.define_table('reviews_like_s', 
>  Field('review_id', 'reference reviews'), 
>  Field('helpful', 'boolean')) 
>
> db.define_table('reviews_s', 
> Field('title')) 
> db.reviews_s.pos = Field.Lazy(lambda row: 
> db((db.reviews_like_s.review_id == row.reviews_s.id) & 
> (db.reviews_like_s.helpful == True)).count() ) 
> db.reviews_s.neg = Field.Lazy(lambda row: 
> db((db.reviews_like_s.review_id == row.reviews_s.id) & 
> (db.reviews_like_s.helpful == False)).count() ) 
>
>
> Function: 
> def test(): 
> id = db.reviews_s.insert(title='xxx') 
> db.reviews_like_s.insert(review_id=id, helpful=True) 
> rows = db(db.reviews_s.id > 0).select( cache=(cache.ram,3600) ) 
> return dict(reviews=rows) 
>
> The view: 
> {{for review in reviews:}} 
> {{=review.pos()}} 
> {{pass}} 
>
> On my side the first time works well, the second rises the error. 
>
> Best, 
> Paolo 
>
>
> 2012/8/30 paolo@gmail.com  
> >: 
>
> > Hi Massimo, 
> > no, I do not have multiple models, I have defined the string 
> > connection only once in db.py, that's all. 
> > I have a few try...except but in other places, I do not thing they are 
> > connected. 
> > I will try to make a simple app ables to reproduce the problem as soon 
> > as possible. 
> > 
> > Paolo 
> > 
> > 2012/8/30 Massimo Di Pierro >: 
> >> Can you make a simple app to reproduce this? 
> >> 
> >> Do you have try  except anywhere? Do you have multiple models wich 
> >> define the same db = DAL(...) connection? 
> >> 
> >> 
> >> On Thursday, 30 August 2012 15:49:01 UTC-5, Paolo wrote: 
> >>> 
> >>> Hi Bruno, a simple db with sqlite without modules 
> >>> 
> >>> db = DAL('sqlite://storage.sqlite', lazy_tables=True ) 
> >>> 
> >>> sorry, but I've just discovered that the same problem is happened even 
> >>> with lazy_tables=False 
> >>> Paolo 
> >>> 
> >>> 2012/8/30 Bruno Rocha : 
> >>> > How are you defining the db connection? are you using models or 
> modules? 
> >>> > which db? 
> >>> > 
> >>> > -- 
> >>> > 
> >>> > 
> >>> > 
> >>> 
> >>> 
> >>> 
> >>> -- 
> >>>  Paolo 
> >> 
> >> -- 
> >> 
> >> 
> >> 
> > 
> > 
> > 
> > -- 
> >  Paolo 
>
>
>
> -- 
>  Paolo 
>

-- 





[web2py] Re: Too many values to unpack -- regression?

2012-08-31 Thread Brad Miller
Just as a quick check, I replaced the new parse_datetime function with the 
old, and all is well.

Brad

On Friday, August 31, 2012 3:49:32 PM UTC-5, Brad Miller wrote:
>
> Here is the value that printed:
>
> 2012-07-05 02:36:50
>
> This field is declared in the model as:Field('timestamp','datetime'),
>
> The old parse_datetime function seems to skip over the date part before it 
> does the split on the -
>
> Here's the old one:
>
> def parse_datetime(self, value, field_type):
> if not isinstance(value, datetime.datetime):
> (y, m, d) = map(int,str(value)[:10].strip().split('-'))
> time_items = map(int,str(value)[11:19].strip().split(':')[:3])
> if len(time_items) == 3:
> (h, mi, s) = time_items
> else:
> (h, mi, s) = time_items + [0]
> value = datetime.datetime(y, m, d, h, mi, s)
> return value
>
> Brad
>
> On Friday, August 31, 2012 3:33:22 PM UTC-5, Massimo Di Pierro wrote:
>>
>> This is the code that causes the problem to you:
>>
>> def parse_datetime(self, value, field_type):
>> if not isinstance(value, datetime.datetime):
>> 
>> elif '-' in value:
>> value,tz = value.split('-')
>>
>> This function is called when parsing data retrieved from database. The 
>> reason it is failing is that data is corrupted (contains more than one dash 
>> and that is not allowed by ISO standard). What database (my guess is 
>> sqlite, which allows you to change a string field into a datetime while 
>> leaving data in there). Can you add a print statement and see what the data 
>> looks like:
>>
>> def parse_datetime(self, value, field_type):
>> if not isinstance(value, datetime.datetime):
>> print value
>> 
>>
>> Let me know it may help understand how the data got in there.
>>
>> On Friday, 31 August 2012 14:53:16 UTC-5, Brad Miller wrote:
>>>
>>> I just upgraded my app to the latest 2.0.3 (stable)  and while checking 
>>> some of my pages got the following error:
>>>
>>> Traceback (most recent call last):
>>>   File "/Users/bmiller/Beta/web2py/gluon/restricted.py", line 209, in 
>>> restricted
>>> exec ccode in environment
>>>   File 
>>> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
>>> line 160, in 
>>>   File "/Users/bmiller/Beta/web2py/gluon/globals.py", line 185, in 
>>> 
>>> self._caller = lambda f: f()
>>>   File "/Users/bmiller/Beta/web2py/gluon/tools.py", line 2780, in f
>>> return action(*a, **b)
>>>   File 
>>> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
>>> line 116, in studentactivity
>>> db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 8692, in select
>>> return adapter.select(self.query,fields,attributes)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 2029, in select
>>> return super(SQLiteAdapter, self).select(query, fields, attributes)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1529, in select
>>> return self._select_aux(sql,fields,attributes)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1510, in 
>>> _select_aux
>>> return processor(rows,fields,self._colnames,cacheable=cacheable)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1886, in parse
>>> fields[j].type,blob_decode)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1718, in 
>>> parse_value
>>> return self.parsemap[key](value,field_type)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1753, in 
>>> parse_datetime
>>> value,tz = value.split('-')
>>> ValueError: too many values to unpack
>>>
>>> This is the result of this this query code, which continues to work 
>>> under 1.99.7
>>>
>>> count = db.useinfo.id.count()
>>> last = db.useinfo.timestamp.max()
>>> res = db(db.useinfo.course_id==course.course_id).select(
>>> db.useinfo.sid, count, last, groupby=db.useinfo.sid, 
>>> orderby=count)
>>>
>>> I'm assuming this is some kind of regression since the same code is 
>>> working in 1.99.7, but maybe I'm doing something that I could do  but no 
>>> longer should??
>>>
>>> Brad
>>>
>>>

-- 





[web2py] newbie question - recursively finding children

2012-08-31 Thread web-dev-m
Hey everyone!

Wow Web2py 2.0 looks so cool! I can't wait to try all the new features.  
This has made it so easy for me (a non-programmer) to make viable web 
applications!

My question is as follows:  
For one of my views, each page in my application has a variable number of 
"child pages", each of which can have a variable number of "child pages", 
and so on.  I want each child page to have its own div like so:

 < the big container div
 < variable number of divs here
 < variable number of child div's here 
each with their own text



How do I write the controllers, so that it recurses as deep as the deepest 
node and generates those divs??

My design is as follows:

Two tables:
table1
-id (auto generated)
-field for text

table2
-id(autogenerated)
-parent_id(created from form)
-childid(created from form)

I know that I have to write a function that returns a div for each, but I 
just wasnt sure how to do it.

Please help!

Thanks!

-- 





[web2py] Querying on 1:M Relationships in SQLFORM.grid and SQLFORM.smartgrid

2012-08-31 Thread Mike Leone
Hello,

We're building a web2py application that leverages SQLFORM.smartgrid 
heavily.  Out of the box, this does not support filtering on 1:M 
relationships, or reference fields on the model. We understand the concerns 
about this: It could potentially be a huge performance hit, especially if 
the related table has a large number of rows.

On the other hand, this functionality is very valuable. Being able to 
filter on related tables is a very common need in applications.  Often, 
users need to filter on "lookup" tables that have a relatively small number 
of rows, and the performance hit is negligible. This is a very common 
feature in Django, and in Rails admin interfaces like ActiveScaffold and 
RailsAdmin.

Example:

Given a model like this:

db.define_table('book',
Field('user_id', 'reference auth_user'),
Field('title'),
Field('genre'))

And a controller like this:

def index():
grid = SQLFORM.smartgrid(db.book)
return dict(grid=grid)

The query interface will look like this by default:
http://i49.tinypic.com/2ugjt02.jpg

Note how this includes title and genre, but not the auth_user reference.

We patched web2py to allow to for 1:M reference fields in the query 
interface. The resulting interface and generated query look something like 
this:

http://i46.tinypic.com/28taq74.png

Here is our simple patch to allow searching on reference fields like this:

https://gist.github.com/ff543a5c6d3bc14b9079

This is obviously NOT ready for production; it's a simple proof of concept. 
 Note the potentially very expensive "ALL" query. Because of the 
performance risks, something like this only makes sense if developers can 
opt in, i.e. explicitly say so if they want to include a given reference 
field in the query interface.

1. Would the web2py maintiners be interested in a feature like this if it 
is opt-in?  I'm willing to devote some time to submit a more robust patch 
if I could get some guidance.

2. I also have a simple implementation for querying on list:reference 
fields that I can share as well.

Finally, I just want to thank the web2py team. I've really enjoyed using 
the framework and hope to help out as much as I can.

Thanks,
Mike Leone
Principal, Engineering
Panoptic Development, Inc.

-- 





[web2py] How to modify Welcome application so that users with "do not want to be tracked" can still register?

2012-08-31 Thread nc


Hi,

I'm new to web development and just started trying out web2py (v.2.0.3). I 
found that the user registration in the Welcome application was not working 
for me: after filling in the form and clicking the Register button, the 
fields in the form would just all get emptied and there would be no other 
feedback. After trying different browsers and browser options, it seems 
this happens when using FireFox (v.14.01) with browser option "Tell 
websites I do not want to be tracked" checked on. How would one modify the 
Welcome application so that a visitor that has that browser option set can 
still register?

Thanks,

NC

-- 





[web2py] Too many Values to Unpack -- regression?

2012-08-31 Thread Brad Miller
I just downloaded the latest 2.0.3 (stable) and upgraded my copy of web2py. 
 When checking some of my pages I got this error, which I have reconfirmed 
works just fine on the 1.99.7 version.

Traceback (most recent call last):
  File "/Users/bmiller/Beta/web2py/gluon/restricted.py", line 209, in restricted
exec ccode in environment
  File "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py" 
, line 
160, in 
  File "/Users/bmiller/Beta/web2py/gluon/globals.py", line 185, in 
self._caller = lambda f: f()
  File "/Users/bmiller/Beta/web2py/gluon/tools.py", line 2780, in f
return action(*a, **b)
  File "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py" 
, line 
116, in studentactivity
db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 8692, in select
return adapter.select(self.query,fields,attributes)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 2029, in select
return super(SQLiteAdapter, self).select(query, fields, attributes)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1529, in select
return self._select_aux(sql,fields,attributes)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1510, in _select_aux
return processor(rows,fields,self._colnames,cacheable=cacheable)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1886, in parse
fields[j].type,blob_decode)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1718, in parse_value
return self.parsemap[key](value,field_type)
  File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1753, in parse_datetime
value,tz = value.split('-')
ValueError: too many values to unpack


This is the result of the following code/query.

count = db.useinfo.id.count()
last = db.useinfo.timestamp.max()
res = db(db.useinfo.course_id==course.course_id).select(
db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)


I'm assuming this must be some kind of regression, unless I'm doing 
something that I shouldn't do anymore.

Thanks,

Brad

-- 





[web2py] Re: Querying on 1:M Relationships in SQLFORM.grid and SQLFORM.smartgrid

2012-08-31 Thread Massimo Di Pierro
Hello Mike,

thanks for your patch? Would you please attach it to a google code issue so 
we do not forget. We cannot add new feaures until all 2.0.x issues have 
been resolved.

On Friday, August 31, 2012 2:41:30 PM UTC-5, Mike Leone wrote:
>
> Hello,
>
> We're building a web2py application that leverages SQLFORM.smartgrid 
> heavily.  Out of the box, this does not support filtering on 1:M 
> relationships, or reference fields on the model. We understand the concerns 
> about this: It could potentially be a huge performance hit, especially if 
> the related table has a large number of rows.
>
> On the other hand, this functionality is very valuable. Being able to 
> filter on related tables is a very common need in applications.  Often, 
> users need to filter on "lookup" tables that have a relatively small number 
> of rows, and the performance hit is negligible. This is a very common 
> feature in Django, and in Rails admin interfaces like ActiveScaffold and 
> RailsAdmin.
>
> Example:
>
> Given a model like this:
>
> db.define_table('book',
> Field('user_id', 'reference auth_user'),
> Field('title'),
> Field('genre'))
>
> And a controller like this:
>
> def index():
> grid = SQLFORM.smartgrid(db.book)
> return dict(grid=grid)
>
> The query interface will look like this by default:
> http://i49.tinypic.com/2ugjt02.jpg
>
> Note how this includes title and genre, but not the auth_user reference.
>
> We patched web2py to allow to for 1:M reference fields in the query 
> interface. The resulting interface and generated query look something like 
> this:
>
> http://i46.tinypic.com/28taq74.png
>
> Here is our simple patch to allow searching on reference fields like this:
>
> https://gist.github.com/ff543a5c6d3bc14b9079
>
> This is obviously NOT ready for production; it's a simple proof of 
> concept.  Note the potentially very expensive "ALL" query. Because of the 
> performance risks, something like this only makes sense if developers can 
> opt in, i.e. explicitly say so if they want to include a given reference 
> field in the query interface.
>
> 1. Would the web2py maintiners be interested in a feature like this if it 
> is opt-in?  I'm willing to devote some time to submit a more robust patch 
> if I could get some guidance.
>
> 2. I also have a simple implementation for querying on list:reference 
> fields that I can share as well.
>
> Finally, I just want to thank the web2py team. I've really enjoyed using 
> the framework and hope to help out as much as I can.
>
> Thanks,
> Mike Leone
> Principal, Engineering
> Panoptic Development, Inc.
>

-- 





[web2py] Re: Too many values to unpack -- regression?

2012-08-31 Thread Massimo Di Pierro
You are right. It is now fixed in 2.0.5 posted.

On Friday, 31 August 2012 16:01:52 UTC-5, Brad Miller wrote:
>
> Here's the select output by the query causing the problem.  It looks 
> exactly how I would right it.  So it must be right.  :-)
>
> It seems to me that this new parse_datetime is broken.  The data sure 
> doesn't look corrupt, and I can see how the old logic would work just fine 
> on the data I printed.
>
> SELECT  useinfo.sid, COUNT(useinfo.id), MAX(useinfo.timestamp) FROM 
> useinfo WHERE (useinfo.course_id = 'devcourse') GROUP BY useinfo.sid ORDER 
> BY COUNT(useinfo.id);
>
> On Friday, August 31, 2012 3:29:55 PM UTC-5, Niphlod wrote:
>>
>> seems more a problem with returned values than a different form of select 
>> .
>> can you please the output of res with the _select (mind the 
>> underscore) with both versions ?
>>
>> count = db.useinfo.id.count()
>> last = db.useinfo.timestamp.max()
>> res = db(db.useinfo.course_id==course.course_id)._select(
>> db.useinfo.sid, count, last, groupby=db.useinfo.sid, 
>> orderby=count)
>>
>>
>>
>> On Friday, August 31, 2012 9:53:16 PM UTC+2, Brad Miller wrote:
>>>
>>> I just upgraded my app to the latest 2.0.3 (stable)  and while checking 
>>> some of my pages got the following error:
>>>
>>> Traceback (most recent call last):
>>>   File "/Users/bmiller/Beta/web2py/gluon/restricted.py", line 209, in 
>>> restricted
>>> exec ccode in environment
>>>   File 
>>> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
>>> line 160, in 
>>>   File "/Users/bmiller/Beta/web2py/gluon/globals.py", line 185, in 
>>> 
>>> self._caller = lambda f: f()
>>>   File "/Users/bmiller/Beta/web2py/gluon/tools.py", line 2780, in f
>>> return action(*a, **b)
>>>   File 
>>> "/Users/bmiller/Beta/web2py/applications/runestone/controllers/admin.py", 
>>> line 116, in studentactivity
>>> db.useinfo.sid, count, last, groupby=db.useinfo.sid, orderby=count)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 8692, in select
>>> return adapter.select(self.query,fields,attributes)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 2029, in select
>>> return super(SQLiteAdapter, self).select(query, fields, attributes)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1529, in select
>>> return self._select_aux(sql,fields,attributes)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1510, in 
>>> _select_aux
>>> return processor(rows,fields,self._colnames,cacheable=cacheable)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1886, in parse
>>> fields[j].type,blob_decode)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1718, in 
>>> parse_value
>>> return self.parsemap[key](value,field_type)
>>>   File "/Users/bmiller/Beta/web2py/gluon/dal.py", line 1753, in 
>>> parse_datetime
>>> value,tz = value.split('-')
>>> ValueError: too many values to unpack
>>>
>>> This is the result of this this query code, which continues to work 
>>> under 1.99.7
>>>
>>> count = db.useinfo.id.count()
>>> last = db.useinfo.timestamp.max()
>>> res = db(db.useinfo.course_id==course.course_id).select(
>>> db.useinfo.sid, count, last, groupby=db.useinfo.sid, 
>>> orderby=count)
>>>
>>> I'm assuming this is some kind of regression since the same code is 
>>> working in 1.99.7, but maybe I'm doing something that I could do  but no 
>>> longer should??
>>>
>>> Brad
>>>
>>>

-- 





[web2py] Re: "Tweet this" and web2py forms. How do I design this?

2012-08-31 Thread Pystar
question still not answered


On Thursday, August 30, 2012 8:17:23 PM UTC+1, Pystar wrote:
>
> I have a form that includes a "tweet this" select box option. I would like 
> to tweet the contents of the textarea which is the only form field and at 
> the same time submit the form to a database. I am at a loss on how to 
> develop this. Is it possible with web2py. Considering the fact that I am 
> only using the inbuilt auth for user authentication.

-- 





[web2py] Re: How to modify Welcome application so that users with "do not want to be tracked" can still register?

2012-08-31 Thread Massimo Di Pierro
Do not track means: "do not remember me"
Login means: "please remember me"

they are both manages through cookies. Cookies without expiration should be 
treated by the browser as session cookies and do not ignore them even if 
you do not want to be tracked. Web2py does not set an expiration for 
session cookies therefore they should not ignored by firefox. I am not sure 
what is wrong. Have you setup the option "allow session cookies"? can you 
login in other web sites?

massimo

On Friday, August 31, 2012 4:15:54 PM UTC-5, nc wrote:
>
> Hi,
>
> I'm new to web development and just started trying out web2py (v.2.0.3). I 
> found that the user registration in the Welcome application was not working 
> for me: after filling in the form and clicking the Register button, the 
> fields in the form would just all get emptied and there would be no other 
> feedback. After trying different browsers and browser options, it seems 
> this happens when using FireFox (v.14.01) with browser option "Tell 
> websites I do not want to be tracked" checked on. How would one modify the 
> Welcome application so that a visitor that has that browser option set can 
> still register?
>
> Thanks,
>
> NC
>

-- 





Re: [web2py] "Tweet this" and web2py forms. How do I design this?

2012-08-31 Thread Massimo Di Pierro
web2py has an Oauth 1 and Oauth 2 consumer, not a provider. It includes a 
CAS provider. not sure if this answers your question.


On Thursday, 30 August 2012 15:42:56 UTC-5, Pystar wrote:
>
> But I am only using web2py inbuilt Auth. Can I use Auth and still allow 
> users grant permission to my app using OAuth? And does the twitter API cap 
> limit of 100k users count if I do?
>
>
> On Thursday, August 30, 2012 9:36:39 PM UTC+1, rochacbruno wrote:
>>
>> It is only possible if you have implemented OAuth and user gave access 
>> permission for your application. 
>
>

-- 





[web2py] web2py 2.0.5 is out

2012-08-31 Thread Massimo Di Pierro
web2py 2.0.5 is out.
All known backward compatibility issues should be fixed but continue 
testing... thank you for your patience.

massimo

On Wednesday, 29 August 2012 22:41:34 UTC-5, Massimo Di Pierro wrote:
>
> After 5 months. It is done. This is the most waited and the most 
> feature-packed release.
>
> I am sure we'll find some corners that need to be ironed but it is 
> considerably better than 1.99.7. It adds lot of new features and improves 
> many existing ones:
>
> - 57,000 new lines of code and closed 279 issues since 1.99.7.
> - Retrieving data from DB should be faster, in particular 
> select(cacheable=True)
> - Has a new scheduler, a built-in wiki, new language and pluralization 
> system, better markmin with oembed support and better scaffolding app, 
> increased security.
> - Lots of experimental features including GIS support, mongodb support, 
> built-in auth.wiki(), and more.
>
> Should be 100% backward compatible. If you run into any issue let us know 
> ASAP.
>
> I personally want to thank the major contributors to this release (in 
> alphabetic order)
> Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic, Iceberg, Jonathan, 
> Marc, Mariano, Marin, Martin, Mark, Michael, Michele, Niphlod, Patrick, 
> Vladyslav, 
> They spend many nights testing, coding, debugging at a very fast pace.
>
> Many many people have contributed.
>
> If your contribution has not been properly acknowledged please let us know 
> ASAP. It is probably an oversight.
>
>
> Massimo
>
>
> Detailed changelog
> ===
>
> ## 2.00.2
>
> ### DAL Improvements
>
> - Support for DAL(lazy_tables=True) and db.define_table(on_define=lambda 
> table:), thanks Jonathan
> - db(...).select(cacheable=True) make select 30% faster
> - db(...).select(cache=(cache.ram,3600)) now caches parsed data 100x faster
> - db(...).count(cache=(cache.ram,3600)) now supported
> - MongoDB support in DAL (experimental), thanks Mark Breedveld
> - geodal and spatialite, thanks Denes and Fran (experimental)
> - db.mytable._before_insert, _after_insert, _before_update, _after_update, 
> _before_delete. _after_delete (list of callbacks)
> - db(...).update_naive(...) same as update but ignores 
> table._before_update and table._after_update
> - DAL BIGINT support and DAL(...,bigint_id=True)
> - IS_IN_DB(..., distinct=True)
> - new syntax: db.mytable.insert(myuploadfield=open()), thank you 
> Iceberg
> - db(...).select(db.mytable.myfield.count(distinct=True))
> - db(db.a)._update(name=db(db.b.a==db.a.id).nested_select(db.b.id))
> - db.mytable.myfield.filter_in, filter_out
> - db.mytable._enable_record_versioning(db) adds versioning to this table
> - teradata adapter, thanks Andrew Willimott
> - experimental Sybase Adapter
> - added db.table.field.avg()
> - Support for Google App Engine projections, thanks Christian
> - Field(... 'upload', default=path) now accepts a path to a local file as 
> default value, if user does not upload a file. Relative path looks inside 
> current application folder, thanks Marin
> - executesql(...,fields=,columns=) allows parsing of results in Rows, 
> thanks Anthony
>
> ### Auth improvements
>
> - auth.enable_record_versioning(db)  adds full versioning to all tables
> - @auth.requires_login(otherwise=URL(...))
> - auth supports salt and compatible with third party data, thanks Dave 
> Stoll
> - CRYPT now defaults to pbkdf2(1000,20,sha1)
> - Built-in wiki with menu, tags, search, media, permissions. def index: 
> return auth.wiki()
> - auth.settings.everybody_group_id
> - allow storage of uploads on any PyFileSystem (including amazon)
>
> ### Form improvements
>
> - FORM.confirm('Are you sure?',{'Back':URL(...)})
> - SQLFORM.smartdictform(dict)
> - form.add_button(value,link)
> - SQLFORM.grid(groupby='...')
> - fixed security issue with SQLFORM.grid and SQLFORM.smartgrid
> - more export options in SQLFORM.grid and SQLFORM.smartgrid (html, xml, 
> csv, ...)
>
> ### Admin improvements
>
> - new admin pages: manage_students, bulk_regsiter, and progress reports
> - increased security in admin against CSRF
> - experimental Git integration
> - experimental OpenShift deployment
> - multi-language pluralization engine 
> - ace text web editor in admin
> - Ukrainian translations, thanks Vladyslav Kozlovskyy
> - Romanian translation for welcome, thanks ionel
> - support for mercurial 2.6, thanks Vlad
>
> ### Scheduler Improvements (thanks to niphlod, ykessler, dhx, toomim)
>
> - web2py.py -K myapp -X starts the myapp scheduler alongside the webserver
> - tasks are marked EXPIRED (if stop_time passed)
> - functions with no result don't end up in scheduler_run
> - more options: web2py.py -E -b -L
> - scheduler can now handle 10k tasks with 20 concurrent workers and with 
> no issues
> - new params:
> tasks can be found in the environment (no need to define the tasks 
> parameter)
> max_empty_runs kills the workers automatically if no new tasks are 
> found in queue (nice for "spikes" of processing power)
> di

[web2py] help with apache

2012-08-31 Thread Massimo Di Pierro
My web server started exhibiting a strange behavior:

$ /etc/init.d/apache stop
[ok]
$ /etc/init.d/apache start
 * Starting web server apache2 
 
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAIL]
$ netstat -tulpn| grep :80
(No info could be read for "-p": geteuid()=1000 but you should be root.)
tcp6   0  0 :::80   :::*LISTEN 

The only way to restart it is by rebooting. Any idea what may cause this? I 
have not seen before and did not change the server config in a while.



-- 





[web2py] Real time web app game

2012-08-31 Thread Oscar Hou
Hello, I am trying to build a web based game that requires real time 
interactions. What I currently have in mind is to have a UI and game 
interface in a web2py application. The application will make rest calls to 
a Node.js server ( that may be hosted on the same machine) to communicate 
and interact with other players. The web2py application will have some 
actionscript for the client facing graphics. 

Is this a feasible design? Should I scrap the node.js server and just host 
everything using the web2py application? 

Thank you,
Oscar

-- 





Re: [web2py] help with apache

2012-08-31 Thread Bruno Rocha
There is something here: http://ubuntuforums.org/showthread.php?t=1636667

On Fri, Aug 31, 2012 at 7:02 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Address already in use: make_sock: could not bind to address [::]:80

-- 





Re: [web2py] help with apache

2012-08-31 Thread Massimo Di Pierro
That helps. Somehow my screen was not large enough and I did not see the 
PID.

mdipierro@www:~$ sudo /etc/init.d/apache2 stop
[sudo] password for mdipierro: 
 * Stopping web server apache2 
 [ OK ] 
mdipierro@www:~$ sudo /etc/init.d/apache2 start
 * Starting web server apache2 

(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

[fail]
mdipierro@www:~$ sudo netstat -ltnp | grep ':80'
tcp6   0  0 :::80   :::*LISTEN 
 3874/uuidd  
mdipierro@www:~$ sudo kill -9 3874
mdipierro@www:~$ sudo /etc/init.d/apache2 start
 * Starting web server apache2 
 [ OK ]

yet I do not understand what this uuidd keep the port locked.

This is the only thing I found on the subject:

https://groups.google.com/group/ec2ubuntu/browse_thread/thread/74af88ecd4e57b3a

and no answer.



On Friday, 31 August 2012 17:15:49 UTC-5, rochacbruno wrote:
>
> There is something here: http://ubuntuforums.org/showthread.php?t=1636667
>
> On Fri, Aug 31, 2012 at 7:02 PM, Massimo Di Pierro 
> 
> > wrote:
>
>> Address already in use: make_sock: could not bind to address [::]:80
>
>
>
>

-- 





[web2py] Re: How to modify Welcome application so that users with "do not want to be tracked" can still register?

2012-08-31 Thread Anthony
If you include the "remember me for 30 days" option on the login form, I 
think it does set a cookie expiration, right? Maybe that's the problem. Of 
course, someone who doesn't want to be remembered probably shouldn't check 
the "remember me" option.

Anthony

On Friday, August 31, 2012 5:54:58 PM UTC-4, Massimo Di Pierro wrote:
>
> Do not track means: "do not remember me"
> Login means: "please remember me"
>
> they are both manages through cookies. Cookies without expiration should 
> be treated by the browser as session cookies and do not ignore them even if 
> you do not want to be tracked. Web2py does not set an expiration for 
> session cookies therefore they should not ignored by firefox. I am not sure 
> what is wrong. Have you setup the option "allow session cookies"? can you 
> login in other web sites?
>
> massimo
>
> On Friday, August 31, 2012 4:15:54 PM UTC-5, nc wrote:
>>
>> Hi,
>>
>> I'm new to web development and just started trying out web2py (v.2.0.3). 
>> I found that the user registration in the Welcome application was not 
>> working for me: after filling in the form and clicking the Register button, 
>> the fields in the form would just all get emptied and there would be no 
>> other feedback. After trying different browsers and browser options, it 
>> seems this happens when using FireFox (v.14.01) with browser option "Tell 
>> websites I do not want to be tracked" checked on. How would one modify the 
>> Welcome application so that a visitor that has that browser option set can 
>> still register?
>>
>> Thanks,
>>
>> NC
>>
>

-- 





[web2py] Re: How to modify Welcome application so that users with "do not want to be tracked" can still register?

2012-08-31 Thread Anthony
If the remember me option is the issue, maybe you could add a Javascript 
popup that warns the user that cookies must be enabled.

Anthony

On Friday, August 31, 2012 7:50:34 PM UTC-4, Anthony wrote:
>
> If you include the "remember me for 30 days" option on the login form, I 
> think it does set a cookie expiration, right? Maybe that's the problem. Of 
> course, someone who doesn't want to be remembered probably shouldn't check 
> the "remember me" option.
>
> Anthony
>
> On Friday, August 31, 2012 5:54:58 PM UTC-4, Massimo Di Pierro wrote:
>>
>> Do not track means: "do not remember me"
>> Login means: "please remember me"
>>
>> they are both manages through cookies. Cookies without expiration should 
>> be treated by the browser as session cookies and do not ignore them even if 
>> you do not want to be tracked. Web2py does not set an expiration for 
>> session cookies therefore they should not ignored by firefox. I am not sure 
>> what is wrong. Have you setup the option "allow session cookies"? can you 
>> login in other web sites?
>>
>> massimo
>>
>> On Friday, August 31, 2012 4:15:54 PM UTC-5, nc wrote:
>>>
>>> Hi,
>>>
>>> I'm new to web development and just started trying out web2py (v.2.0.3). 
>>> I found that the user registration in the Welcome application was not 
>>> working for me: after filling in the form and clicking the Register button, 
>>> the fields in the form would just all get emptied and there would be no 
>>> other feedback. After trying different browsers and browser options, it 
>>> seems this happens when using FireFox (v.14.01) with browser option "Tell 
>>> websites I do not want to be tracked" checked on. How would one modify the 
>>> Welcome application so that a visitor that has that browser option set can 
>>> still register?
>>>
>>> Thanks,
>>>
>>> NC
>>>
>>

-- 





Re: [web2py] 'Auth' object has no attribute 'use_username'

2012-08-31 Thread Anthony
On Friday, August 31, 2012 3:11:20 PM UTC-4, Massimo Di Pierro wrote:
>
> what is the point of  auth = Auth(db) in your code without having an 
> auth_user table? I must be missing something about what you are trying to 
> do.


First, just to have the auth navbar appear on every page, it shouldn't be 
necessary to have any table definitions -- the navbar is constructed on 
every request, but many requests will be for non-protected pages on the 
public part of the website where auth isn't needed at all. Second, even for 
requests that require login, the database generally isn't needed -- logged 
in status is assessed by checking for the auth object in the session. The 
database should only be needed for login, registration, checking 
permissions, etc., but not simply for checking logged in status. So, on 
most requests, you might save some cycles by skipping the table definitions 
(admittedly, this is less of a savings with lazy tables, but still 
something).

Anthony

-- 





Re: [web2py] help with apache

2012-08-31 Thread Cliff Kachinske
Maybe you have an orphan process?

http://www.geekride.com/orphan-zombie-process/

On Friday, August 31, 2012 7:10:25 PM UTC-4, Massimo Di Pierro wrote:
>
> That helps. Somehow my screen was not large enough and I did not see the 
> PID.
>
> mdipierro@www:~$ sudo /etc/init.d/apache2 stop
> [sudo] password for mdipierro: 
>  * Stopping web server apache2 
>  [ OK ] 
> mdipierro@www:~$ sudo /etc/init.d/apache2 start
>  * Starting web server apache2 
> 
> (98)Address already in use: make_sock: could not bind to address [::]:80
> (98)Address already in use: make_sock: could not bind to address 
> 0.0.0.0:80
> no listening sockets available, shutting down
> Unable to open logs
>   
>   [fail]
> mdipierro@www:~$ sudo netstat -ltnp | grep ':80'
> tcp6   0  0 :::80   :::*LISTEN 
>  3874/uuidd  
> mdipierro@www:~$ sudo kill -9 3874
> mdipierro@www:~$ sudo /etc/init.d/apache2 start
>  * Starting web server apache2 
>  [ OK ]
>
> yet I do not understand what this uuidd keep the port locked.
>
> This is the only thing I found on the subject:
>
>
> https://groups.google.com/group/ec2ubuntu/browse_thread/thread/74af88ecd4e57b3a
>
> and no answer.
>
>
>
> On Friday, 31 August 2012 17:15:49 UTC-5, rochacbruno wrote:
>>
>> There is something here: http://ubuntuforums.org/showthread.php?t=1636667
>>
>> On Fri, Aug 31, 2012 at 7:02 PM, Massimo Di Pierro > > wrote:
>>
>>> Address already in use: make_sock: could not bind to address [::]:80
>>
>>
>>
>>

-- 





[web2py] Re: How to modify Welcome application so that users with "do not want to be tracked" can still register?

2012-08-31 Thread Massimo Di Pierro
You are right. if auth.remember is set the cookie will have an expiration. 
that must be the problem.

On Friday, 31 August 2012 18:50:34 UTC-5, Anthony wrote:
>
> If you include the "remember me for 30 days" option on the login form, I 
> think it does set a cookie expiration, right? Maybe that's the problem. Of 
> course, someone who doesn't want to be remembered probably shouldn't check 
> the "remember me" option.
>
> Anthony
>
> On Friday, August 31, 2012 5:54:58 PM UTC-4, Massimo Di Pierro wrote:
>>
>> Do not track means: "do not remember me"
>> Login means: "please remember me"
>>
>> they are both manages through cookies. Cookies without expiration should 
>> be treated by the browser as session cookies and do not ignore them even if 
>> you do not want to be tracked. Web2py does not set an expiration for 
>> session cookies therefore they should not ignored by firefox. I am not sure 
>> what is wrong. Have you setup the option "allow session cookies"? can you 
>> login in other web sites?
>>
>> massimo
>>
>> On Friday, August 31, 2012 4:15:54 PM UTC-5, nc wrote:
>>>
>>> Hi,
>>>
>>> I'm new to web development and just started trying out web2py (v.2.0.3). 
>>> I found that the user registration in the Welcome application was not 
>>> working for me: after filling in the form and clicking the Register button, 
>>> the fields in the form would just all get emptied and there would be no 
>>> other feedback. After trying different browsers and browser options, it 
>>> seems this happens when using FireFox (v.14.01) with browser option "Tell 
>>> websites I do not want to be tracked" checked on. How would one modify the 
>>> Welcome application so that a visitor that has that browser option set can 
>>> still register?
>>>
>>> Thanks,
>>>
>>> NC
>>>
>>

-- 





[web2py] Re: web2py 2.0.5 is out

2012-08-31 Thread wwwgong
Congratulations and Many Thanks! 
The new web2py is my best birthday gift. 
Cheers!

On Friday, August 31, 2012 5:59:43 PM UTC-4, Massimo Di Pierro wrote:
>
> web2py 2.0.5 is out.
> All known backward compatibility issues should be fixed but continue 
> testing... thank you for your patience.
>
> massimo
>
> On Wednesday, 29 August 2012 22:41:34 UTC-5, Massimo Di Pierro wrote:
>>
>> After 5 months. It is done. This is the most waited and the most 
>> feature-packed release.
>>
>> I am sure we'll find some corners that need to be ironed but it is 
>> considerably better than 1.99.7. It adds lot of new features and improves 
>> many existing ones:
>>
>> - 57,000 new lines of code and closed 279 issues since 1.99.7.
>> - Retrieving data from DB should be faster, in particular 
>> select(cacheable=True)
>> - Has a new scheduler, a built-in wiki, new language and pluralization 
>> system, better markmin with oembed support and better scaffolding app, 
>> increased security.
>> - Lots of experimental features including GIS support, mongodb support, 
>> built-in auth.wiki(), and more.
>>
>> Should be 100% backward compatible. If you run into any issue let us know 
>> ASAP.
>>
>> I personally want to thank the major contributors to this release (in 
>> alphabetic order)
>> Alan, Andrew, Anthony, Bruno, Christian, Dave, Dominic, Iceberg, 
>> Jonathan, Marc, Mariano, Marin, Martin, Mark, Michael, Michele, Niphlod, 
>> Patrick, Vladyslav, 
>> They spend many nights testing, coding, debugging at a very fast pace.
>>
>> Many many people have contributed.
>>
>> If your contribution has not been properly acknowledged please let us 
>> know ASAP. It is probably an oversight.
>>
>>
>> Massimo
>>
>>
>> Detailed changelog
>> ===
>>
>> ## 2.00.2
>>
>> ### DAL Improvements
>>
>> - Support for DAL(lazy_tables=True) and db.define_table(on_define=lambda 
>> table:), thanks Jonathan
>> - db(...).select(cacheable=True) make select 30% faster
>> - db(...).select(cache=(cache.ram,3600)) now caches parsed data 100x 
>> faster
>> - db(...).count(cache=(cache.ram,3600)) now supported
>> - MongoDB support in DAL (experimental), thanks Mark Breedveld
>> - geodal and spatialite, thanks Denes and Fran (experimental)
>> - db.mytable._before_insert, _after_insert, _before_update, 
>> _after_update, _before_delete. _after_delete (list of callbacks)
>> - db(...).update_naive(...) same as update but ignores 
>> table._before_update and table._after_update
>> - DAL BIGINT support and DAL(...,bigint_id=True)
>> - IS_IN_DB(..., distinct=True)
>> - new syntax: db.mytable.insert(myuploadfield=open()), thank you 
>> Iceberg
>> - db(...).select(db.mytable.myfield.count(distinct=True))
>> - db(db.a)._update(name=db(db.b.a==db.a.id).nested_select(db.b.id))
>> - db.mytable.myfield.filter_in, filter_out
>> - db.mytable._enable_record_versioning(db) adds versioning to this table
>> - teradata adapter, thanks Andrew Willimott
>> - experimental Sybase Adapter
>> - added db.table.field.avg()
>> - Support for Google App Engine projections, thanks Christian
>> - Field(... 'upload', default=path) now accepts a path to a local file as 
>> default value, if user does not upload a file. Relative path looks inside 
>> current application folder, thanks Marin
>> - executesql(...,fields=,columns=) allows parsing of results in Rows, 
>> thanks Anthony
>>
>> ### Auth improvements
>>
>> - auth.enable_record_versioning(db)  adds full versioning to all tables
>> - @auth.requires_login(otherwise=URL(...))
>> - auth supports salt and compatible with third party data, thanks Dave 
>> Stoll
>> - CRYPT now defaults to pbkdf2(1000,20,sha1)
>> - Built-in wiki with menu, tags, search, media, permissions. def index: 
>> return auth.wiki()
>> - auth.settings.everybody_group_id
>> - allow storage of uploads on any PyFileSystem (including amazon)
>>
>> ### Form improvements
>>
>> - FORM.confirm('Are you sure?',{'Back':URL(...)})
>> - SQLFORM.smartdictform(dict)
>> - form.add_button(value,link)
>> - SQLFORM.grid(groupby='...')
>> - fixed security issue with SQLFORM.grid and SQLFORM.smartgrid
>> - more export options in SQLFORM.grid and SQLFORM.smartgrid (html, xml, 
>> csv, ...)
>>
>> ### Admin improvements
>>
>> - new admin pages: manage_students, bulk_regsiter, and progress reports
>> - increased security in admin against CSRF
>> - experimental Git integration
>> - experimental OpenShift deployment
>> - multi-language pluralization engine 
>> - ace text web editor in admin
>> - Ukrainian translations, thanks Vladyslav Kozlovskyy
>> - Romanian translation for welcome, thanks ionel
>> - support for mercurial 2.6, thanks Vlad
>>
>> ### Scheduler Improvements (thanks to niphlod, ykessler, dhx, toomim)
>>
>> - web2py.py -K myapp -X starts the myapp scheduler alongside the webserver
>> - tasks are marked EXPIRED (if stop_time passed)
>> - functions with no result don't end up in scheduler_run
>> - more options: web2py.py -E -b -L
>> - scheduler can now handle 10k tasks with 

Re: [web2py] Cannot install on computer

2012-08-31 Thread lukedc
Yes, it works. Thank you so much. I am learning web2py, it is a great 
framework, Thank you once again sir, Luke

On Thursday, August 30, 2012 11:40:21 PM UTC-5, Massimo Di Pierro wrote:
>
> The web2py_win.zip should also work now.
>
> On Thursday, 30 August 2012 23:19:20 UTC-5, lukedc wrote:
>>
>> Nevermind, sir. I just tried it and it works. I just had to try is again, 
>> using 7 zip, and it works. Thank you so much for your help. Both of you 
>> sirs were very helpful. Thank you so much, it was very nice of you. 
>>
>> Have a good day,Luke
>>
>> On Thursday, August 30, 2012 10:58:32 PM UTC-5, Massimo Di Pierro wrote:
>>>
>>> Thanks for being so patient.
>>> This is not an error: "No handlers could for found for logger "web2py"
>>>
>>> what error do you get after that?
>>>
>>> massimo
>>>
>>> On Thursday, 30 August 2012 22:53:07 UTC-5, lukedc wrote:

 Hi sir, 

 Thank you so much. I have tried that, but it does not work. I says, "No 
 handlers could for found for logger "web2py"" Then it gives an error. What 
 should I do? Thank you so much for your time and help. it is very nice of 
 you, Luke

 On Thursday, August 30, 2012 10:47:21 PM UTC-5, Massimo Di Pierro wrote:
>
> There is no installation. 
>
> download web2py_src.py
> unzip web2py_src.py
> cd web2py
> C:/Python27/python.exe web2py.py
>
> you may be able to just click on web2py.py from the window. Not sure 
> because I am not a window user.
>
>
>
>
>
> On Thursday, 30 August 2012 22:42:07 UTC-5, lukedc wrote:
>>
>> Ok thank you so much. I am trying the source code. Do you know 
>> where instructions for the source code is? Like, how do I install in 
>> source 
>> code? Thank you so much sir, you are all very helpful. Luke
>>
>> On Thursday, August 30, 2012 10:33:18 PM UTC-5, Massimo Di Pierro 
>> wrote:
>>>
>>> We have a problem with the windows and osx builds. Please try again. 
>>> Worst case use the source version. If you have python installed it as 
>>> easy 
>>> as downloading, unzipping, and running web2py.py.
>>>
>>> On Thursday, 30 August 2012 22:31:08 UTC-5, lukedc wrote:

 Hi sir, 

 Thank you so much for your help. I have windows 7, the web2py is 
 the latest, it is on the site. 2.0.3. 

 I have python installed. I download the web2py, and get the folder. 
 I then open the folder, and get the web2py.exe file, and double click 
 on 
 it. I just get the cmd screen real quick, and then it goes away. 

 What should I do?

 Thank you so much for your help. I mean how do I execute the 
 web2py? Thank you so much once again, Luke

 On Thursday, August 30, 2012 7:40:16 PM UTC-5, rochacbruno wrote:
>
> Which version of web2py? which version of windows?
>
> BTW: You have not to install web2py, web2py is executable, no need 
> to install!
>
> If you downloaded the windows version .exe you just need to run it 
> (if it is not working, please tell us your version of windows and 
> web2py)
>
> If you download the source_code version **recommended** you just 
> need to unzip it, then you need to install Python, go to 
> www.python.org and install version 2.7 for windows. After having 
> Python installed open a windows command line: I guess you can do it 
> clicking on start button then write "cmd" on the text box there.
>
> On cmd:
>
> > cd c:\myuserfolder\Downloads\web2py
>
> ** the path where you unzipped
>
> then 
>
> > c:\python27\python.exe web2py.py
>
>
>
> On Thu, Aug 30, 2012 at 9:23 PM, lukedc  wrote:
>
>> Hi everyone, 
>>
>> I know that this is a dumb question, but i could not find an 
>> answer to it anywhere i looked. I am just instaling web2py, but when 
>> I 
>> click on the web2py.exe, it does not work. just a quick 
>> cmd screen comes up and then goes away real quick. What should I do? 
>> I 
>> don't know how to install from the command prompt. 
>>
>> Thank you so much, Luke
>>  
>> -- 
>>  
>>  
>>  
>>
>
>
>

-- 





  1   2   >