Re: [web2py:37218] Re: Excess whitespace in html

2009-12-14 Thread Alex Fanjul
Hi Jonathan, I attatched both html with a very simple example in the 
email showing double in size. Doesn't appear attached? I always write 
from Thunderbird, so let me know.

Massimo, ,maybe not whitespaces but strip more than one consecutive 
blank lines?
Alex F

El 15/12/2009 7:37, Jonathan Lundell escribió:
> On Dec 14, 2009, at 8:39 PM, Alex Fanjul wrote:
>
>
>> But... what about pages size?
>> Doing some very basic test with Denes Example show us that including
>> blank lines increase the output page size by *x2 factor* at least (ie.
>> 67KB vs 130KB).
>> Maybe I'm wrong, but, forgetting server deflating (which not everybody
>> use), there are a double size in store and transmit bandwidth, that is
>> money.
>>
>> If it isn't too dificult to implement I would prefer to see it legible
>> in 'design' and 'running' time, because many times people review and
>> debug webpages over generated code (I guess)
>>  
> 2x seems like an awful lot, since a newline is only one byte. Are you sure?
>
> You could try slimmer: http://pypi.python.org/pypi/slimmer/
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>
>
>

-- 
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--

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




Re: [web2py:37217] Re: Excess whitespace in html

2009-12-14 Thread Jonathan Lundell
On Dec 14, 2009, at 8:39 PM, Alex Fanjul wrote:

> But... what about pages size?
> Doing some very basic test with Denes Example show us that including 
> blank lines increase the output page size by *x2 factor* at least (ie. 
> 67KB vs 130KB).
> Maybe I'm wrong, but, forgetting server deflating (which not everybody 
> use), there are a double size in store and transmit bandwidth, that is 
> money.
> 
> If it isn't too dificult to implement I would prefer to see it legible 
> in 'design' and 'running' time, because many times people review and 
> debug webpages over generated code (I guess)

2x seems like an awful lot, since a newline is only one byte. Are you sure?

You could try slimmer: http://pypi.python.org/pypi/slimmer/

--

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




[web2py:37216] Re: Excess whitespace in html

2009-12-14 Thread mdipierro
The problem who is web2py supposed to know which spaces to keep and
which to remove? To do it, it would need to "understand" the html by
parsing and then re-writing it. First of all it is slow. Second, it
can break the css since whitespaces affect css behavior.



On Dec 14, 10:39 pm, Alex Fanjul  wrote:
> But... what about pages size?
> Doing some very basic test with Denes Example show us that including
> blank lines increase the output page size by *x2 factor* at least (ie.
> 67KB vs 130KB).
> Maybe I'm wrong, but, forgetting server deflating (which not everybody
> use), there are a double size in store and transmit bandwidth, that is
> money.
>
> If it isn't too dificult to implement I would prefer to see it legible
> in 'design' and 'running' time, because many times people review and
> debug webpages over generated code (I guess)
>
> Regards,
> Alex F
>
> El 15/12/2009 5:12, DenesL escribi�:
>
>
>
> > It all comes down to a trade off.
> > Do you want you view or your final output to be legible and
> > aesthetically pleasing according to some subjective human standard?.
>
> > Don't get me wrong, I dislike the empty lines as much as you do but as
> > Massimo said the view only outputs what it has:
>
> > this view
> > {{for x in range(1,r+1):}}{{if x==c:}}{{=x}}{{else:}}
> > {{=x}}{{pass}}{{pass}}
>
> > could produce this
> > 12345
>
> > but a more legible
> > 
> > {{for x in range(1,r+1):}}
> >    {{if x==c:}}{{=x}}
> >    {{else:}}{{=x}}
> >    
> >    {{pass}}
> > {{pass}}
> > 
>
> > will give you this
> > 
> > 
> >    1
> >    
>
> > 
> >    2
> >    
>
> > 
> >    3
>
> > 
> >    4
> >    
>
> > 
>
> >    5
> >    
>
> > 
>
> > and both outputs would look exactly the same in a browser.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.
>
> --
> Alejandro Fanjul Fdez.
> alex.fan...@gmail.comwww.mhproject.org
>
>  li_denes.html
> 90KViewDownload
>
>  li_denes_wspaces.html
> 176KViewDownload

--

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




[web2py:37215] New features not documented in Book 2nd edition

2009-12-14 Thread DenesL
New features not documented in Book 2nd edition

1.74.1
* Moved to mercurial
* Default validators use the new define_table(,format='...')
  http://groups.google.com/group/web2py/browse_thread/thread/35298fa6005a3a5b
* New get_vars and post_vars compatible in 2.5 and 2.6 (thanks Tim)
* Major rewrite of gql.py extends DAL syntax on GAE, supports belongs
  http://groups.google.com/group/web2py/browse_thread/thread/6efa5dd4095f91e1
* No more *.w2p, welcome.w2p is created automatically, base apps are
  always upgraded
* decimal validator allows negative numbers
* 1.74.x is the last version with the old DAL. The new DAL is in gluon/
dal.py
  To try out the new experimental DAL
  copy or rename gluon/dal.py as gluon/sql.py
http://groups.google.com/group/web2py/msg/3e40f3d30c3b82f2

1.73.1
* New decimal field type, as discussed in
 http://groups.google.com/group/web2py/browse_thread/thread/3c1957d8ed743513
* New IS_DECIMAL_IN_RANGE validator
* Experimental support for non UTF8 encoding in DB
* T.current_languages default to 'en' and new T.set_current_languages
* New gluon/contrib/populate.py
* Customizable CSV and more...
http://groups.google.com/group/web2py/browse_thread/thread/72a7d6d43a8aecb1

1.72.1
* Alias for id field
  allows to redefine the name of the 'id' field.
* make_migrate=True
   rebuild missing .table files
http://groups.google.com/group/web2py/browse_thread/thread/eed21229883b5a1a

* keyed tables
  support for legacy tables (MS SQL, DB2, Ingres & Informix)
http://groups.google.com/group/web2py/browse_thread/thread/db150376b06d47fc

1.71.1
* A complete rewrite or the Rows object that makes web2py faster and
smaller
* DALStorage is renamed Row
* Now you can call web DAL form any Python program
* You can also use the template language from any Python program
http://groups.google.com/group/web2py/browse_thread/thread/159b44bfbb634df2
http://groups.google.com/group/web2py/browse_thread/thread/c81061bc00c6181e

1.69.1
* Lots of new DAL APIs including
  OR, LIKE, BELONGS, and more on GAE
* response.meta.keywords, reponse.meta.description,
  response.meta.author, ...
* response.files.append for including js & css files
* experimental plugin mechanism
http://groups.google.com/group/web2py/browse_thread/thread/fe6381e136995563
http://www.web2py.com/AlterEgo/default/show/248

1.68.1
* New cron
* New hindi and spanish translation
* cached uploads allow for progress bars (thanks AndCycle)
* Ingres support (thanks Chris)
* default setting of content-type (this may cause strange behavior in
old apps when downloading images)
* IS_UPPER and IS_LOWER work with unicode
* CLEANUP now takes regex of allowed/now allowed characters
* New rewrite.py allows dynamic routes
* Better error messages for IS_INT_* and IS_FLOAT_*
http://groups.google.com/group/web2py/browse_thread/thread/ba5fa43f53ad38ad


Other info
--

How to make your own layouts
http://groups.google.com/group/web2py/browse_thread/thread/6f321414a058b4b3
http://groups.google.com/group/web2py/browse_thread/thread/5a75171b835f542d
http://code.google.com/p/web2py/source/browse/trunk/scripts/layout_make.py

Virtual fields
http://groups.google.com/group/web2py/browse_thread/thread/c684346f13773f93
http://groups.google.com/group/web2py/browse_thread/thread/d59ee3d6c2e6d836
http://www.vimeo.com/7296755
http://www.web2py.com/AlterEgo/default/show/248 (at the end)

--

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




[web2py:37213] Re: web2py 1.74.1 is OUT

2009-12-14 Thread mdipierro
I made more changes in new DAL. It is broken badly now because it is
in a the middle of a major change so that GAE and MongoDB can become
simple adapters.

Anyway, it passes some tests. You can try:

   cd gluon
   python dal.py

Preliminary tests of the functions that work show that selects are 10%
faster. This was a concern of mine, I thought it was going to be slow.
No more string comparisons and table lookups.

Take a look. Advice and comments are appreciated.

Massimo

On Dec 14, 10:23 pm, Massimo Di Pierro 
wrote:
> It will only upgrade admin, welcome, examples and only overwrite those  
> apps. It will not touch the other apps.
>
> Anyway. Make a backup first. ;-)
>
> Massimo
>
> On Dec 14, 2009, at 9:46 PM, Alex Fanjul wrote:
>
> > Hello Massimo,
> > With the new characteristic of no need to upgrade, (if I  didn't any
> > change to admin or welcome) is it safe to just (copy over) overwrite
> > entirely web2py folder and execute "python2.5 web2py.py" at least  
> > one time?
>
> > Thanks
> > Alex F
>
> > El 14/12/2009 17:33, mdipierro escribió:
> >> New features:
> >> - Moved to mercurial
> >> - Default validators use the new define_table(,format='...')
> >> - New get_vars and post_vars compatible in 2.5 and 2.6 (thanks Tim)
> >> - Major rewrite of gql.py extends DAL syntax on GAE, supports belongs
> >> - No more *.w2p, welcome.w2p is create automatically, base apps are
> >> always upgrade
> >> - decimal validator allow negative numbers
>
> >> 1.74.* is the last version with the old DAL. The new DAL is in gluon/
> >> dal.py. To try out the new experimenatal DAL do
>
> >>     cp gluon/dal.py gluon/sql.py
>
> >> Please report any problem.
>
> >> Massimo
>
> >> --
>
> >> You received this message because you are subscribed to the Google  
> >> Groups "web2py-users" group.
> >> To post to this group, send email to web...@googlegroups.com.
> >> To unsubscribe from this group, send email to 
> >> web2py+unsubscr...@googlegroups.com
> >> .
> >> For more options, visit this group 
> >> athttp://groups.google.com/group/web2py?hl=en
> >> .
>
> > --
> > Alejandro Fanjul Fdez.
> > alex.fan...@gmail.com
> >www.mhproject.org
>
>

--

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




[web2py:37212] Re: Fail login doesn't return an errorm msg

2009-12-14 Thread mdipierro
I do not know. Glad it is fixed anyway.

On Dec 14, 9:19 pm, Yannick  wrote:
> Hello Massimo,
> Thanks I just test the new release and realized that the double
> redirect seem to be fixed on the Auth - Login I just wonder what
> was the root of the issue I got in the previous release...
>
> Thanks
>
> On Dec 12, 12:31 pm, Yannick  wrote:
>
> > Hello Massimo, thanks for the note...
> > i did follow your instructions which was :
> > 1) I put this in the view {{=loginform}}
> > 2) I print request.function and request.vars from the model
> > And here is what i see:
> > login
> >  > '440a019c-1479-4b0d-8e86-b27c0496dd7a', 'password': '12w12123',
> > '_formname': 'login', '_next': ''}>
> > login
> > 
>
> > It looks like there is a double redirect...
>
> > I did create a small brand new application just to test the login with
> > Auth using the web2py admin console ( Just to double check that is not
> > my code which cause this) and I have the same result...
>
> > I'll send you the code that I used to test it... I really don't know
> > why that happen, I think it use to work in the pass...
>
> > Thanks for your help...
>
> > Cheers,
> > Yannick P.
>
> > On Dec 11, 9:59 am, mdipierro  wrote:
>
> > > For debugging purposes
>
> > > 1) try replace everything in the view with {{=loginform}}
>
> > > 2) try print request.function, request.vars
>
> > > what do you see?
>
> > > Feel free to send me your code and I will take a look.
>
> > > massimo
>
> > > On Dec 11, 8:47 am, Yannick  wrote:
>
> > > > Yes I did comment this out "auth.settings.login_next=URL(r=request,
> > > > f='profile') "
> > > > but still same old, the double redirect is still there... I really
> > > > wonder what trigger that double redirection... there is nothing extra
> > > > I'm doing here, I fulling using Auth API... Hmmm...
>
> > > > On Dec 11, 9:33 am, Wes James  wrote:
>
> > > > > On Thu, Dec 10, 2009 at 8:09 PM, Yannick  
> > > > > wrote:
> > > > > > Hello thanks for the note...
>
> > > > > > I did add "print request.function"
> > > > > > and Yes there is a double redirection because the output print the
> > > > > > function login twice :
> > > > > > login
> > > > > > login
>
> > > > > > I wonder how to fix this double redirection here is one of the 
> > > > > > setting
> > > > > > I have in my controller:
> > > > > > auth.settings.login_next=URL(r=request, f='profile')
>
> > > > > comment this out just to see what happens...
>
> > > > > or use wingide and see where it goes.
>
> > > > > > Do you have any idea... I'll keep debugging...
>
> > > > > > On Dec 9, 11:20 pm, mdipierro  wrote:
> > > > > >> Add a
>
> > > > > >> print request.function
>
> > > > > >> to your model and check if there is a double redirect.
> > > > > >> The other possibility is that sessions are not working.
>
> > > > > >> On Dec 9, 9:12 pm, Yannick  wrote:
>
> > > > > >> > Is anyone already has this issue and where able to solve it... I 
> > > > > >> > don't
> > > > > >> > see any double redirect in my code...
>
> > > > > >> > Thanks for your help...
>
> > > > > >> > On Dec 9, 11:36 am, Wes James  wrote:
>
> > > > > >> > > Sorry,  I'm not sure exactly when/where I made this change in 
> > > > > >> > > the last
> > > > > >> > > week.  You can use wingide and check what the repsponse.flash 
> > > > > >> > > is
> > > > > >> > > between function calls.
>
> > > > > >> > > -wes
>
> > > > > >> > > On Wed, Dec 9, 2009 at 8:49 AM, Yannick 
> > > > > >> > >  wrote:
> > > > > >> > > > Hmm interesting, thanks for the note... I don't think I'm 
> > > > > >> > > > doing a
> > > > > >> > > > double redirection in my code though... can you please let 
> > > > > >> > > > me know how
> > > > > >> > > > you resolved that issue when you had it >
>
> > > > > >> > > > Thanks,
> > > > > >> > > > Yannick P.
>
> > > > > >> > > > On Dec 9, 9:30 am, Wes James  wrote:
> > > > > >> > > >> On Tue, Dec 8, 2009 at 9:35 PM, Yannick 
> > > > > >> > > >>  wrote:
> > > > > >> > > >> > hello mate,
> > > > > >> > > >> > I wonder  because I noticed that in auth, when the user 
> > > > > >> > > >> > fails to login
> > > > > >> > > >> > (enter a fake username and password) there is no error 
> > > > > >> > > >> > message
> > > > > >> > > >> > returned...
>
> > > > > >> > > >> Yannick,
>
> > > > > >> > > >> I just tried it on one of my sites and I got "Invalid 
> > > > > >> > > >> Login" flash message.
>
> > > > > >> > > >> I had the same issue on one of my forms not showing  field 
> > > > > >> > > >> validation
> > > > > >> > > >> errors.  It was as mr.freeze indicated, a double redirect 
> > > > > >> > > >> that was
> > > > > >> > > >> causing this .
>
> > > > > >> > > >> -wes
>
> > > > > >> > > > --
>
> > > > > >> > > > You received this message because you are subscribed to the 
> > > > > >> > > > Google Groups "web2py-users" group.
> > > > > >> > > > To post to this group, send email to web...@googlegroups.com.
> > > > > >> > > > To unsubscribe from this group, send email to 
> > > > > >> > > > web2py

Re: [web2py:37211] web2py 1.74.1 is OUT

2009-12-14 Thread Massimo Di Pierro
It will only upgrade admin, welcome, examples and only overwrite those  
apps. It will not touch the other apps.

Anyway. Make a backup first. ;-)

Massimo

On Dec 14, 2009, at 9:46 PM, Alex Fanjul wrote:

> Hello Massimo,
> With the new characteristic of no need to upgrade, (if I  didn't any
> change to admin or welcome) is it safe to just (copy over) overwrite
> entirely web2py folder and execute "python2.5 web2py.py" at least  
> one time?
>
> Thanks
> Alex F
>
> El 14/12/2009 17:33, mdipierro escribió:
>> New features:
>> - Moved to mercurial
>> - Default validators use the new define_table(,format='...')
>> - New get_vars and post_vars compatible in 2.5 and 2.6 (thanks Tim)
>> - Major rewrite of gql.py extends DAL syntax on GAE, supports belongs
>> - No more *.w2p, welcome.w2p is create automatically, base apps are
>> always upgrade
>> - decimal validator allow negative numbers
>>
>> 1.74.* is the last version with the old DAL. The new DAL is in gluon/
>> dal.py. To try out the new experimenatal DAL do
>>
>> cp gluon/dal.py gluon/sql.py
>>
>> Please report any problem.
>>
>> Massimo
>>
>> --
>>
>> You received this message because you are subscribed to the Google  
>> Groups "web2py-users" group.
>> To post to this group, send email to web...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> web2py+unsubscr...@googlegroups.com 
>> .
>> For more options, visit this group at 
>> http://groups.google.com/group/web2py?hl=en 
>> .
>>
>>
>>
>>
>
> -- 
> Alejandro Fanjul Fdez.
> alex.fan...@gmail.com
> www.mhproject.org

--

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




[web2py:37210] Re: Excess whitespace in html

2009-12-14 Thread DenesL
It all comes down to a trade off.
Do you want you view or your final output to be legible and
aesthetically pleasing according to some subjective human standard?.

Don't get me wrong, I dislike the empty lines as much as you do but as
Massimo said the view only outputs what it has:

this view
{{for x in range(1,r+1):}}{{if x==c:}}{{=x}}{{else:}}
{{=x}}{{pass}}{{pass}}

could produce this
12345

but a more legible

{{for x in range(1,r+1):}}
  {{if x==c:}}{{=x}}
  {{else:}}{{=x}}
  
  {{pass}}
{{pass}}


will give you this


  1
  



  2
  


  3


  4
  



  5
  





and both outputs would look exactly the same in a browser.

--

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




Re: [web2py:37209] web2py 1.74.1 is OUT

2009-12-14 Thread Alex Fanjul
Hello Massimo,
With the new characteristic of no need to upgrade, (if I  didn't any 
change to admin or welcome) is it safe to just (copy over) overwrite 
entirely web2py folder and execute "python2.5 web2py.py" at least one time?

Thanks
Alex F

El 14/12/2009 17:33, mdipierro escribió:
> New features:
> - Moved to mercurial
> - Default validators use the new define_table(,format='...')
> - New get_vars and post_vars compatible in 2.5 and 2.6 (thanks Tim)
> - Major rewrite of gql.py extends DAL syntax on GAE, supports belongs
> - No more *.w2p, welcome.w2p is create automatically, base apps are
> always upgrade
> - decimal validator allow negative numbers
>
> 1.74.* is the last version with the old DAL. The new DAL is in gluon/
> dal.py. To try out the new experimenatal DAL do
>
>  cp gluon/dal.py gluon/sql.py
>
> Please report any problem.
>
> Massimo
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>
>
>

-- 
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--

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




[web2py:37208] Re: Fail login doesn't return an errorm msg

2009-12-14 Thread Yannick
Hello Massimo,
Thanks I just test the new release and realized that the double
redirect seem to be fixed on the Auth - Login I just wonder what
was the root of the issue I got in the previous release...

Thanks

On Dec 12, 12:31 pm, Yannick  wrote:
> Hello Massimo, thanks for the note...
> i did follow your instructions which was :
> 1) I put this in the view {{=loginform}}
> 2) I print request.function and request.vars from the model
> And here is what i see:
> login
>  '440a019c-1479-4b0d-8e86-b27c0496dd7a', 'password': '12w12123',
> '_formname': 'login', '_next': ''}>
> login
> 
>
> It looks like there is a double redirect...
>
> I did create a small brand new application just to test the login with
> Auth using the web2py admin console ( Just to double check that is not
> my code which cause this) and I have the same result...
>
> I'll send you the code that I used to test it... I really don't know
> why that happen, I think it use to work in the pass...
>
> Thanks for your help...
>
> Cheers,
> Yannick P.
>
> On Dec 11, 9:59 am, mdipierro  wrote:
>
> > For debugging purposes
>
> > 1) try replace everything in the view with {{=loginform}}
>
> > 2) try print request.function, request.vars
>
> > what do you see?
>
> > Feel free to send me your code and I will take a look.
>
> > massimo
>
> > On Dec 11, 8:47 am, Yannick  wrote:
>
> > > Yes I did comment this out "auth.settings.login_next=URL(r=request,
> > > f='profile') "
> > > but still same old, the double redirect is still there... I really
> > > wonder what trigger that double redirection... there is nothing extra
> > > I'm doing here, I fulling using Auth API... Hmmm...
>
> > > On Dec 11, 9:33 am, Wes James  wrote:
>
> > > > On Thu, Dec 10, 2009 at 8:09 PM, Yannick  wrote:
> > > > > Hello thanks for the note...
>
> > > > > I did add "print request.function"
> > > > > and Yes there is a double redirection because the output print the
> > > > > function login twice :
> > > > > login
> > > > > login
>
> > > > > I wonder how to fix this double redirection here is one of the setting
> > > > > I have in my controller:
> > > > > auth.settings.login_next=URL(r=request, f='profile')
>
> > > > comment this out just to see what happens...
>
> > > > or use wingide and see where it goes.
>
> > > > > Do you have any idea... I'll keep debugging...
>
> > > > > On Dec 9, 11:20 pm, mdipierro  wrote:
> > > > >> Add a
>
> > > > >> print request.function
>
> > > > >> to your model and check if there is a double redirect.
> > > > >> The other possibility is that sessions are not working.
>
> > > > >> On Dec 9, 9:12 pm, Yannick  wrote:
>
> > > > >> > Is anyone already has this issue and where able to solve it... I 
> > > > >> > don't
> > > > >> > see any double redirect in my code...
>
> > > > >> > Thanks for your help...
>
> > > > >> > On Dec 9, 11:36 am, Wes James  wrote:
>
> > > > >> > > Sorry,  I'm not sure exactly when/where I made this change in 
> > > > >> > > the last
> > > > >> > > week.  You can use wingide and check what the repsponse.flash is
> > > > >> > > between function calls.
>
> > > > >> > > -wes
>
> > > > >> > > On Wed, Dec 9, 2009 at 8:49 AM, Yannick  
> > > > >> > > wrote:
> > > > >> > > > Hmm interesting, thanks for the note... I don't think I'm 
> > > > >> > > > doing a
> > > > >> > > > double redirection in my code though... can you please let me 
> > > > >> > > > know how
> > > > >> > > > you resolved that issue when you had it >
>
> > > > >> > > > Thanks,
> > > > >> > > > Yannick P.
>
> > > > >> > > > On Dec 9, 9:30 am, Wes James  wrote:
> > > > >> > > >> On Tue, Dec 8, 2009 at 9:35 PM, Yannick 
> > > > >> > > >>  wrote:
> > > > >> > > >> > hello mate,
> > > > >> > > >> > I wonder  because I noticed that in auth, when the user 
> > > > >> > > >> > fails to login
> > > > >> > > >> > (enter a fake username and password) there is no error 
> > > > >> > > >> > message
> > > > >> > > >> > returned...
>
> > > > >> > > >> Yannick,
>
> > > > >> > > >> I just tried it on one of my sites and I got "Invalid Login" 
> > > > >> > > >> flash message.
>
> > > > >> > > >> I had the same issue on one of my forms not showing  field 
> > > > >> > > >> validation
> > > > >> > > >> errors.  It was as mr.freeze indicated, a double redirect 
> > > > >> > > >> that was
> > > > >> > > >> causing this .
>
> > > > >> > > >> -wes
>
> > > > >> > > > --
>
> > > > >> > > > You received this message because you are subscribed to the 
> > > > >> > > > Google Groups "web2py-users" group.
> > > > >> > > > To post to this group, send email to web...@googlegroups.com.
> > > > >> > > > To unsubscribe from this group, send email to 
> > > > >> > > > web2py+unsubscr...@googlegroups.com.
> > > > >> > > > For more options, visit this group 
> > > > >> > > > athttp://groups.google.com/group/web2py?hl=en.
>
> > > > > --
>
> > > > > You received this message because you are subscribed to the Google 
> > > > > Groups "web2py-users" group.
> > > > > To post to this group, send email t

[web2py:37207] Re: web2py 1.74.1 is OUT

2009-12-14 Thread Yannick
Thanks the double redirect seems to be fixed in this release...

On Dec 14, 1:45 pm, Thadeus Burgess  wrote:
> Also you can specify custom options to the export_to_csv.
>
> export_to_csv(delimiter = ',', quotechar = '"', quoting = csv.QUOTE_MINIMAL)
>
> On Mon, Dec 14, 2009 at 10:46 AM, mdipierro  wrote:
> > I fixed it on the web site
>
> > On Dec 14, 10:35 am, Jonathan Lundell  wrote:
> >> On Dec 14, 2009, at 8:33 AM, mdipierro wrote:
>
> >> > - Moved to mercurial
>
> >>http://www.web2py.com/examples/default/downloadstillsays SVN.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

--

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




[web2py:37206] Re: SQLFORM, no-table, with fieldsets.

2009-12-14 Thread DenesL

On Dec 14, 6:00 pm, Thadeus Burgess  wrote:
> Take, for example:  http://jeffhowden.com/code/css/forms/
Ah yes, that was one of the many pages I saw during my research.
But even that is too static for me. I want to change the layout on the
fly, even live, and to remember it.
Can you see where I am going with this?.

> With a form design as such, you can turn it easily into
>
> http://www.jankoatwarpspeed.com/post/2009/09/28/webform-wizard-jquery...
That may come in handy but it is not what I am after.

> A custom patch seems to be the most appropriate. Create a list, that
> represents the form, and use a function to chop through it.
>
> I am playing around with the following
>
> http://pastebin.com/m764d7a39
>
> Basically, it takes a list of lists, each sublist is a fieldset where
> if a element is a list it is the fieldset title, and if it is a tuple,
> it goes into the notes div.
>
> It formats the form and looks "almost" exactly like the one on the
> first link (with the appropriate css. Then using the formtowizard, it
> looks nice :)
>
> I am actually happier with this, since I believe allows for the most
> customization as far as form content goes.
>
> SQLFORM does need to be refactored into more MVC format I am
> thinking of SQLFORM only making the data ready, and performing the
> validation, and have a separate class that creates and renders the
> form elements.
SQLFORM could be made more plugable, with the current table output
being the default.
I also ended up using a separate class to generate the output which
keeps the changes to controllers and views to a bare minimum: one
line.
What I need now is to play with the CSS layout of the elements and see
what works and what doesn't.

Denes

--

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




[web2py:37205] Re: problem with DAL in shell using 1.74.1

2009-12-14 Thread mdipierro
This is not a new problem unfortunately. There is some timeout issue
with the sqlite diver. The problems is that the connection needs to be
open server side for as long as the shell is open but the driver does
not allow it. I have not found a way around this yet.

If you or anybody has idea of how to solve this please let me know.

Massimo

On Dec 14, 7:31 pm, Jake  wrote:
> On Dec 14, 8:06 pm, mdipierro  wrote:> Is this the 
> web based shell?
>
> Yes, on Windows XP served from localhost with the included web server.
>
> ty
> Jake

--

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




[web2py:37204] Re: how to use GAE remote api?

2009-12-14 Thread Richard
and as you said, you will need the __init__.py files


On Dec 15, 8:45 am, Richard  wrote:
> try adding your application directory to sys.path
>
> On Dec 15, 5:35 am, Dan  wrote:
>
> > I need to do some bulk operations (eg delete) on data in the GAE
> > datastore for a web2py application, and was trying to follow the
> > example in the GAE docs 
> > here:http://code.google.com/appengine/articles/remote_api.html
>
> > I can get the console up and running using the suggested
> > appengine_console.py code, but am struggling to think of the right
> > command to load the web2py application's data model into the console
> > session so that I can run queries and work with the data. For example,
> > this didn't work:
>
> > >>> import applications.init.models.db
> > or
> > >>> import models.db
>
> > both result in this message:
> > ImportError: No module named models.db
>
> > What is the proper command? Do I need to create any __init__.py files
> > to make it work? Do I need to import some web2py modules first (or
> > instead)?
>
> > thanks
> > Dan
>
>

--

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




[web2py:37203] Re: check_credentials not working (for me)

2009-12-14 Thread Yarko Tymciurak

On Dec 14, 5:49 pm, selecta  wrote:
> Ok sorry for the little info
> I log into the general admin (http://127.0.0.1:8000/admin/default/
> index)
> I create an application
> I try to edit the database with appadmin.py but it just redirects me
> if I do not comment: if not gluon.fileutils.check_credentials
> (request): redirect(URL(a='admin', c='default', f='index'))

I am not able to reproduce; here's what I did:

clean pull, current version from google code;
   Version:  web2py Version 1.74.1 (2009-12-14 10:05:21)

I create a new app - "test"
I edit db.py in test (using admin), add a table:

  db.define_table('test', Field('name'));

I save, and go to database administration, and add an entry in table
test --- success (record inpected, seems ok)

What do you mean when you say "I try to edit the database with
appadmin.py"?

Regards,
- Yarko

>
> web2py Version 1.72.3 (2009-11-10 09:17:13)
>
> On Dec 14, 3:27 pm, mdipierro  wrote:
>
>
>
> > I am not sure the behavior you experience is wrong. Is this about
> > appadmin? Did you try after login in admin? can you show us the
> > workflow you experience and what you expect? Which web2py version?
>
> > Massimo
>
> > On Dec 14, 4:06 am, selecta  wrote:
>
> > > if not gluon.fileutils.check_credentials(request):
> > > redirect(URL(a='admin', c='default', f='index'))
>
> > > Whenever this line is in my code I always get redirected, I have no
> > > idea what to do to avoid that (other than commenting out this line).
>
> > > I access the server from localhost with an normal http request.
>
> > > Please help me.

--

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




[web2py:37202] Re: problem with DAL in shell using 1.74.1

2009-12-14 Thread Jake
On Dec 14, 8:06 pm, mdipierro  wrote:
> Is this the web based shell?
>
Yes, on Windows XP served from localhost with the included web server.

ty
Jake

--

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




[web2py:37201] Re: problem with DAL in shell using 1.74.1

2009-12-14 Thread mdipierro
Is this the web based shell?

On Dec 14, 5:52 pm, Jake  wrote:
> I'm reading through the web2py book (second ed), and i've run into an
> immediate problem using the shell:
>
> ===
> web2py Shell Version 1.74.1 (2009-12-14 10:05:21)
> In[0]:  db = DAL('sqlite://storage.db')
>
> Out[0]:
>
> In[1]:  db.define_table('person', Field('name'))
>
> Out[1]:
>
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "gluon/sql.py", line 1247, in define_table
>   File "gluon/sql.py", line 1663, in _create
>   File "gluon/sql.py", line 887, in 
> ProgrammingError: Cannot operate on a closed database.
> ===
>
> I checked the mailing list, and i see no previous reference to this
> problem.
>
> Thanks a lot!
> Jake

--

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




[web2py:37200] problem with DAL in shell using 1.74.1

2009-12-14 Thread Jake
I'm reading through the web2py book (second ed), and i've run into an
immediate problem using the shell:

===
web2py Shell Version 1.74.1 (2009-12-14 10:05:21)
In[0]:  db = DAL('sqlite://storage.db')

Out[0]:

In[1]:  db.define_table('person', Field('name'))

Out[1]:

Traceback (most recent call last):
  File "", line 1, in 
  File "gluon/sql.py", line 1247, in define_table
  File "gluon/sql.py", line 1663, in _create
  File "gluon/sql.py", line 887, in 
ProgrammingError: Cannot operate on a closed database.
===

I checked the mailing list, and i see no previous reference to this
problem.

Thanks a lot!
Jake

--

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




[web2py:37199] Re: Excess whitespace in html

2009-12-14 Thread mdipierro
I am open tu suggestions. Right now web2py does not introduce any
additional \n. Any new line is already in the original template.

You can do something like this in your controller

def filter(d):
import re
if isinstance(d,dict):
 return re.compile('\n\n').sub('\n',response.render(d))
return d
response._caller=filter

I would not automate it since it is not obvious to me one wants to do
this all the time.

Massimo

On Dec 14, 6:06 pm, kbochert  wrote:
> In a view, I have a paginator with code that looks like:
>
>    
>       {{if ARGS.currentpage == 1:}}
>          
>       {{else:}}
>          Prev
>       {{pass}}
>
>       {{for i in range(1,ARGS.pagecnt+1):}}
>          {{if i == ARGS.currentpage:}}
>             {{=i}}
>          {{else:}}
>             {{=i}}
>          {{pass}}
>       {{pass}}
>       {{if ARGS.currentpage == ARGS.pagecnt:}}
>          Next
>       {{else:}}
>          Next a>
>       {{pass}}
>    
>
> Works great, but the generated html looks like:
>
>   
>
>          Prev
>
>             1
>
>             2
>
>             3
>
>             4
>
>             5
>
>             6
>
>          Next
>
>    
>
> Is there something that can be done to reduce all those empty lines?
> Most of them also start with multiple spaces.
>
> It looks like every '{{...}} construct results in a blank line being
> generated, with its leading spaces. Is it possible that the template
> language processor could be a little smarter about filtering them
> out??

--

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




[web2py:37198] GAE mkdir error

2009-12-14 Thread Richard
I uploaded an app to GAE and it triggered an error from trying to
create a missing directory:

File "/gluon/main.py", line 432, in wsgibase
os.mkdir(path)
AttributeError: 'module' object has no attribute 'mkdir'

I have already run the app locally before uploading, so all the
directories exist.
I am using 1.74.1, and as a temporary solution am catching and
ignoring the exception.

--

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




[web2py:37197] Excess whitespace in html

2009-12-14 Thread kbochert
In a view, I have a paginator with code that looks like:

   
  {{if ARGS.currentpage == 1:}}
 
  {{else:}}
 Prev
  {{pass}}

  {{for i in range(1,ARGS.pagecnt+1):}}
 {{if i == ARGS.currentpage:}}
{{=i}}
 {{else:}}
{{=i}}
 {{pass}}
  {{pass}}
  {{if ARGS.currentpage == ARGS.pagecnt:}}
 Next
  {{else:}}
 Next
  {{pass}}
   

Works great, but the generated html looks like:

  


 Prev




1



2



3



4



5



6



 Next

   


Is there something that can be done to reduce all those empty lines?
Most of them also start with multiple spaces.

It looks like every '{{...}} construct results in a blank line being
generated, with its leading spaces. Is it possible that the template
language processor could be a little smarter about filtering them
out??

--

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




[web2py:37196] Re: check_credentials not working (for me)

2009-12-14 Thread selecta
Ok sorry for the little info
I log into the general admin (http://127.0.0.1:8000/admin/default/
index)
I create an application
I try to edit the database with appadmin.py but it just redirects me
if I do not comment: if not gluon.fileutils.check_credentials
(request): redirect(URL(a='admin', c='default', f='index'))

web2py Version 1.72.3 (2009-11-10 09:17:13)

On Dec 14, 3:27 pm, mdipierro  wrote:
> I am not sure the behavior you experience is wrong. Is this about
> appadmin? Did you try after login in admin? can you show us the
> workflow you experience and what you expect? Which web2py version?
>
> Massimo
>
> On Dec 14, 4:06 am, selecta  wrote:
>
>
>
> > if not gluon.fileutils.check_credentials(request):
> > redirect(URL(a='admin', c='default', f='index'))
>
> > Whenever this line is in my code I always get redirected, I have no
> > idea what to do to avoid that (other than commenting out this line).
>
> > I access the server from localhost with an normal http request.
>
> > Please help me.

--

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




[web2py:37195] Re: How to implement tagging in web2py

2009-12-14 Thread selecta
if you are looking for tagging for multiple users, multiple records I
imporved the basic tagging plugin
http://groups.google.com/group/web2py/browse_thread/thread/4f9dfc4e9c4b5b27/8bc6a5909625e2ac?lnk=gst&q=tagging#8bc6a5909625e2ac
not perfect yet ... like tag clounds don't have links yet but it's a
start

On Dec 14, 9:27 pm, Pystar  wrote:
> Hi ,
> I am developing an app and i would like to implement tagging in it,
> how do i go about it? and is there a plugin for this?
> thanks
> pystar

--

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




[web2py:37194] ldap authentication stopped working: "enter a valid email address"

2009-12-14 Thread Fred
LDAP authentication has been working fine for my apps up through
version 1.72.3.  But when I use 1.73.1 I always get a validation error
on-screen for my username (a.k.a email) input field saying "enter a
valid email address".

I see that the Auth define_tables() function puts the IS_EMAIL
validator on the 'email' field and perhaps that's causing the
problem.  But the same thing was done back in 1.72.3 and it worked
fine.

Possibly related:  In the course of updating my development
environment to 1.73.1 I got the core web2py code from the new
mercurial repository and merged my apps into that.  It's possible that
something in that process causes this LDAP problem but I can't see
how.  I rsync'ed the application folders from my older development
system including all the databases/ folders.)

Anybody have a clue on this?

--

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




Re: [web2py:37193] Re: SQLFORM, no-table, with fieldsets.

2009-12-14 Thread Thadeus Burgess
Take, for example:  http://jeffhowden.com/code/css/forms/

With a form design as such, you can turn it easily into

http://www.jankoatwarpspeed.com/post/2009/09/28/webform-wizard-jquery.aspx

A custom patch seems to be the most appropriate. Create a list, that
represents the form, and use a function to chop through it.

I am playing around with the following

http://pastebin.com/m764d7a39

Basically, it takes a list of lists, each sublist is a fieldset where
if a element is a list it is the fieldset title, and if it is a tuple,
it goes into the notes div.

It formats the form and looks "almost" exactly like the one on the
first link (with the appropriate css. Then using the formtowizard, it
looks nice :)

I am actually happier with this, since I believe allows for the most
customization as far as form content goes.

SQLFORM does need to be refactored into more MVC format I am
thinking of SQLFORM only making the data ready, and performing the
validation, and have a separate class that creates and renders the
form elements.

-Thadeus





On Mon, Dec 14, 2009 at 4:20 PM, DenesL  wrote:
>
> Many moons have passed since I last looked at this but if I remember
> correctly I went for a class that was based on SQLFORM (currently
> sitting in the back burner).
>
> SQLFORM mixes processing and presentation very tightly, which is fine
> for starters but you soon get to a point where you want to keep the
> processing but have a completely different presentation.
>
> My initial approach was the 'custom form' patch which is fine but
> somewhat cumbersome.
> The lastest is CSS based and it would allow easy form customization if
> I can iron out some pending issues. I would love to hear your ideas,
> specially about CSS.
>
> Denes.
>
>
> On Dec 14, 12:51 pm, Thadeus Burgess  wrote:
>> I would like to accomplish the output of the below, but use SQLFORM,
>> and not mess with sqlform.custom.
>>
>> form = FORM(
>>         FIELDSET(
>>             LEGEND("Your Information"),
>>             LABEL("Name:", _for="name"),
>>             INPUT(_name="name"),
>>             LABEL("Email:", _for="email"),
>>             INPUT(_name="email"),
>>             LABEL("Country:", _for="country"),
>>             INPUT(_name="country"),
>>         ),
>>         FIELDSET(
>>             LEGEND("Account Info"),
>>             LABEL("Username:", _for="username"),
>>             INPUT(_name="username"),
>>             LABEL("Password:", _for="password"),
>>             INPUT(_name="password"),
>>             LABEL("Password Again:", _for="passwordrpt"),
>>             INPUT(_name="passwordrpt"),
>>         ),
>>     )
>>
>> I am thinking an interface that allows mixing and matching of DIV
>> based objects and fields.
>> Should I a new form class be created, or a class that uses an existing
>> forms sqlform.custom?
>>
>> Does anyone have any ideas on the best way to implement the functionality?
>>
>> SQLFORM.factory(
>>            FIELDSET(
>>                LEGEND("Your Information"),
>>                db.accounts.name,
>>                db.accounts.email,
>>                db.accounts.country,
>>           ), FIELDSET(
>>                LEGEND("Account Info"),
>>                db.accounts.username,
>>                db.accounts.password,
>>                db.accounts.passwordrpt,
>>          ),
>> )
>>
>> Also on a side note, You can get the same functionality of forms (the
>> table like layout) with pure CSS. I keep wondering why a TABLE was
>> chosen for default forms, since it makes it impossible to style the
>> form **layout** with CSS.
>>
>> -Thadeus
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>
>

--

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




[web2py:37192] Re: SQLFORM, no-table, with fieldsets.

2009-12-14 Thread DenesL

Many moons have passed since I last looked at this but if I remember
correctly I went for a class that was based on SQLFORM (currently
sitting in the back burner).

SQLFORM mixes processing and presentation very tightly, which is fine
for starters but you soon get to a point where you want to keep the
processing but have a completely different presentation.

My initial approach was the 'custom form' patch which is fine but
somewhat cumbersome.
The lastest is CSS based and it would allow easy form customization if
I can iron out some pending issues. I would love to hear your ideas,
specially about CSS.

Denes.


On Dec 14, 12:51 pm, Thadeus Burgess  wrote:
> I would like to accomplish the output of the below, but use SQLFORM,
> and not mess with sqlform.custom.
>
> form = FORM(
> FIELDSET(
> LEGEND("Your Information"),
> LABEL("Name:", _for="name"),
> INPUT(_name="name"),
> LABEL("Email:", _for="email"),
> INPUT(_name="email"),
> LABEL("Country:", _for="country"),
> INPUT(_name="country"),
> ),
> FIELDSET(
> LEGEND("Account Info"),
> LABEL("Username:", _for="username"),
> INPUT(_name="username"),
> LABEL("Password:", _for="password"),
> INPUT(_name="password"),
> LABEL("Password Again:", _for="passwordrpt"),
> INPUT(_name="passwordrpt"),
> ),
> )
>
> I am thinking an interface that allows mixing and matching of DIV
> based objects and fields.
> Should I a new form class be created, or a class that uses an existing
> forms sqlform.custom?
>
> Does anyone have any ideas on the best way to implement the functionality?
>
> SQLFORM.factory(
>FIELDSET(
>LEGEND("Your Information"),
>db.accounts.name,
>db.accounts.email,
>db.accounts.country,
>   ), FIELDSET(
>LEGEND("Account Info"),
>db.accounts.username,
>db.accounts.password,
>db.accounts.passwordrpt,
>  ),
> )
>
> Also on a side note, You can get the same functionality of forms (the
> table like layout) with pure CSS. I keep wondering why a TABLE was
> chosen for default forms, since it makes it impossible to style the
> form **layout** with CSS.
>
> -Thadeus

--

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




[web2py:37191] Re: How to implement tagging in web2py

2009-12-14 Thread Mengu
hi,

i'm recording a screencast on this, hopefully it would be a guide.

On Dec 14, 10:27 pm, Pystar  wrote:
> Hi ,
> I am developing an app and i would like to implement tagging in it,
> how do i go about it? and is there a plugin for this?
> thanks
> pystar

--

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




[web2py:37190] Re: how to use GAE remote api?

2009-12-14 Thread Richard
try adding your application directory to sys.path


On Dec 15, 5:35 am, Dan  wrote:
> I need to do some bulk operations (eg delete) on data in the GAE
> datastore for a web2py application, and was trying to follow the
> example in the GAE docs 
> here:http://code.google.com/appengine/articles/remote_api.html
>
> I can get the console up and running using the suggested
> appengine_console.py code, but am struggling to think of the right
> command to load the web2py application's data model into the console
> session so that I can run queries and work with the data. For example,
> this didn't work:
>
>
>
> >>> import applications.init.models.db
> or
> >>> import models.db
>
> both result in this message:
> ImportError: No module named models.db
>
> What is the proper command? Do I need to create any __init__.py files
> to make it work? Do I need to import some web2py modules first (or
> instead)?
>
> thanks
> Dan

--

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




[web2py:37189] How to implement tagging in web2py

2009-12-14 Thread Pystar
Hi ,
I am developing an app and i would like to implement tagging in it,
how do i go about it? and is there a plugin for this?
thanks
pystar

--

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




Re: [web2py:37188] Re: updated update script

2009-12-14 Thread Jonathan Lundell
On Dec 14, 2009, at 9:22 AM, mdipierro wrote:

> email it to me. Please thank you.

Here you are. I changed the comments to indicate that it should live in the 
parent of web2py/.

I could change it to run as web2py/update-web2py.sh, but that means that it 
gets overwritten while executing, and in my experience that can confuse the 
shell (though I'm not sure exactly why, or under what circumstances, and maybe 
it's not a real problem for a simple script).

I'm thinking of changing it so that it checks to see whether it's running from 
web2py/ or web2py/.. and work regardless. What do you think?

--

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




update-web2py.sh
Description: Binary data


[web2py:37187] Re: ImportError: No module named _scproxy

2009-12-14 Thread mdipierro
If you use GAE you must use Python 2.5. GAE only supports 2.5.

Massimo

On Dec 14, 11:42 am, Felix  wrote:
> Hi,
>     I am trying to deploy web2py on Google App Engine. I followed the
> instructions that were given at this link.http://www.web2py.com/
> AlterEgo/default/show/186. I am getting the following error when I
> tried to run the application in the browser. Can someone please help.
> Thanks
>
>  File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
> urllib.py", line 1334, in 
>     from _scproxy import _get_proxy_settings, _get_proxies
> ImportError: No module named _scproxy

--

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




[web2py:37186] ImportError: No module named _scproxy

2009-12-14 Thread Felix
Hi,
I am trying to deploy web2py on Google App Engine. I followed the
instructions that were given at this link.http://www.web2py.com/
AlterEgo/default/show/186. I am getting the following error when I
tried to run the application in the browser. Can someone please help.
Thanks


 File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/
urllib.py", line 1334, in 
from _scproxy import _get_proxy_settings, _get_proxies
ImportError: No module named _scproxy

--

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




Re: [web2py:37185] Re: web2py 1.74.1 is OUT

2009-12-14 Thread Thadeus Burgess
Also you can specify custom options to the export_to_csv.

export_to_csv(delimiter = ',', quotechar = '"', quoting = csv.QUOTE_MINIMAL)



On Mon, Dec 14, 2009 at 10:46 AM, mdipierro  wrote:
> I fixed it on the web site
>
>
> On Dec 14, 10:35 am, Jonathan Lundell  wrote:
>> On Dec 14, 2009, at 8:33 AM, mdipierro wrote:
>>
>> > - Moved to mercurial
>>
>> http://www.web2py.com/examples/default/downloadstill says SVN.
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>
>

--

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




[web2py:37184] how to use GAE remote api?

2009-12-14 Thread Dan
I need to do some bulk operations (eg delete) on data in the GAE
datastore for a web2py application, and was trying to follow the
example in the GAE docs here:
http://code.google.com/appengine/articles/remote_api.html

I can get the console up and running using the suggested
appengine_console.py code, but am struggling to think of the right
command to load the web2py application's data model into the console
session so that I can run queries and work with the data. For example,
this didn't work:

>>> import applications.init.models.db
or
>>> import models.db

both result in this message:
ImportError: No module named models.db

What is the proper command? Do I need to create any __init__.py files
to make it work? Do I need to import some web2py modules first (or
instead)?

thanks
Dan

--

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




[web2py:37183] Re: Python 2.6 Errata

2009-12-14 Thread Timbo
Note to those reading.  The fix for this bug was applied and release
in 1.74.1

http://groups.google.com/group/web2py/browse_thread/thread/b33cb890cdd0a5a9

-tim

On Dec 4, 9:46 am, mdipierro  wrote:
> Thank you!
>
> On Dec 4, 9:13 am, Timbo  wrote:
>
> > @Alexandre: I understand that you're trying to help.  It's much better
> > to actually fix the broken code than to "fix" the applications.
>
> > @Massimo:  This is very doable.  I'll prepare a patch and email it to
> > you.
>
> > On Dec 3, 5:58 pm, mdipierro  wrote:
>
> > > I am aware of this problem.
>
> > > This is a different behavior in the cgi.FieldStorage object in Python.
>
> > > Please look in web2py.gluon.main how post_vars is filled.
>
> > > I have thought about this a lot and I do not see any way to make this
> > > work in web2py in the same way in 2.5 and 2.6.
>
> > > Massimo
>
> > > On Dec 3, 1:30 pm, Timbo  wrote:
>
> > > > Thinking about it, this is a bug in web2py.
>
> > > > Let me be a little more concrete in my description.  I have a custom
> > > > form that submits to /app/default/entry?id=12.  In the form, there is
> > > > a hidden input tag named "id" with a value of "12".  Upon submission,
> > > > Python 2.5 looks like this:
> > > > request.vars.id = "12"
> > > > request.get_vars.id = "12"
> > > > request.post_vars.id = "12"
>
> > > > Python 2.6 looks like this:
> > > > request.vars.id = ["12", "12"]
> > > > request.get_vars.id = "12"
> > > > request.post_vars.id = ["12", "12"]
>
> > > > And what _should_ happen is this:
> > > > request.vars.id = ["12", "12"]
> > > > request.get_vars.id = "12"
> > > > request.post_vars.id = "12"
>
> > > > Am I making sense?  Massimo, is that expected behavior that we want
> > > > for web2py?
>
> > > > -tim
>
> > > > On Dec 3, 1:17 pm, Timbo  wrote:
>
> > > > > I've been trying to migrate my web2py applications to Python 2.6 and I
> > > > > ran across a nasty bug in Python 2.5 that is fixed in Py2.6, but it
> > > > > amounts to a backward-incompatibility.
>
> > > > > The bug fixed is:http://bugs.python.org/issue3801
>
> > > > > Basically this happens in a POST request where a variable is both in
> > > > > the URL and in the POST body.  It causes that variable to be a list of
> > > > > two (identical) values on Python 2.6.  In Py2.5 however, it will be a
> > > > > single value (the POST body value).
>
> > > > > This is not an issue with web2py at all but perhaps it should be noted
> > > > > somewhere in some documentation about Python 2.6.
>
> > > > > Just so you guys don't spend all the time I did trying to find this.

--

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




[web2py:37182] SQLFORM, no-table, with fieldsets.

2009-12-14 Thread Thadeus Burgess
I would like to accomplish the output of the below, but use SQLFORM,
and not mess with sqlform.custom.

form = FORM(
FIELDSET(
LEGEND("Your Information"),
LABEL("Name:", _for="name"),
INPUT(_name="name"),
LABEL("Email:", _for="email"),
INPUT(_name="email"),
LABEL("Country:", _for="country"),
INPUT(_name="country"),
),
FIELDSET(
LEGEND("Account Info"),
LABEL("Username:", _for="username"),
INPUT(_name="username"),
LABEL("Password:", _for="password"),
INPUT(_name="password"),
LABEL("Password Again:", _for="passwordrpt"),
INPUT(_name="passwordrpt"),
),
)

I am thinking an interface that allows mixing and matching of DIV
based objects and fields.
Should I a new form class be created, or a class that uses an existing
forms sqlform.custom?

Does anyone have any ideas on the best way to implement the functionality?

SQLFORM.factory(
   FIELDSET(
   LEGEND("Your Information"),
   db.accounts.name,
   db.accounts.email,
   db.accounts.country,
  ), FIELDSET(
   LEGEND("Account Info"),
   db.accounts.username,
   db.accounts.password,
   db.accounts.passwordrpt,
 ),
)

Also on a side note, You can get the same functionality of forms (the
table like layout) with pure CSS. I keep wondering why a TABLE was
chosen for default forms, since it makes it impossible to style the
form **layout** with CSS.

-Thadeus

--

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




[web2py:37181] Re: updated update script

2009-12-14 Thread mdipierro
email it to me. Please thank you.

Massimo

On Dec 14, 11:11 am, Jonathan Lundell  wrote:
> Trivial change: remove update logic.
>
> #!/bin/bash
> #
> #  update-web2py.sh
> #  2009-12-14
> #
> #  install as update-web2py.sh and make executable:
> #  chmod +x web2py.sh
> #
> #  save a snapshot of current web2py/ as web2py-version.zip
> #  download the current released version of web2py
> #  unzip downloaded version over web2py/
> #
> TARGET=web2py-vpeps
> read a VERSION c < $TARGET/VERSION
> SAVE=$TARGET-$VERSION
> URL=http://www.web2py.com/examples/static/web2py_src.zip
>
> ZIP=`basename $URL`
> SAVED=""
>
> #  Save a zip archive of the current version,
> #  but don't overwrite a previous save of the same version.
> #
> if [ -f $SAVE.zip ]; then
>         echo "Remove or rename $SAVE.zip first" >&2
>         exit 1
> fi
> if [ -d $TARGET ]; then
>         echo -n ">>Save old version: " >&2
>         cat $TARGET/VERSION >&2
>         zip -q -r $SAVE.zip $TARGET
>         SAVED=$SAVE.zip
> fi
> #
> #  Download the new version.
> #
> echo ">>Download latest web2py release:" >&2
> curl -O $URL
> #
> #  Unzip into web2py/
> #
> unzip -q -o $ZIP
> rm $ZIP
> echo -n ">>New version: " >&2
> cat $TARGET/VERSION >&2
> if [ "$SAVED" != "" ]; then
>         echo ">>Old version saved as $SAVED"
> fi

--

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




[web2py:37180] updated update script

2009-12-14 Thread Jonathan Lundell
Trivial change: remove update logic.

#!/bin/bash
#
#  update-web2py.sh
#  2009-12-14
#
#  install as update-web2py.sh and make executable:
#  chmod +x web2py.sh
#
#  save a snapshot of current web2py/ as web2py-version.zip
#  download the current released version of web2py
#  unzip downloaded version over web2py/
#
TARGET=web2py-vpeps
read a VERSION c < $TARGET/VERSION
SAVE=$TARGET-$VERSION
URL=http://www.web2py.com/examples/static/web2py_src.zip

ZIP=`basename $URL`
SAVED=""

#  Save a zip archive of the current version,
#  but don't overwrite a previous save of the same version.
#
if [ -f $SAVE.zip ]; then
echo "Remove or rename $SAVE.zip first" >&2
exit 1
fi
if [ -d $TARGET ]; then
echo -n ">>Save old version: " >&2
cat $TARGET/VERSION >&2
zip -q -r $SAVE.zip $TARGET
SAVED=$SAVE.zip
fi
#
#  Download the new version.
#
echo ">>Download latest web2py release:" >&2
curl -O $URL
#
#  Unzip into web2py/
#
unzip -q -o $ZIP
rm $ZIP
echo -n ">>New version: " >&2
cat $TARGET/VERSION >&2
if [ "$SAVED" != "" ]; then
echo ">>Old version saved as $SAVED"
fi

--

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




[web2py:37179] Re: web2py 1.74.1 is OUT

2009-12-14 Thread mdipierro
I fixed it on the web site


On Dec 14, 10:35 am, Jonathan Lundell  wrote:
> On Dec 14, 2009, at 8:33 AM, mdipierro wrote:
>
> > - Moved to mercurial
>
> http://www.web2py.com/examples/default/downloadstill says SVN.

--

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




Re: [web2py:37178] web2py 1.74.1 is OUT

2009-12-14 Thread Jonathan Lundell
On Dec 14, 2009, at 8:33 AM, mdipierro wrote:

> - Moved to mercurial

http://www.web2py.com/examples/default/download still says SVN.

--

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




[web2py:37177] web2py 1.74.1 is OUT

2009-12-14 Thread mdipierro
New features:
- Moved to mercurial
- Default validators use the new define_table(,format='...')
- New get_vars and post_vars compatible in 2.5 and 2.6 (thanks Tim)
- Major rewrite of gql.py extends DAL syntax on GAE, supports belongs
- No more *.w2p, welcome.w2p is create automatically, base apps are
always upgrade
- decimal validator allow negative numbers

1.74.* is the last version with the old DAL. The new DAL is in gluon/
dal.py. To try out the new experimenatal DAL do

cp gluon/dal.py gluon/sql.py

Please report any problem.

Massimo

--

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




[web2py:37176] Re: CRYTICAL: Contributor Agreement

2009-12-14 Thread mdipierro
You have to put the name of the company only of it is the company that
is contributing and you are signing on behalf of the company. If this
is your contribution, there is no need to say who your employer is. If
this is good enough for SUN, it must be good enough for us.

Massimo

On Dec 14, 10:18 am, Wes James  wrote:
> Here are some examples of how django and plone do this:
>
> http://plone.org/foundation/contributors-agreement/agreement.pdf/viewhttp://www.djangoproject.com/foundation/cla/
>
> Do you need to request more specific permissions by the company if it
> is done on company time?  I'm not sure if just putting down the
> company name on the web2py form is sufficient.
>
> -wes
>
> On Fri, Dec 11, 2009 at 9:45 AM, mdipierro  wrote:
> > If you are a web2py contributor or wish to be one, please sign this
> > contract:
>
> >    http://www.web2py.com/examples/static/agreement.pdf
>
> > Only contributors who have signed this contract will be listed as
> > "official" contributors.
> > I will no longer accept major patches from users who have not signed
> > the agreement.
>
> > Let me explain why this is. It has be brought to my attention that
> > some of you may have signed an employment contract with a third party
> > that prevents contribution to an Open Source project and your employer
> > owns every line of code you write. I hope this is not the case and I
> > probably it is not legal but I got worried. This situation could
> > create some trouble for web2py and result in undesirable expenses.
>
> > The contract 1) protects web2py freedom by stating that you created
> > the code you contribute to and no one third party owns the copyright
> > on it; 2) gives you the right to re-use the code you contribute to
> > web2py in an way you see fit.
>
> > This contract is very standard and modeled after the a similar
> > contributor agreement from SUN.
>
> > Massimo
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.
>
>

--

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




Re: [web2py:37175] CRYTICAL: Contributor Agreement

2009-12-14 Thread Wes James
Here are some examples of how django and plone do this:

http://plone.org/foundation/contributors-agreement/agreement.pdf/view
http://www.djangoproject.com/foundation/cla/

Do you need to request more specific permissions by the company if it
is done on company time?  I'm not sure if just putting down the
company name on the web2py form is sufficient.

-wes


On Fri, Dec 11, 2009 at 9:45 AM, mdipierro  wrote:
> If you are a web2py contributor or wish to be one, please sign this
> contract:
>
>    http://www.web2py.com/examples/static/agreement.pdf
>
> Only contributors who have signed this contract will be listed as
> "official" contributors.
> I will no longer accept major patches from users who have not signed
> the agreement.
>
> Let me explain why this is. It has be brought to my attention that
> some of you may have signed an employment contract with a third party
> that prevents contribution to an Open Source project and your employer
> owns every line of code you write. I hope this is not the case and I
> probably it is not legal but I got worried. This situation could
> create some trouble for web2py and result in undesirable expenses.
>
> The contract 1) protects web2py freedom by stating that you created
> the code you contribute to and no one third party owns the copyright
> on it; 2) gives you the right to re-use the code you contribute to
> web2py in an way you see fit.
>
> This contract is very standard and modeled after the a similar
> contributor agreement from SUN.
>
> Massimo
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>
>

--

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




Re: [web2py:37174] Re: Oddity with crm applicance (?)

2009-12-14 Thread Miguel Lopes
On Mon, Dec 14, 2009 at 4:14 PM, mdipierro  wrote:
> I just saw the effect and reminded of a similar problem in the past.

Txs for the help. I was going nuts!
Miguel

--

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




[web2py:37173] Re: Oddity with crm applicance (?)

2009-12-14 Thread mdipierro
I just saw the effect and reminded of a similar problem in the past.

On Dec 14, 10:03 am, Miguel Lopes  wrote:
> Thanks for the help and solution!
> How did you manage to see the difference in the call? I can see it
> using Firebug?
>
> I will post it on the group for the benefit of others.
> br,
> Miguel
>
> On Mon, Dec 14, 2009 at 3:56 PM, mdipierro  wrote:
> > Thanks for sending me the screenshots. Now I see the problem:
>
> >    search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
> > ['keyword'], 'target_div');")
>
> > should be
>
> >    search_input=INPUT(_id='keyword', _onkeyup="ajax('%s',['keyword'],
> > 'target_div');" % URL(r=request,f='bg_find'))
>
> > else it interprets the URL as a relative url and does not call the
> > db_find function.
>
> > On Dec 14, 9:28 am, mdipierro  wrote:
> >> I am sorry I misunderstood the problem. The {{extend 'layout.html'}}
> >> goes in the master page, the one doing the ajax call.
>
> >> I still do not understand the problem. I tried you code and it worked
> >> as I would expect, no page in page.
> >> Can you send me a screenshot?
>
> >> Massimo
>
> >> On Dec 14, 8:58 am, Miguel Lopes  wrote:
>
> >> > On Mon, Dec 14, 2009 at 2:41 PM, mdipierro  
> >> > wrote:
> >> > > The page has layout. pieces of the page loadad via ajax do not need to
> >> > > declare {{extend 'layout.hml'}} but they do have automatically the
> >> > > same look and feel because they are embedded in the same page that has
> >> > > the layout.
>
> >> > I have no page associated with the ajax call. The call is issued to a
> >> > function (a.k.a. action) that as no template associated with it:
> >> > @auth.requires_login()
> >> > def bg_find():
> >> >    return P('Hello')
>
> >> > The page that calls the "layout piece" to be loaded via ajax
> >> > faithfully reproduces what is on the book's wiki example. This is the
> >> > default/list_results.html (that I mistakenly named
> >> > default/results.html in my first email):
> >> > {{extend 'layout.html'}}
>
> >> > Results
> >> > {{=search_input}} 
> >> > {{=target_div}}
>
> >> > The function associated with this page also mirrors the example in the 
> >> > book:
> >> > @auth.requires_login()
> >> > def list_results():
> >> >    search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
> >> > ['keyword'], 'target_div');")
> >> >    target_div=DIV(_id='target_div')
> >> >    return dict(search_input=search_input, target_div=target_div)
>
> >> > I'm sorry if I'm missing something obvious, but I'm, not seeing it.
> >> > Miguel
>
> >> > > On Dec 14, 8:37 am, Miguel Lopes  wrote:
> >> > >> On Mon, Dec 14, 2009 at 2:29 PM, mdipierro  
> >> > >> wrote:
> >> > >> > The view of the action served via ajax should NOT {{extend
> >> > >> > 'layout.html'}}.
>
> >> > >> I suppose / expect this is only the case with the crm appliance?
> >> > >> And, that the wiki example provided in the book correctly extends
> >> > >> layout, as if this is not the case how is it possible to benefit from
> >> > >> templating in the context of ajax calls?
>
> >> > >> Miguel
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.
>
>

--

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




[web2py:37172] Re: HELP with new DAL

2009-12-14 Thread mdipierro
For now I have reverted trunk to the old DAL. The new DAL has moved in
dal.py.
I will post this as 1.74.1 stable since there are some old fixes
collected over time.
If you want to test the new DAL do

   cp gluon/dal.py gluon/sql.py

Completing the new DAL will take another week or two probably.
1.74.* will be the last release with the old DAL.

About the problem below with SQLCustomType. SQLCustomType does not
work well with the new DAL and it may go completely away in favor of a
better API for custom types. I will not enforce backward compatibility
on custom types since it was never officially documented. It was
implemented as a quick hack to solve some immediate needs.

If you oppose and think SQLCustomType should remain backward
compatible please tell us know.

Massimo

On Dec 14, 9:59 am, Fran  wrote:
> On Dec 13, 5:27 am, mdipierro  wrote:
>
> > I am rewriting the DAL to make more modular. 75% is done and it is in
> > trunk.
> > Please take a look. I need one official tester for each supported
> > database backend (except sqlite since I can do that)
>
> Am using sqlite with r1455, the below code breaks when trying to
> insert a new record:
> Traceback (most recent call last):
>   File "C:\Bin\web2py\gluon\restricted.py", line 173, in restricted
>     exec ccode in environment
>   File "C:/Bin/web2py/applications/sahana/models/zzz_1st_run.py", line
> 17, in 
>     theme = 1
>   File "C:\Bin\web2py\gluon\sql.py", line 1890, in insert
>     self._db._adapter.execute(query)
>   File "C:\Bin\web2py\gluon\sql.py", line 202, in execute
>     return self.cursor.execute(*a, **b)
> IntegrityError: s3_setting.uuid may not be NULL
>
> # Reusable UUID field (needed as part of database synchronization)
> import uuid
> from gluon.sql import SQLCustomType
> s3uuid = SQLCustomType(
>                 type = 'string',
>                 native = 'VARCHAR(64)',
>                 encoder = (lambda x: "'%s'" % (uuid.uuid4() if x==""
> else str(x).replace("'", "''"))),
>                 decoder = (lambda x: x)
>             )
>
> uuidstamp = db.Table(None, 'uuidstamp',
>                      Field('uuid',
>                           type=s3uuid,
>                           length=64,
>                           notnull=True,
>                           unique=True,
>                           readable=False,
>                           writable=False,
>                           default=""))
>
> F

--

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




[web2py:37171] Re: HELP with new DAL

2009-12-14 Thread Fran
On Dec 13, 5:27 am, mdipierro  wrote:
> Comments are appreciated. Hope this is going in the direction that
> people expect.

Yes, I like the idea of this :)

I am keen to add some support for spatial queriesusing spatial
functions where supported at the back-end (PostGIS & Spatialite), but
falling back to std RDBMS queries (slow) where spatial support isn't
native.
Seems like we can add the default RDBMS code to the BaseAdapter & then
add spatial functions within the specialised versions.
NB Don't expect quick results on this as have many other priorities ;)

F

--

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




Re: [web2py:37170] Re: Oddity with crm applicance (?)

2009-12-14 Thread Miguel Lopes
Thanks for the help and solution!
How did you manage to see the difference in the call? I can see it
using Firebug?

I will post it on the group for the benefit of others.
br,
Miguel


On Mon, Dec 14, 2009 at 3:56 PM, mdipierro  wrote:
> Thanks for sending me the screenshots. Now I see the problem:
>
>    search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
> ['keyword'], 'target_div');")
>
> should be
>
>    search_input=INPUT(_id='keyword', _onkeyup="ajax('%s',['keyword'],
> 'target_div');" % URL(r=request,f='bg_find'))
>
> else it interprets the URL as a relative url and does not call the
> db_find function.
>
> On Dec 14, 9:28 am, mdipierro  wrote:
>> I am sorry I misunderstood the problem. The {{extend 'layout.html'}}
>> goes in the master page, the one doing the ajax call.
>>
>> I still do not understand the problem. I tried you code and it worked
>> as I would expect, no page in page.
>> Can you send me a screenshot?
>>
>> Massimo
>>
>> On Dec 14, 8:58 am, Miguel Lopes  wrote:
>>
>> > On Mon, Dec 14, 2009 at 2:41 PM, mdipierro  wrote:
>> > > The page has layout. pieces of the page loadad via ajax do not need to
>> > > declare {{extend 'layout.hml'}} but they do have automatically the
>> > > same look and feel because they are embedded in the same page that has
>> > > the layout.
>>
>> > I have no page associated with the ajax call. The call is issued to a
>> > function (a.k.a. action) that as no template associated with it:
>> > @auth.requires_login()
>> > def bg_find():
>> >    return P('Hello')
>>
>> > The page that calls the "layout piece" to be loaded via ajax
>> > faithfully reproduces what is on the book's wiki example. This is the
>> > default/list_results.html (that I mistakenly named
>> > default/results.html in my first email):
>> > {{extend 'layout.html'}}
>>
>> > Results
>> > {{=search_input}} 
>> > {{=target_div}}
>>
>> > The function associated with this page also mirrors the example in the 
>> > book:
>> > @auth.requires_login()
>> > def list_results():
>> >    search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
>> > ['keyword'], 'target_div');")
>> >    target_div=DIV(_id='target_div')
>> >    return dict(search_input=search_input, target_div=target_div)
>>
>> > I'm sorry if I'm missing something obvious, but I'm, not seeing it.
>> > Miguel
>>
>> > > On Dec 14, 8:37 am, Miguel Lopes  wrote:
>> > >> On Mon, Dec 14, 2009 at 2:29 PM, mdipierro  
>> > >> wrote:
>> > >> > The view of the action served via ajax should NOT {{extend
>> > >> > 'layout.html'}}.
>>
>> > >> I suppose / expect this is only the case with the crm appliance?
>> > >> And, that the wiki example provided in the book correctly extends
>> > >> layout, as if this is not the case how is it possible to benefit from
>> > >> templating in the context of ajax calls?
>>
>> > >> Miguel
>>
>>
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to 
> web2py+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>
>

--

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




[web2py:37169] Re: HELP with new DAL

2009-12-14 Thread Fran
On Dec 13, 5:27 am, mdipierro  wrote:
> I am rewriting the DAL to make more modular. 75% is done and it is in
> trunk.
> Please take a look. I need one official tester for each supported
> database backend (except sqlite since I can do that)

Am using sqlite with r1455, the below code breaks when trying to
insert a new record:
Traceback (most recent call last):
  File "C:\Bin\web2py\gluon\restricted.py", line 173, in restricted
exec ccode in environment
  File "C:/Bin/web2py/applications/sahana/models/zzz_1st_run.py", line
17, in 
theme = 1
  File "C:\Bin\web2py\gluon\sql.py", line 1890, in insert
self._db._adapter.execute(query)
  File "C:\Bin\web2py\gluon\sql.py", line 202, in execute
return self.cursor.execute(*a, **b)
IntegrityError: s3_setting.uuid may not be NULL




# Reusable UUID field (needed as part of database synchronization)
import uuid
from gluon.sql import SQLCustomType
s3uuid = SQLCustomType(
type = 'string',
native = 'VARCHAR(64)',
encoder = (lambda x: "'%s'" % (uuid.uuid4() if x==""
else str(x).replace("'", "''"))),
decoder = (lambda x: x)
)

uuidstamp = db.Table(None, 'uuidstamp',
 Field('uuid',
  type=s3uuid,
  length=64,
  notnull=True,
  unique=True,
  readable=False,
  writable=False,
  default=""))

F

--

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




[web2py:37168] Re: Oddity with crm applicance (?)

2009-12-14 Thread mdipierro
Thanks for sending me the screenshots. Now I see the problem:

search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
['keyword'], 'target_div');")

should be

search_input=INPUT(_id='keyword', _onkeyup="ajax('%s',['keyword'],
'target_div');" % URL(r=request,f='bg_find'))

else it interprets the URL as a relative url and does not call the
db_find function.

On Dec 14, 9:28 am, mdipierro  wrote:
> I am sorry I misunderstood the problem. The {{extend 'layout.html'}}
> goes in the master page, the one doing the ajax call.
>
> I still do not understand the problem. I tried you code and it worked
> as I would expect, no page in page.
> Can you send me a screenshot?
>
> Massimo
>
> On Dec 14, 8:58 am, Miguel Lopes  wrote:
>
> > On Mon, Dec 14, 2009 at 2:41 PM, mdipierro  wrote:
> > > The page has layout. pieces of the page loadad via ajax do not need to
> > > declare {{extend 'layout.hml'}} but they do have automatically the
> > > same look and feel because they are embedded in the same page that has
> > > the layout.
>
> > I have no page associated with the ajax call. The call is issued to a
> > function (a.k.a. action) that as no template associated with it:
> > @auth.requires_login()
> > def bg_find():
> >    return P('Hello')
>
> > The page that calls the "layout piece" to be loaded via ajax
> > faithfully reproduces what is on the book's wiki example. This is the
> > default/list_results.html (that I mistakenly named
> > default/results.html in my first email):
> > {{extend 'layout.html'}}
>
> > Results
> > {{=search_input}} 
> > {{=target_div}}
>
> > The function associated with this page also mirrors the example in the book:
> > @auth.requires_login()
> > def list_results():
> >    search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
> > ['keyword'], 'target_div');")
> >    target_div=DIV(_id='target_div')
> >    return dict(search_input=search_input, target_div=target_div)
>
> > I'm sorry if I'm missing something obvious, but I'm, not seeing it.
> > Miguel
>
> > > On Dec 14, 8:37 am, Miguel Lopes  wrote:
> > >> On Mon, Dec 14, 2009 at 2:29 PM, mdipierro  
> > >> wrote:
> > >> > The view of the action served via ajax should NOT {{extend
> > >> > 'layout.html'}}.
>
> > >> I suppose / expect this is only the case with the crm appliance?
> > >> And, that the wiki example provided in the book correctly extends
> > >> layout, as if this is not the case how is it possible to benefit from
> > >> templating in the context of ajax calls?
>
> > >> Miguel
>
>

--

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




[web2py:37167] Re: HELP with new DAL

2009-12-14 Thread Yarko Tymciurak
On Dec 14, 5:51 am, DenesL  wrote:
> About uploads folder, is the problem that hg does not allow empty
> folders?
> None of the apps in the hg repository (including welcome) have an
> uploads folder.
>
... the problem is that web2py assumed the existence of these folders,
and did not handle it if they didn't because it depended on them being
there.

bzr & svn version empty folders;
cvs, hg, git (and many, many others) do not - historically,
directories are not typically "first class" objects in version control
systems.

Right now, Massimo's solution is to brute force this (just creates all
these directories in gluon/main.py); a more general "open" procedure
which collects all special handling of file opening / file creation
would be better, robust.   As it is web2py is back-filling its old
assumptions.

- Yarko

--

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




[web2py:37166] Re: HELP with new DAL

2009-12-14 Thread DenesL
represent_exception is not called:

Traceback (most recent call last):
  File "C:\web2py\hg\gluon\restricted.py", line 173, in restricted
exec ccode in environment
  File "C:/web2py/hg/applications/nav3/controllers/appadmin.py", line
305, in 
  File "C:\web2py\hg\gluon\globals.py", line 96, in 
self._caller = lambda f: f()
  File "C:/web2py/hg/applications/nav3/controllers/appadmin.py", line
124, in insert
if form.accepts(request.vars, session):
  File "C:\web2py\hg\gluon\sqlhtml.py", line 898, in accepts
self.vars.id = self.table.insert(**fields)
  File "C:\web2py\hg\gluon\sql.py", line 1891, in insert
self._db._adapter.execute(query)
  File "C:\web2py\hg\gluon\sql.py", line 202, in execute
return self.cursor.execute(*a, **b)
DataError: ('22018', "[22018] [Microsoft][ODBC SQL Server Driver][SQL
Server]Conversion failed when converting the varchar value 'T' to data
type bit. (245) (SQLExecDirectW)")


On Dec 14, 9:39 am, mdipierro  wrote:
> Can you reproduce this with the latest trunk? Is
> SQLAdapter.represent_exception being called? What does it return?
>
> On Dec 14, 5:51 am, DenesL  wrote:
>
> > About uploads folder, is the problem that hg does not allow empty
> > folders?
> > None of the apps in the hg repository (including welcome) have an
> > uploads folder.
>
> > With rev.30:
>
> > Traceback (most recent call last):
> >   File "C:\web2py\hg\gluon\restricted.py", line 173, in restricted
> > exec ccode in environment
> >   File "C:/web2py/hg/applications/w3/controllers/appadmin.py", line
> > 304, in 
> >   File "C:\web2py\hg\gluon\globals.py", line 96, in 
> > self._caller = lambda f: f()
> >   File "C:/web2py/hg/applications/w3/controllers/appadmin.py", line
> > 124, in insert
> > if form.accepts(request.vars, session):
> >   File "C:\web2py\hg\gluon\sqlhtml.py", line 898, in accepts
> > self.vars.id = self.table.insert(**fields)
> >   File "C:\web2py\hg\gluon\sql.py", line 1875, in insert
> > self._db._adapter.execute(query)
> >   File "C:\web2py\hg\gluon\sql.py", line 187, in execute
> > return self.cursor.execute(*a, **b)
> > DataError: ('22018', "[22018] [Microsoft][ODBC SQL Server Driver][SQL
> > Server]Conversion failed when converting the varchar value 'T' to data
> > type bit. (245) (SQLExecDirectW)")
>
> > On Dec 14, 12:59 am, mdipierro  wrote:
>
> > > I think I fixed the two problems in trunk. Please give it a try.
>
> > > For everybody else on these lists... these problems reported in this
> > > thread refer to testing the new DAL in trunk. It is a major rewrite.
> > > We are testing is step by step. None of these problems affect the old
> > > DAL in stable.
>
> > > Massimo

--

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




[web2py:37165] Re: HELP with new DAL

2009-12-14 Thread DenesL
That one seems fixed, but on insert:

Traceback (most recent call last):
  File "C:\web2py\hg\gluon\restricted.py", line 173, in restricted
exec ccode in environment
  File "C:/web2py/hg/applications/nav3/controllers/appadmin.py", line
305, in 
  File "C:\web2py\hg\gluon\globals.py", line 96, in 
self._caller = lambda f: f()
  File "C:/web2py/hg/applications/nav3/controllers/appadmin.py", line
124, in insert
if form.accepts(request.vars, session):
  File "C:\web2py\hg\gluon\sqlhtml.py", line 898, in accepts
self.vars.id = self.table.insert(**fields)
  File "C:\web2py\hg\gluon\sql.py", line 1890, in insert
self._db._adapter.execute(query)
  File "C:\web2py\hg\gluon\sql.py", line 969, in execute
return self.cursor.execute(command)
DataError: ('22008', '[22008] [IBM][iSeries Access ODBC Driver][DB2
UDB]SQL0180 - Syntax of date, time, or timestamp value not valid.
(-180) (SQLExecDirectW)')

On Dec 14, 9:39 am, mdipierro  wrote:
> This I fixed, please try again. Thanks Denes. Your tests help a lot.
>
> On Dec 14, 8:27 am, DenesL  wrote:
>
> > Also, testing DB2:
>
> > Traceback (most recent call last):
> >   File "C:\web2py\hg\gluon\restricted.py", line 173, in restricted
> > exec ccode in environment
> >   File "C:/web2py/hg/applications/nav3/models/db.py", line 5, in
> > 
> > dot4=SQLDB('db2:DSN=dot4;UID=web2py;PWD=xxx')
> >   File "C:\web2py\hg\gluon\sql.py", line 1301, in __init__
> > self._adapter = ADAPTERS[self._dbname]
> > (uri,pool_size,folder,db_codec)
> >   File "C:\web2py\hg\gluon\sql.py", line 949, in __init__
> > cnxn = self._uri.split(':', 1)[1]
> > AttributeError: 'DB2Adapter' object has no attribute '_uri'

--

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




[web2py:37164] Re: Oddity with crm applicance (?)

2009-12-14 Thread mdipierro
I am sorry I misunderstood the problem. The {{extend 'layout.html'}}
goes in the master page, the one doing the ajax call.

I still do not understand the problem. I tried you code and it worked
as I would expect, no page in page.
Can you send me a screenshot?

Massimo

On Dec 14, 8:58 am, Miguel Lopes  wrote:
> On Mon, Dec 14, 2009 at 2:41 PM, mdipierro  wrote:
> > The page has layout. pieces of the page loadad via ajax do not need to
> > declare {{extend 'layout.hml'}} but they do have automatically the
> > same look and feel because they are embedded in the same page that has
> > the layout.
>
> I have no page associated with the ajax call. The call is issued to a
> function (a.k.a. action) that as no template associated with it:
> @auth.requires_login()
> def bg_find():
>    return P('Hello')
>
> The page that calls the "layout piece" to be loaded via ajax
> faithfully reproduces what is on the book's wiki example. This is the
> default/list_results.html (that I mistakenly named
> default/results.html in my first email):
> {{extend 'layout.html'}}
>
> Results
> {{=search_input}} 
> {{=target_div}}
>
> The function associated with this page also mirrors the example in the book:
> @auth.requires_login()
> def list_results():
>    search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
> ['keyword'], 'target_div');")
>    target_div=DIV(_id='target_div')
>    return dict(search_input=search_input, target_div=target_div)
>
> I'm sorry if I'm missing something obvious, but I'm, not seeing it.
> Miguel
>
>
>
> > On Dec 14, 8:37 am, Miguel Lopes  wrote:
> >> On Mon, Dec 14, 2009 at 2:29 PM, mdipierro  wrote:
> >> > The view of the action served via ajax should NOT {{extend
> >> > 'layout.html'}}.
>
> >> I suppose / expect this is only the case with the crm appliance?
> >> And, that the wiki example provided in the book correctly extends
> >> layout, as if this is not the case how is it possible to benefit from
> >> templating in the context of ajax calls?
>
> >> Miguel
>
>

--

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




Re: [web2py:37163] Re: Oddity with crm applicance (?)

2009-12-14 Thread Miguel Lopes
On Mon, Dec 14, 2009 at 2:41 PM, mdipierro  wrote:
> The page has layout. pieces of the page loadad via ajax do not need to
> declare {{extend 'layout.hml'}} but they do have automatically the
> same look and feel because they are embedded in the same page that has
> the layout.

I have no page associated with the ajax call. The call is issued to a
function (a.k.a. action) that as no template associated with it:
@auth.requires_login()
def bg_find():
   return P('Hello')

The page that calls the "layout piece" to be loaded via ajax
faithfully reproduces what is on the book's wiki example. This is the
default/list_results.html (that I mistakenly named
default/results.html in my first email):
{{extend 'layout.html'}}

Results
{{=search_input}} 
{{=target_div}}

The function associated with this page also mirrors the example in the book:
@auth.requires_login()
def list_results():
   search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
['keyword'], 'target_div');")
   target_div=DIV(_id='target_div')
   return dict(search_input=search_input, target_div=target_div)

I'm sorry if I'm missing something obvious, but I'm, not seeing it.
Miguel

>
> On Dec 14, 8:37 am, Miguel Lopes  wrote:
>> On Mon, Dec 14, 2009 at 2:29 PM, mdipierro  wrote:
>> > The view of the action served via ajax should NOT {{extend
>> > 'layout.html'}}.
>>
>> I suppose / expect this is only the case with the crm appliance?
>> And, that the wiki example provided in the book correctly extends
>> layout, as if this is not the case how is it possible to benefit from
>> templating in the context of ajax calls?
>>
>> Miguel
>

--

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




[web2py:37162] Re: Oddity with crm applicance (?)

2009-12-14 Thread mdipierro
The page has layout. pieces of the page loadad via ajax do not need to
declare {{extend 'layout.hml'}} but they do have automatically the
same look and feel because they are embedded in the same page that has
the layout.


On Dec 14, 8:37 am, Miguel Lopes  wrote:
> On Mon, Dec 14, 2009 at 2:29 PM, mdipierro  wrote:
> > The view of the action served via ajax should NOT {{extend
> > 'layout.html'}}.
>
> I suppose / expect this is only the case with the crm appliance?
> And, that the wiki example provided in the book correctly extends
> layout, as if this is not the case how is it possible to benefit from
> templating in the context of ajax calls?
>
> Miguel

--

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




[web2py:37161] Re: HELP with new DAL

2009-12-14 Thread mdipierro
This I fixed, please try again. Thanks Denes. Your tests help a lot.

On Dec 14, 8:27 am, DenesL  wrote:
> Also, testing DB2:
>
> Traceback (most recent call last):
>   File "C:\web2py\hg\gluon\restricted.py", line 173, in restricted
>     exec ccode in environment
>   File "C:/web2py/hg/applications/nav3/models/db.py", line 5, in
> 
>     dot4=SQLDB('db2:DSN=dot4;UID=web2py;PWD=xxx')
>   File "C:\web2py\hg\gluon\sql.py", line 1301, in __init__
>     self._adapter = ADAPTERS[self._dbname]
> (uri,pool_size,folder,db_codec)
>   File "C:\web2py\hg\gluon\sql.py", line 949, in __init__
>     cnxn = self._uri.split(':', 1)[1]
> AttributeError: 'DB2Adapter' object has no attribute '_uri'

--

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




[web2py:37160] Re: HELP with new DAL

2009-12-14 Thread mdipierro
Can you reproduce this with the latest trunk? Is
SQLAdapter.represent_exception being called? What does it return?



On Dec 14, 5:51 am, DenesL  wrote:
> About uploads folder, is the problem that hg does not allow empty
> folders?
> None of the apps in the hg repository (including welcome) have an
> uploads folder.
>
> With rev.30:
>
> Traceback (most recent call last):
>   File "C:\web2py\hg\gluon\restricted.py", line 173, in restricted
>     exec ccode in environment
>   File "C:/web2py/hg/applications/w3/controllers/appadmin.py", line
> 304, in 
>   File "C:\web2py\hg\gluon\globals.py", line 96, in 
>     self._caller = lambda f: f()
>   File "C:/web2py/hg/applications/w3/controllers/appadmin.py", line
> 124, in insert
>     if form.accepts(request.vars, session):
>   File "C:\web2py\hg\gluon\sqlhtml.py", line 898, in accepts
>     self.vars.id = self.table.insert(**fields)
>   File "C:\web2py\hg\gluon\sql.py", line 1875, in insert
>     self._db._adapter.execute(query)
>   File "C:\web2py\hg\gluon\sql.py", line 187, in execute
>     return self.cursor.execute(*a, **b)
> DataError: ('22018', "[22018] [Microsoft][ODBC SQL Server Driver][SQL
> Server]Conversion failed when converting the varchar value 'T' to data
> type bit. (245) (SQLExecDirectW)")
>
> On Dec 14, 12:59 am, mdipierro  wrote:
>
> > I think I fixed the two problems in trunk. Please give it a try.
>
> > For everybody else on these lists... these problems reported in this
> > thread refer to testing the new DAL in trunk. It is a major rewrite.
> > We are testing is step by step. None of these problems affect the old
> > DAL in stable.
>
> > Massimo
>
>

--

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




Re: [web2py:37159] Re: Oddity with crm applicance (?)

2009-12-14 Thread Miguel Lopes
On Mon, Dec 14, 2009 at 2:29 PM, mdipierro  wrote:
> The view of the action served via ajax should NOT {{extend
> 'layout.html'}}.

I suppose / expect this is only the case with the crm appliance?
And, that the wiki example provided in the book correctly extends
layout, as if this is not the case how is it possible to benefit from
templating in the context of ajax calls?

Miguel

--

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




[web2py:37158] Re: Oddity with crm applicance (?)

2009-12-14 Thread mdipierro
The view of the action served via ajax should NOT {{extend
'layout.html'}}.

On Dec 14, 6:58 am, Miguel Lopes  wrote:
> I'm posting this reluctantly, because I would expect to be doing
> something wrong. However I can't figure out what is wrong.
>
> Playing around with the CRM appliance I introduced a simple ajax
> search. Strangely the target div gets loaded with a copy of the entire
> page.
> My view is as simple as it could get (I didn't mess with layout.html):
> default/results.html
>
> {{extend 'layout.html'}}
>
> Results
> {{=search_input}} 
> {{=target_div}}
>
> The functions as well:
> @auth.requires_login()
> def list_results():
>     search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
> ['keyword'], 'target_div');")
>     target_div=DIV(_id='target_div')
>     return dict(search_input=search_input, target_div=target_div)
>
> @auth.requires_login()
> def bg_find():
>     return P('Hello')
>
> The problem shows both in Firefox and Safari.
> web2py Version 1.72.3 (2009-11-10 09:17:13)
>
> Txs,
> Miguel

--

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




[web2py:37157] Re: HELP with new DAL

2009-12-14 Thread DenesL

Also, testing DB2:

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

dot4=SQLDB('db2:DSN=dot4;UID=web2py;PWD=xxx')
  File "C:\web2py\hg\gluon\sql.py", line 1301, in __init__
self._adapter = ADAPTERS[self._dbname]
(uri,pool_size,folder,db_codec)
  File "C:\web2py\hg\gluon\sql.py", line 949, in __init__
cnxn = self._uri.split(':', 1)[1]
AttributeError: 'DB2Adapter' object has no attribute '_uri'

--

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




[web2py:37156] Re: check_credentials not working (for me)

2009-12-14 Thread mdipierro
I am not sure the behavior you experience is wrong. Is this about
appadmin? Did you try after login in admin? can you show us the
workflow you experience and what you expect? Which web2py version?

Massimo

On Dec 14, 4:06 am, selecta  wrote:
> if not gluon.fileutils.check_credentials(request):
> redirect(URL(a='admin', c='default', f='index'))
>
> Whenever this line is in my code I always get redirected, I have no
> idea what to do to avoid that (other than commenting out this line).
>
> I access the server from localhost with an normal http request.
>
> Please help me.

--

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




[web2py:37155] Re: Oddity with crm applicance (?)

2009-12-14 Thread Miguel Lopes
On Mon, Dec 14, 2009 at 12:58 PM, Miguel Lopes  wrote:
> I'm posting this reluctantly, because I would expect to be doing
> something wrong. However I can't figure out what is wrong.
>
> Playing around with the CRM appliance I introduced a simple ajax
> search. Strangely the target div gets loaded with a copy of the entire
> page.
> My view is as simple as it could get (I didn't mess with layout.html):
> default/results.html
>
> {{extend 'layout.html'}}
>
> Results
> {{=search_input}} 
> {{=target_div}}
>
> The functions as well:
> @auth.requires_login()
> def list_results():
>    search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
> ['keyword'], 'target_div');")
>    target_div=DIV(_id='target_div')
>    return dict(search_input=search_input, target_div=target_div)
>
> @auth.requires_login()
> def bg_find():
>    return P('Hello')
>
> The problem shows both in Firefox and Safari.
> web2py Version 1.72.3 (2009-11-10 09:17:13)
>
> Txs,
> Miguel

I figured what is causing it! But have no idea why?
The problem only happens if the link is called with arguments!
for example:
(no problems): http://127.0.0.1:8000/crmappliance/default/list_results
(problems):
http://127.0.0.1:8000/crmappliance/default/list_results/company/1

What is wrong here?
Miguel

--

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




[web2py:37154] Oddity with crm applicance (?)

2009-12-14 Thread Miguel Lopes
I'm posting this reluctantly, because I would expect to be doing
something wrong. However I can't figure out what is wrong.

Playing around with the CRM appliance I introduced a simple ajax
search. Strangely the target div gets loaded with a copy of the entire
page.
My view is as simple as it could get (I didn't mess with layout.html):
default/results.html

{{extend 'layout.html'}}

Results
{{=search_input}} 
{{=target_div}}

The functions as well:
@auth.requires_login()
def list_results():
search_input=INPUT(_id='keyword', _onkeyup="ajax('bg_find',
['keyword'], 'target_div');")
target_div=DIV(_id='target_div')
return dict(search_input=search_input, target_div=target_div)

@auth.requires_login()
def bg_find():
return P('Hello')

The problem shows both in Firefox and Safari.
web2py Version 1.72.3 (2009-11-10 09:17:13)

Txs,
Miguel

--

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




[web2py:37153] Re: HELP with new DAL

2009-12-14 Thread DenesL
About uploads folder, is the problem that hg does not allow empty
folders?
None of the apps in the hg repository (including welcome) have an
uploads folder.

With rev.30:

Traceback (most recent call last):
  File "C:\web2py\hg\gluon\restricted.py", line 173, in restricted
exec ccode in environment
  File "C:/web2py/hg/applications/w3/controllers/appadmin.py", line
304, in 
  File "C:\web2py\hg\gluon\globals.py", line 96, in 
self._caller = lambda f: f()
  File "C:/web2py/hg/applications/w3/controllers/appadmin.py", line
124, in insert
if form.accepts(request.vars, session):
  File "C:\web2py\hg\gluon\sqlhtml.py", line 898, in accepts
self.vars.id = self.table.insert(**fields)
  File "C:\web2py\hg\gluon\sql.py", line 1875, in insert
self._db._adapter.execute(query)
  File "C:\web2py\hg\gluon\sql.py", line 187, in execute
return self.cursor.execute(*a, **b)
DataError: ('22018', "[22018] [Microsoft][ODBC SQL Server Driver][SQL
Server]Conversion failed when converting the varchar value 'T' to data
type bit. (245) (SQLExecDirectW)")

On Dec 14, 12:59 am, mdipierro  wrote:
> I think I fixed the two problems in trunk. Please give it a try.
>
> For everybody else on these lists... these problems reported in this
> thread refer to testing the new DAL in trunk. It is a major rewrite.
> We are testing is step by step. None of these problems affect the old
> DAL in stable.
>
> Massimo

--

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




[web2py:37152] check_credentials not working (for me)

2009-12-14 Thread selecta
if not gluon.fileutils.check_credentials(request):
redirect(URL(a='admin', c='default', f='index'))

Whenever this line is in my code I always get redirected, I have no
idea what to do to avoid that (other than commenting out this line).

I access the server from localhost with an normal http request.

Please help me.

--

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