[web2py] Google App Engine Launcher and Deployment

2011-10-15 Thread Simon Ashley
Just a first time play with this.
  (Environment: Python 25, current Web2Py nightly source {copied to
the Python25 root} and fresh copy of the Google App Engine Launcher)
App is working fine from a command line python25 call
When run from the Launcher -> Browse, is fine with a static page, but
when accessing data, it throws the following:

Traceback (most recent call last):
  File "C:\Python25\gluon\restricted.py", line 194, in restricted
exec ccode in environment
  File "C:/Python25/applications/demurage/views/generic.html", line
98, in 
  File "C:\Python25\gluon\globals.py", line 310, in toolbar
for i in thread.instances]
  File "C:\Python25\lib\_threading_local.py", line 193, in
__getattribute__
return object.__getattribute__(self, name)
AttributeError: 'local' object has no attribute 'instances'

Table is generated in the GAE, data can be imported, but nothing
accessed through the application.

Any ideas?


[web2py] Re: criticism of web2py

2011-10-15 Thread Gour
On Fri, 14 Oct 2011 16:05:56 -0700 (PDT)
Massimo Di Pierro
 wrote:

> I will.

Does it mean the code won't be any longer under hg so those who prefer
hg over git would have to use hg-git?


Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810




signature.asc
Description: PGP signature


[web2py] Re: criticism of web2py

2011-10-15 Thread Gour
On Fri, 14 Oct 2011 15:30:58 -0700 (PDT)
Massimo Di Pierro
 wrote:

> The community should write such road map and work to achieve it.

Anyone senior inspired to work on that?

> - finish the web2py recipes book

Is this going to be printed as well?


Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810




signature.asc
Description: PGP signature


[web2py] DIV Helper and Include

2011-10-15 Thread miroslavgojic
How to make {{include}} to work in DIV Helper

I have next situation

{{=DIV(DIV('some code',_id='code'),include,_id='content')}}


[web2py] Re: serving a zip file

2011-10-15 Thread peter
Yes, the downloaded file is corrupted with IE8 but not with chrome.
When I compare the files with a hex editor, they both begin and end
the same, however, the last byte of the original file is at 6EA11,
whereas the last byte of the downloaded file is at 6D7311.

So it appears that it is losing a few bytes but not at either end.

Windows reports the size of the two files as 6.91MB on server and
6.83MB after downloading

Peter

On Oct 14, 11:40 pm, Massimo Di Pierro 
wrote:
> You mean the downloaded file is corrupted? Can you check the size?
>
> On Oct 14, 5:33 pm, peter  wrote:
>
>
>
> > Okay this is where I am now.
>
> > My example 'downloady' above works correctly in chrome but incorrectly
> > in IE8. In IE8, the file appears to download correctly but will not
> > unzip.
>
> > Peter
>
> > On Oct 14, 7:13 pm, Matt Broadstone  wrote:
>
> > > On Fri, Oct 14, 2011 at 12:48 PM, Massimo Di 
> > > Pierro wrote:
> > > > What browser?
>
> > > That was chrome. The previously fix suggested by Brian works for me 
> > > (thanks!).
>
> > > Matt
>
> > > > On Oct 14, 10:30 am, Matt Broadstone  wrote:
> > > >> On Fri, Oct 14, 2011 at 9:35 AM, peter  
> > > >> wrote:
> > > >> > If I now do exactly what I did one month ago, there is now no error
> > > >> > with zip streaming. So maybe you have changed things in
> > > >> > response.stream since then.
>
> > > >> > Peter
>
> > > >> > On Oct 14, 1:24 pm, peter  wrote:
> > > >> >> I sent from my wifes 
> > > >> >> emailhttp://groups.google.com/group/web2py/browse_thread/thread/fe85dca9e4...
>
> > > >> >> However with hindsight I think I did not give sufficient information
> > > >> >> in my forum entry. I guess I was seeing if other people had had
> > > >> >> problems with downloading zip files.
>
> > > >> >> Today, I just tried the following
>
> > > >> >> def downloady():
>
> > > >> >>     import os
> > > >> >>     import contenttype as c
> > > >> >>     path="somepath/album.zip"
> > > >> >>     response.headers['Content-Type'] = c.contenttype(path)
> > > >> >>     response.headers['Content-Disposition'] = 'attachment;
> > > >> >> filename=album.zip'# to force download as attachment
>
> > > >> >>     return response.stream(open(path,'rb'),chunk_size=4096)
>
> > > >> Does this actually work for you? When I use this code, I get a
> > > >> download, but it saves out a zero byte file with the proper name.
>
> > > >> >> and this did work correctly. So I do not know why I was having
> > > >> >> problems last month, when I repeatedly had problems with downloaded
> > > >> >> zip files not unzipping.
>
> > > >> >> So I aplogise for suggesting there was a bug here. I will see if I 
> > > >> >> can
> > > >> >> recreate the problems I was having and get to the root cause.
>
> > > >> >> Peter
>
> > > >> >> On Oct 14, 12:22 am, Massimo Di Pierro 
> > > >> >> wrote:
>
> > > >> >> > On Oct 13, 12:46 pm, peter  wrote:
>
> > > >> >> > > As I have reported previously in this forum, I think that
> > > >> >> > > response.stream does not quite stream zip files correctly.
>
> > > >> >> > I have no bug report about this. Can you tell us more so we can 
> > > >> >> > fix it?- Hide quoted text -
>
> > > >> >> - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


[web2py] Re: DIV Helper and Include

2011-10-15 Thread miroslavgojic
{{=HTML(HEAD(),BODY(DIV(DIV('Header',_id='header'),DIV(include,_id='content'),DIV('Footer',_id='footer'),_id='site')),doctype='html5',
lang='sr')}}

This was my idea to create template with HTML helpers



On Oct 15, 11:42 am, miroslavgojic  wrote:
> How to make {{include}} to work in DIV Helper
>
> I have next situation
>
> {{=DIV(DIV('some code',_id='code'),include,_id='content')}}


[web2py] Re: DAL level access to GAE entities by named key

2011-10-15 Thread Murray3
It would be great if (when the code is fully tested) some full example
code for getting
this working was posted / made available.
It would be a much welcome addition to the greatly improved (and
ongoing :) documentation done on web2py over the last year.
cjm

On Oct 12, 6:03 pm, howesc  wrote:
> i know we went back and forth a few months back and i helped with the patch
> for it, but it was lightly tested and i never used it myself in a production
> environment.  i suspect it's a simple fix and i'll take a look at the DAL as
> well.
>
> cfh


[web2py] web2py on GAE and supplementary package usage

2011-10-15 Thread Minocha
i'm new in deploying applications on the GAE using the web2py.
I wanted to ask what is the procedure to make available external
libraries for python controllers in web2py on platforms - GAE and also
on external server where i would like to host a website.


[web2py] GAE and (smart) grid

2011-10-15 Thread Casey Schroeder

Running into the problem that GAE doesn't like the use of OR, embedded
in the use of dbset.select(left...  on line 1640 in the SQLFORM.grid
definition.  I assume it is because of the restriction to no joins on
GAE.

For my purposes, i just set searchable=False as a parameter and that
fixed my problem.  But for users who need it, a fix, or a change will
need to be made i think.

Thanks


Re: [web2py] Re: criticism of web2py

2011-10-15 Thread Farsheed Ashouri
About the cms, I am actually working on a general, full featured CMS for my
own company. just out of curiosity, anyone attracted to my blog
system?
If community like it, I'd open it's source and start develop it as a
standard CMS for web2py. And if not, What is a standard cms definition? I am
so eager to develop a standard cms system for web2py but i really hate
systems like Plone. they are so complicated and heavy. I like simplicity in
design and accuracy in software engineering and demand scalability (SaaS).
It might be so good if we could divide responsibilities to develop
that roadmap and carry out the side development cycle like the way Debian
community does it.


On Sat, Oct 15, 2011 at 10:40 AM, Gour  wrote:

> On Fri, 14 Oct 2011 15:30:58 -0700 (PDT)
> Massimo Di Pierro
>  wrote:
>
> > The community should write such road map and work to achieve it.
>
> Anyone senior inspired to work on that?
>
> > - finish the web2py recipes book
>
> Is this going to be printed as well?
>
>
> Sincerely,
> Gour
>
>
> --
> “In the material world, conceptions of good and bad are
> all mental speculations…” (Sri Caitanya Mahaprabhu)
>
> http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
>
>
>


-- 
Sincerely,
Farsheed Ashouri,
ourway.ir
Tel: +98 9388801504


Re: [web2py] Re: criticism of web2py

2011-10-15 Thread Bruno Rocha
On Sat, Oct 15, 2011 at 10:06 AM, Farsheed Ashouri <
farsheed.asho...@gmail.com> wrote:

> About the cms, I am actually working on a general, full featured CMS for my
> own company. just out of curiosity, anyone attracted to my blog 
> system?
> If community like it, I'd open it's source and start develop it as a
> standard CMS for web2py. And if not, What is a standard cms definition? I am
> so eager to develop a standard cms system for web2py but i really hate
> systems like Plone. they are so complicated and heavy. I like simplicity in
> design and accuracy in software engineering and demand scalability (SaaS).
> It might be so good if we could divide responsibilities to develop
> that roadmap and carry out the side development cycle like the way Debian
> community does it.
>

I like your blog system and your facebook like social network, but I cant
register myself. teh form displays error and I cant run the 'forget it' to
get my password reseted.

I will like if you open the source of your blog system.


[web2py] Re: criticism of web2py

2011-10-15 Thread Gour
On Sat, 15 Oct 2011 16:36:18 +0330
Farsheed Ashouri
 wrote:

> About the cms, I am actually working on a general, full featured CMS
> for my own company. just out of curiosity, anyone attracted to my blog
> system?

It's nice.

> What is a standard cms definition? 

E.g. Concrete5 (concrete5.org) in PHP or Django CMS (django-cms.org).


Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810




signature.asc
Description: PGP signature


[web2py] web3py (was Re: criticism of web2py)

2011-10-15 Thread Gour
On Fri, 14 Oct 2011 18:28:24 -0700 (PDT)
Massimo Di Pierro
 wrote:

> There will be a web3py that runs on python 3 but it will not be just a
> port of web2py because we will take the occasion for a major overhaul.

I hope some of the principles on which web2py is built will stay intact?


Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810




signature.asc
Description: PGP signature


[web2py] db modeling question regarding DAL, SQLFORM and nested items

2011-10-15 Thread Erwin Pass
Hi there,

I saw on stackoverflow that you prefer questions here :)

I need to display a form for a nested table structure. This means that
a record of a table might have a reference to another record of that
table. I have no idea how to model  something like this using DAL and
SQLFORM. I guess it isn't even possible but  you might have another
idea to implementi this.

To illustrate my problem  think about some xml or html structure where
a node of a certain type can contain nodes of other types as well as
nodes of the same type.



text
 ...
nth text
 
 
 ...
  


A div block might contain other div blocks. This seems not to be
possible to model using DAL:

db.define_table('div',
Field('text', type='string'),
Field('ul', type=db.ul),
Field('div', db.div))

This attempt results in some KeyError: 'div', probably caused because
db.div is about to defined but referenced before it could be
constructed fully.

The second part of the problem I'm facing might be an even tougher
one. Because I not only need to store references to _one_ another
record of the same table but to a unknown number of such records. (It
is not known how many divs the user choses to nest within...)

I guess this requires another table like db.div_to_div which contains
the references (ids) but then I'm lost on ideas how to connect
implement the view which connects all this and enables the user to
enter his data.


[web2py] Re: db modeling question regarding DAL, SQLFORM and nested items

2011-10-15 Thread Anthony
You can do self references -- 
see http://web2py.com/book/default/chapter/06#Self-Reference-and-Aliases.

You would need to do Field('div', 'reference div').

On Saturday, October 15, 2011 9:05:05 AM UTC-4, Erwin Pass wrote:
>
> Hi there, 
>
> I saw on stackoverflow that you prefer questions here :) 
>
> I need to display a form for a nested table structure. This means that 
> a record of a table might have a reference to another record of that 
> table. I have no idea how to model  something like this using DAL and 
> SQLFORM. I guess it isn't even possible but  you might have another 
> idea to implementi this. 
>
> To illustrate my problem  think about some xml or html structure where 
> a node of a certain type can contain nodes of other types as well as 
> nodes of the same type. 
>
>  
>  
> text 
>  ... 
> nth text 
>   
>   
>  ... 
>
>  
>
> A div block might contain other div blocks. This seems not to be 
> possible to model using DAL: 
>
> db.define_table('div', 
> Field('text', type='string'), 
> Field('ul', type=db.ul), 
> Field('div', db.div)) 
>
> This attempt results in some KeyError: 'div', probably caused because 
> db.div is about to defined but referenced before it could be 
> constructed fully. 
>
> The second part of the problem I'm facing might be an even tougher 
> one. Because I not only need to store references to _one_ another 
> record of the same table but to a unknown number of such records. (It 
> is not known how many divs the user choses to nest within...) 
>
> I guess this requires another table like db.div_to_div which contains 
> the references (ids) but then I'm lost on ideas how to connect 
> implement the view which connects all this and enables the user to 
> enter his data.



Re: [web2py] Re: criticism of web2py

2011-10-15 Thread Anthony
We've already got a good start with Powerpack and Instant Press -- it may 
make sense to collaborate/build on those.

On Saturday, October 15, 2011 9:06:18 AM UTC-4, Farsheed Ashouri wrote:
>
> About the cms, I am actually working on a general, full featured CMS for my 
> own company. just out of curiosity, anyone attracted to my blog 
> system? 
> If community like it, I'd open it's source and start develop it as a 
> standard CMS for web2py. And if not, What is a standard cms definition? I am 
> so eager to develop a standard cms system for web2py but i really hate 
> systems like Plone. they are so complicated and heavy. I like simplicity in 
> design and accuracy in software engineering and demand scalability (SaaS).
> It might be so good if we could divide responsibilities to develop 
> that roadmap and carry out the side development cycle like the way Debian 
> community does it.
>
>
> On Sat, Oct 15, 2011 at 10:40 AM, Gour  wrote:
>
>> On Fri, 14 Oct 2011 15:30:58 -0700 (PDT)
>> Massimo Di Pierro
>>  wrote:
>>
>> > The community should write such road map and work to achieve it.
>>
>> Anyone senior inspired to work on that?
>>
>> > - finish the web2py recipes book
>>
>> Is this going to be printed as well?
>>
>>
>> Sincerely,
>> Gour
>>
>>
>> --
>> “In the material world, conceptions of good and bad are
>> all mental speculations…” (Sri Caitanya Mahaprabhu)
>>
>> http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
>>
>>
>>
>
>
> -- 
> Sincerely,
> Farsheed Ashouri,
> ourway.ir
> Tel: +98 9388801504
>
> 

[web2py] Powerpack & Instant Press (was Re: criticism of web2py)

2011-10-15 Thread Gour
On Sat, 15 Oct 2011 06:57:54 -0700 (PDT)
Anthony  wrote:

> We've already got a good start with Powerpack and Instant Press -- it
> may make sense to collaborate/build on those.

I agree...It would be nice to have more people work on it.


Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810




signature.asc
Description: PGP signature


[web2py] mercurial - cmdutil.addremove undefined error

2011-10-15 Thread tom h
Hi, sorry it's my first time really posting here.

I'm not even sure if I'm posting this correctly, basically i'd like to
reply to this post:

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

basically i'm on mac os lion with python 2.7 and mercurial 1.9.3.  it
cannot find the method addremove in cmdutil function.

seems like addremove used to be in mercurial.cmdutil and now is
deprecated.  how are people getting around this?

thanks a lot!

tom


[web2py] crud update problem with 1.99.2?

2011-10-15 Thread David Manns
This problem appeared when I moved my application from x to 1.99.2.

I use crud.update to display and modify a member directory record. Selecting 
and displaying the record works, but when submitting an updated record I get 
a failure:

TRACEBACK

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

Traceback (most recent call last):
  File "C:\Documents and Settings\David Manns\My 
Documents\ocsnedb\gluon\restricted.py", line 194, in restricted
raise
  File "C:/Documents and Settings/David Manns/My Documents/ocsnedb 
saved/applications/init/controllers/default.py" 
, line 
889, in 
  File "C:\Documents and Settings\David Manns\My 
Documents\ocsnedb\gluon\globals.py", line 149, in 
  File "C:/Documents and Settings/David Manns/My Documents/ocsnedb 
saved/applications/init/controllers/default.py" 
, line 
273, in memberform
deletable = False, next=next, onvalidation=setmodified)
  File "C:\Documents and Settings\David Manns\My 
Documents\ocsnedb\gluon\tools.py", line 2994, in update
formname=DEFAULT,
  File "C:\Documents and Settings\David Manns\My 
Documents\ocsnedb\gluon\tools.py", line 79, in replace_id
TypeError: float argument required


The controller code looks like:

def memberform():
 chkurlreader()
 if request .vars.membid:
 member=db.Members[request 
.vars.membid]
 db.Members.Email.comment = A 
('Add/Edit/Delete Email 
Address(es)',
 _href=URL 
('memberemail', 
vars=dict(membid=request 
.vars.membid, next=request 
.vars.next)))
 db.Members.Affiliation.comment = A 
('Add/Edit/Delete Affiliation(s)',
 _href=URL 
('memberaffiliation', 
vars=dict(membid=request 
.vars.membid, next=request 
.vars.next)))
 if member.Status in ('Full', 'Student'):
 db.Members.Paiddate.comment = A 
('Process dues payment',
 _href=URL 
('memberdues', 
vars=dict(membid=request 
.vars.membid, next=request 
.vars.next)))
 else:
 db.Members.Paiddate.comment = 'Only for Full & Student Members'
 next = URL ('memberform', 
vars=dict(membid=request 
.vars.membid, next=request 
.vars.next))
 form = crud.update(db.Members, request 
.vars.membid, 
 deletable = False, next=next, onvalidation=setmodified)
 form[0][-1][1].append(INPUT 
(_type="button",_value="Cancel",
 _onclick="window.location='%s';"%request 
.vars.next)) 
 else:
 db.Members.Email.comment = 'Add email address(es) after creating basic 
record'
 db.Members.Affiliation.comment = 'Add affiliation(s) after creating basic 
record'
 db.Members.Paiddate.comment = 'Usually set by processing dues payment'
 form = crud.create(db.Members, next=request 
.vars.next, 
onaccept=newmember)
 form[0][-1][1].append(INPUT 
(_type="button",_value="Cancel",
 _onclick="window.location='%s';"%request 
.vars.next)) 
 return dict(form=form, next=request 
.vars.next, membid=request 
.vars.membid)




[web2py] Re: plugin_wiki crud and auth

2011-10-15 Thread Massimo Di Pierro
You can set permissions for a table that do not exist. Use 'tablename'
instead of db.tablename. If unsure, post your model.

On Oct 14, 9:26 pm, pinwc4  wrote:
> Thank you for such a quick response.
>
> I attempted to do just this from within my model file but got the
> error KeyError: 'plugin_wiki_page'.  My guess was that the table is
> not defined before my own model runs so I can not set the permissions
> there.
>
> So I guess my question at this point is what the best way to set these
> permissions would be?  I have created logic in my model file that
> checks whether specific groups exist, and if not it creates them and
> grants them the expected the permissions.
>
> The reason I did this is that so when I deploy the app in a new
> environment all expected groups and permissions are created
> automatically instead of manually doing the work.
>
> Is there a better way I should be doing this, preferably in a manner
> that will make it simple for others to deploy this without having to
> manually set up permissions?
>
> Also thanks for such a great framework.  I was able to go from 0
> knowledge to within a few weeks creating a web application for
> management of point series where clubs can securely submit their
> results.  I reviewed many frameworks before committing to using web2py
> and after these past few weeks of work am very happy that I did.
>
> On Oct 14, 8:52 pm, Massimo Di Pierro 
> wrote:
>
>
>
>
>
>
>
> > You need to create a new group and this this group all crud
> > permissions (read,write,delete,select) for all plugin_wiki tables.
> > Than make all users members of the group.
>
> > On Oct 14, 8:49 pm, pinwc4  wrote:


[web2py] Re: web2py powweb

2011-10-15 Thread Massimo Di Pierro
mod_python is deprecated. Do they have mod_wsgi?

On Oct 15, 12:26 am, José Luna Venezuela  wrote:
> Hi I'm traying tu run web2py inwww.powweb.comhosting they say the
> can run python 2.5 and I found a forum message that says web2py should
> run. (http://forum.powweb.com/showthread.php?t=85385)
> I tryied tu set it up with the "Shared Hosting with mod_python"
> instruction from chater 11 en the web2py book but it did not work. I
> think to be be doing some thing wrong since i haven set up any ip
> adress or admin password... ¿Have any one here manage to install
> web2py powweb? or can help me doing it?


[web2py] Re: Google App Engine Launcher and Deployment

2011-10-15 Thread Massimo Di Pierro
could be a bug in toolbar.  I never tried it in GAE. Open a ticket and
will fix it asap.

On Oct 15, 2:05 am, Simon Ashley  wrote:
> Just a first time play with this.
>   (Environment: Python 25, current Web2Py nightly source {copied to
> the Python25 root} and fresh copy of the Google App Engine Launcher)
> App is working fine from a command line python25 call
> When run from the Launcher -> Browse, is fine with a static page, but
> when accessing data, it throws the following:
>
> Traceback (most recent call last):
>   File "C:\Python25\gluon\restricted.py", line 194, in restricted
>     exec ccode in environment
>   File "C:/Python25/applications/demurage/views/generic.html", line
> 98, in 
>   File "C:\Python25\gluon\globals.py", line 310, in toolbar
>     for i in thread.instances]
>   File "C:\Python25\lib\_threading_local.py", line 193, in
> __getattribute__
>     return object.__getattribute__(self, name)
> AttributeError: 'local' object has no attribute 'instances'
>
> Table is generated in the GAE, data can be imported, but nothing
> accessed through the application.
>
> Any ideas?


[web2py] Re: serving a zip file

2011-10-15 Thread Massimo Di Pierro
Why
response.headers['Content-Type'] = "application/octet-stream"
shouldn't it be
response.headers['Content-Type'] = "application/zip"

I am not sure this causes the problem but it may be, if IE thinks the
data is ascii and not binary.

On Oct 15, 4:46 am, peter  wrote:
> Yes, the downloaded file is corrupted with IE8 but not with chrome.
> When I compare the files with a hex editor, they both begin and end
> the same, however, the last byte of the original file is at 6EA11,
> whereas the last byte of the downloaded file is at 6D7311.
>
> So it appears that it is losing a few bytes but not at either end.
>
> Windows reports the size of the two files as 6.91MB on server and
> 6.83MB after downloading
>
> Peter
>
> On Oct 14, 11:40 pm, Massimo Di Pierro 
> wrote:
>
>
>
>
>
>
>
> > You mean the downloaded file is corrupted? Can you check the size?
>
> > On Oct 14, 5:33 pm, peter  wrote:
>
> > > Okay this is where I am now.
>
> > > My example 'downloady' above works correctly in chrome but incorrectly
> > > in IE8. In IE8, the file appears to download correctly but will not
> > > unzip.
>
> > > Peter
>
> > > On Oct 14, 7:13 pm, Matt Broadstone  wrote:
>
> > > > On Fri, Oct 14, 2011 at 12:48 PM, Massimo Di 
> > > > Pierro wrote:
> > > > > What browser?
>
> > > > That was chrome. The previously fix suggested by Brian works for me 
> > > > (thanks!).
>
> > > > Matt
>
> > > > > On Oct 14, 10:30 am, Matt Broadstone  wrote:
> > > > >> On Fri, Oct 14, 2011 at 9:35 AM, peter  
> > > > >> wrote:
> > > > >> > If I now do exactly what I did one month ago, there is now no error
> > > > >> > with zip streaming. So maybe you have changed things in
> > > > >> > response.stream since then.
>
> > > > >> > Peter
>
> > > > >> > On Oct 14, 1:24 pm, peter  wrote:
> > > > >> >> I sent from my wifes 
> > > > >> >> emailhttp://groups.google.com/group/web2py/browse_thread/thread/fe85dca9e4...
>
> > > > >> >> However with hindsight I think I did not give sufficient 
> > > > >> >> information
> > > > >> >> in my forum entry. I guess I was seeing if other people had had
> > > > >> >> problems with downloading zip files.
>
> > > > >> >> Today, I just tried the following
>
> > > > >> >> def downloady():
>
> > > > >> >>     import os
> > > > >> >>     import contenttype as c
> > > > >> >>     path="somepath/album.zip"
> > > > >> >>     response.headers['Content-Type'] = c.contenttype(path)
> > > > >> >>     response.headers['Content-Disposition'] = 'attachment;
> > > > >> >> filename=album.zip'# to force download as attachment
>
> > > > >> >>     return response.stream(open(path,'rb'),chunk_size=4096)
>
> > > > >> Does this actually work for you? When I use this code, I get a
> > > > >> download, but it saves out a zero byte file with the proper name.
>
> > > > >> >> and this did work correctly. So I do not know why I was having
> > > > >> >> problems last month, when I repeatedly had problems with 
> > > > >> >> downloaded
> > > > >> >> zip files not unzipping.
>
> > > > >> >> So I aplogise for suggesting there was a bug here. I will see if 
> > > > >> >> I can
> > > > >> >> recreate the problems I was having and get to the root cause.
>
> > > > >> >> Peter
>
> > > > >> >> On Oct 14, 12:22 am, Massimo Di Pierro 
> > > > >> >> 
> > > > >> >> wrote:
>
> > > > >> >> > On Oct 13, 12:46 pm, peter  wrote:
>
> > > > >> >> > > As I have reported previously in this forum, I think that
> > > > >> >> > > response.stream does not quite stream zip files correctly.
>
> > > > >> >> > I have no bug report about this. Can you tell us more so we can 
> > > > >> >> > fix it?- Hide quoted text -
>
> > > > >> >> - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -


[web2py] Re: DIV Helper and Include

2011-10-15 Thread Massimo Di Pierro
Not possible.

On Oct 15, 6:05 am, miroslavgojic  wrote:
> {{=HTML(HEAD(),BODY(DIV(DIV('Header',_id='header'),DIV(include,_id='content 
> '),DIV('Footer',_id='footer'),_id='site')),doctype='html5',
> lang='sr')}}
>
> This was my idea to create template with HTML helpers
>
> On Oct 15, 11:42 am, miroslavgojic  wrote:
>
>
>
>
>
>
>
> > How to make {{include}} to work in DIV Helper
>
> > I have next situation
>
> > {{=DIV(DIV('some code',_id='code'),include,_id='content')}}


[web2py] adding fields to auth.define_tables

2011-10-15 Thread Lucidguppy
In auth.define_tables - theres an argument to have a username in the
table. Which is nice to have.

Is there an easy way to use the default auth.define_tables but add a
couple of extra fields like "favorite_color" and
"what_is_your_quest"?

Thanks


[web2py] Re: adding fields to auth.define_tables

2011-10-15 Thread Anthony
Yes, see http://www.web2py.com/book/default/chapter/08#Customizing-Auth. 
There are two methods -- using auth.settings.extra_fields (if you just want 
to add a few extra fields to the end of the table definition) or creating 
your own custom auth_user table definition (if you need more thorough 
customization).

Anthony

On Saturday, October 15, 2011 10:50:28 AM UTC-4, Lucidguppy wrote:
>
> In auth.define_tables - theres an argument to have a username in the 
> table. Which is nice to have. 
>
> Is there an easy way to use the default auth.define_tables but add a 
> couple of extra fields like "favorite_color" and 
> "what_is_your_quest"? 
>
> Thanks



[web2py] Re: GAE and (smart) grid

2011-10-15 Thread Massimo Di Pierro
You are right. GAE does not support OR except in some simple cases (OR
that can be rewritten as operator IN).
There should be code that limits the type of allowed query on GAE with
datastore.

Please open ticket and I will fix this asap.

Massimo

On Oct 15, 7:47 am, Casey Schroeder  wrote:
> Running into the problem that GAE doesn't like the use of OR, embedded
> in the use of dbset.select(left...  on line 1640 in the SQLFORM.grid
> definition.  I assume it is because of the restriction to no joins on
> GAE.
>
> For my purposes, i just set searchable=False as a parameter and that
> fixed my problem.  But for users who need it, a fix, or a change will
> need to be made i think.
>
> Thanks


Re: [web2py] Re: web2py powweb

2011-10-15 Thread Jose Luna
Sry but I don't know how to check if they have mod_wsgi. They just say that
can run pyhton 2.5 scrip and that they should better be put into a folder
named *cgi-bin*. this the info they give about python:

How Python works at PowWebPowWeb's PowerPack allows you to write scripts
using Python. To ensure that your Python scripts work smoothly, please refer
to the following information before you get started:

   - Path to your Web directory:*
   /home/users/web/b1821/pow.techwaresolutionscom/htdocs*
   This is important, as most of your scripts will need to specify this
   location. For example, this is required if uploading files was a function
   that you'd like your Python script to do.

   - Path to Python: */usr/bin/python*
   Note that PowWeb's CGI servers automatically direct your scripts to this
   path. You do not need to change the "#!" line at the top of your scripts.

   - Version of Python: *2.5*
   This is the version of Python that PowWeb runs on its servers. Newer
   versions may be installed as they become available.

   - Required filename extensions: *.py*
   These are the extensions that your Python files must have or they will
   not work. For example, they would be *yourscript.py*

   - Recommended path: *http://yourcompanyname.com/cgi-bin/yourscript.py *
   If you do not have a domain name, point to: *
   http://yourusername.powweb.com/cgi-bin/yourscript.py.*
   Note: PowWeb recommends that you use your cgi-bin as the default folder
   for all your cgi scripts. We cannot guarantee that they will work outside of
   this folder.


2011/10/15 Massimo Di Pierro 

> mod_python is deprecated. Do they have mod_wsgi?
>
> On Oct 15, 12:26 am, José Luna Venezuela  wrote:
> > Hi I'm traying tu run web2py inwww.powweb.comhosting they say the
> > can run python 2.5 and I found a forum message that says web2py should
> > run. (http://forum.powweb.com/showthread.php?t=85385)
> > I tryied tu set it up with the "Shared Hosting with mod_python"
> > instruction from chater 11 en the web2py book but it did not work. I
> > think to be be doing some thing wrong since i haven set up any ip
> > adress or admin password... ¿Have any one here manage to install
> > web2py powweb? or can help me doing it?
>



-- 
José F. Luna P.


[web2py] Re: serving a zip file

2011-10-15 Thread peter

This is the code I used, as above
def downloady():


import os
import contenttype as c
path="somepath/album.zip"
response.headers['Content-Type'] = c.contenttype(path)
response.headers['Content-Disposition'] = 'attachment;
filename=album.zip'# to force download as attachment


return response.stream(open(path,'rb'),chunk_size=4096)


Peter

On Oct 15, 3:53 pm, Massimo Di Pierro 
wrote:
> Why
> response.headers['Content-Type'] = "application/octet-stream"
> shouldn't it be
> response.headers['Content-Type'] = "application/zip"
>
> I am not sure this causes the problem but it may be, if IE thinks the
> data is ascii and not binary.
>
> On Oct 15, 4:46 am, peter  wrote:
>
>
>
> > Yes, the downloaded file is corrupted with IE8 but not with chrome.
> > When I compare the files with a hex editor, they both begin and end
> > the same, however, the last byte of the original file is at 6EA11,
> > whereas the last byte of the downloaded file is at 6D7311.
>
> > So it appears that it is losing a few bytes but not at either end.
>
> > Windows reports the size of the two files as 6.91MB on server and
> > 6.83MB after downloading
>
> > Peter
>
> > On Oct 14, 11:40 pm, Massimo Di Pierro 
> > wrote:
>
> > > You mean the downloaded file is corrupted? Can you check the size?
>
> > > On Oct 14, 5:33 pm, peter  wrote:
>
> > > > Okay this is where I am now.
>
> > > > My example 'downloady' above works correctly in chrome but incorrectly
> > > > in IE8. In IE8, the file appears to download correctly but will not
> > > > unzip.
>
> > > > Peter
>
> > > > On Oct 14, 7:13 pm, Matt Broadstone  wrote:
>
> > > > > On Fri, Oct 14, 2011 at 12:48 PM, Massimo Di 
> > > > > Pierro wrote:
> > > > > > What browser?
>
> > > > > That was chrome. The previously fix suggested by Brian works for me 
> > > > > (thanks!).
>
> > > > > Matt
>
> > > > > > On Oct 14, 10:30 am, Matt Broadstone  wrote:
> > > > > >> On Fri, Oct 14, 2011 at 9:35 AM, peter 
> > > > > >>  wrote:
> > > > > >> > If I now do exactly what I did one month ago, there is now no 
> > > > > >> > error
> > > > > >> > with zip streaming. So maybe you have changed things in
> > > > > >> > response.stream since then.
>
> > > > > >> > Peter
>
> > > > > >> > On Oct 14, 1:24 pm, peter  wrote:
> > > > > >> >> I sent from my wifes 
> > > > > >> >> emailhttp://groups.google.com/group/web2py/browse_thread/thread/fe85dca9e4...
>
> > > > > >> >> However with hindsight I think I did not give sufficient 
> > > > > >> >> information
> > > > > >> >> in my forum entry. I guess I was seeing if other people had had
> > > > > >> >> problems with downloading zip files.
>
> > > > > >> >> Today, I just tried the following
>
> > > > > >> >> def downloady():
>
> > > > > >> >>     import os
> > > > > >> >>     import contenttype as c
> > > > > >> >>     path="somepath/album.zip"
> > > > > >> >>     response.headers['Content-Type'] = c.contenttype(path)
> > > > > >> >>     response.headers['Content-Disposition'] = 'attachment;
> > > > > >> >> filename=album.zip'# to force download as attachment
>
> > > > > >> >>     return response.stream(open(path,'rb'),chunk_size=4096)
>
> > > > > >> Does this actually work for you? When I use this code, I get a
> > > > > >> download, but it saves out a zero byte file with the proper name.
>
> > > > > >> >> and this did work correctly. So I do not know why I was having
> > > > > >> >> problems last month, when I repeatedly had problems with 
> > > > > >> >> downloaded
> > > > > >> >> zip files not unzipping.
>
> > > > > >> >> So I aplogise for suggesting there was a bug here. I will see 
> > > > > >> >> if I can
> > > > > >> >> recreate the problems I was having and get to the root cause.
>
> > > > > >> >> Peter
>
> > > > > >> >> On Oct 14, 12:22 am, Massimo Di Pierro 
> > > > > >> >> 
> > > > > >> >> wrote:
>
> > > > > >> >> > On Oct 13, 12:46 pm, peter  wrote:
>
> > > > > >> >> > > As I have reported previously in this forum, I think that
> > > > > >> >> > > response.stream does not quite stream zip files correctly.
>
> > > > > >> >> > I have no bug report about this. Can you tell us more so we 
> > > > > >> >> > can fix it?- Hide quoted text -
>
> > > > > >> >> - Show quoted text -- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


Re: [web2py] Re: DIV Helper and Include

2011-10-15 Thread Miroslav Gojic
Thanks

I was play wit that that half day ...



- - Miroslav Gojic - -


On Sat, Oct 15, 2011 at 16:54, Massimo Di Pierro
 wrote:
> Not possible.
>
> On Oct 15, 6:05 am, miroslavgojic  wrote:
>> {{=HTML(HEAD(),BODY(DIV(DIV('Header',_id='header'),DIV(include,_id='content 
>> '),DIV('Footer',_id='footer'),_id='site')),doctype='html5',
>> lang='sr')}}
>>
>> This was my idea to create template with HTML helpers
>>
>> On Oct 15, 11:42 am, miroslavgojic  wrote:
>>
>>
>>
>>
>>
>>
>>
>> > How to make {{include}} to work in DIV Helper
>>
>> > I have next situation
>>
>> > {{=DIV(DIV('some code',_id='code'),include,_id='content')}}


[web2py] Re: DAL level access to GAE entities by named key

2011-10-15 Thread howesc
I finally got back to this.  using web2py trunk there was a minor 
modification to dal.py in the attached patch to make the following example 
work:

db.define_table('funtest',
Field('name', length=128))
def create_one():
id = request.args[0]
from google.appengine.ext import db as gae
class funtest(gae.Expando):
name = gae.StringProperty(required=False)
item = funtest(key_name="label:"+id,name='bob')
item.put()
return "done"
def read_one():
id = request.args[0]
from google.appengine.api.datastore_types import Key
from google.appengine.ext import db as gae
key = Key.from_path("funtest","label:"+id)
#this fails, unknown key exception
entity_keyid = db.funtest[key]
entity_keyselect = db(db.funtest.id == key).select().first()
entity_keyid2 = db.funtest(key) #this returns None
from google.appengine.ext import db as gae
entity_gae = gae.get(key)
return dict(key=key,
entity_keyselect=entity_keyselect,
entity_keyid2=entity_keyid2,
entity_gae=entity_gae)

Note that i had to create_one before i read_one and i have to use the same 
ID arg to each method.  also, if i defined the model class in the same 
method as i was doing the DAL query GAE gets confused because there are 2 
definitions of the same class.  also your other DAL code must not assume 
that the ID for this table is an int (which we often do).  i think it might 
break things like default representations etc.

i suppose the follow-on question is going to be "how do i set a named key 
using DAL".  lemme know if there is interest there and i'll dig into it.

massimo - do you need a google code issue for the patch?  is web2py OK with 
an ID that is a string?  it worked in the simple example but i don't know if 
other features expect the ID field to be an int.

christian


[web2py] Re: DAL level access to GAE entities by named key

2011-10-15 Thread howesc
groups wouldn't let me attache a file.  here's the text:

diff -r 57544ce34efe gluon/dal.py
--- a/gluon/dal.py  Wed Oct 12 21:53:13 2011 -0500
+++ b/gluon/dal.py  Sat Oct 15 08:54:00 2011 -0700
@@ -3385,7 +3385,7 @@
 (items, tablename, fields) = 
self.select_raw(query,fields,attributes)
 # self.db['_lastsql'] = self._select(query,fields,attributes)
 rows = [
-[t=='id' and int(item.key().id()) or getattr(item, t) for t in 
fields]
+[t=='id' and (int(item.key().id()) if item.key().id() else 
item.key().name()) or getattr(item, t) for t in fields]
 for item in items]
 colnames = ['%s.%s' % (tablename, t) for t in fields]
 return self.parse(rows, colnames, False)



[web2py] Re: db modeling question regarding DAL, SQLFORM and nested items

2011-10-15 Thread DenesL
Hi Erwin,

for the second part you could use a list:reference field.

For presentation purposes you can adapt what was said in
http://groups.google.com/group/web2py/msg/b8f9518487df1b9b


On Oct 15, 9:05 am, Erwin Pass  wrote:
> Hi there,
>
> I saw on stackoverflow that you prefer questions here :)
>
> I need to display a form for a nested table structure. This means that
> a record of a table might have a reference to another record of that
> table. I have no idea how to model  something like this using DAL and
> SQLFORM. I guess it isn't even possible but  you might have another
> idea to implementi this.
>
> To illustrate my problem  think about some xml or html structure where
> a node of a certain type can contain nodes of other types as well as
> nodes of the same type.
>
> 
>     
>         text
>          ...
>         nth text
>      
>      
>          ...
>       
> 
>
> A div block might contain other div blocks. This seems not to be
> possible to model using DAL:
>
> db.define_table('div',
>     Field('text', type='string'),
>     Field('ul', type=db.ul),
>     Field('div', db.div))
>
> This attempt results in some KeyError: 'div', probably caused because
> db.div is about to defined but referenced before it could be
> constructed fully.
>
> The second part of the problem I'm facing might be an even tougher
> one. Because I not only need to store references to _one_ another
> record of the same table but to a unknown number of such records. (It
> is not known how many divs the user choses to nest within...)
>
> I guess this requires another table like db.div_to_div which contains
> the references (ids) but then I'm lost on ideas how to connect
> implement the view which connects all this and enables the user to
> enter his data.


[web2py] Re: DIV Helper and Include

2011-10-15 Thread Massimo Di Pierro
The problem is that {{include}} {{extend}} and {{block}} are not
python keywords and they are reseolved before python is executed,
therefore they cannot be included in Python. This can be changed in
the future. You may want to open a ticket suggesting an improvement.
Yet It would not be easy.

On Oct 15, 10:40 am, Miroslav Gojic  wrote:
> Thanks
>
> I was play wit that that half day ...
>
> - - Miroslav Gojic - -
>
> On Sat, Oct 15, 2011 at 16:54, Massimo Di Pierro
>
>
>
>
>
>
>
>  wrote:
> > Not possible.
>
> > On Oct 15, 6:05 am, miroslavgojic  wrote:
> >> {{=HTML(HEAD(),BODY(DIV(DIV('Header',_id='header'),DIV(include,_id='content
> >>  '),DIV('Footer',_id='footer'),_id='site')),doctype='html5',
> >> lang='sr')}}
>
> >> This was my idea to create template with HTML helpers
>
> >> On Oct 15, 11:42 am, miroslavgojic  wrote:
>
> >> > How to make {{include}} to work in DIV Helper
>
> >> > I have next situation
>
> >> > {{=DIV(DIV('some code',_id='code'),include,_id='content')}}


[web2py] Re: DAL level access to GAE entities by named key

2011-10-15 Thread Massimo Di Pierro
pushing to trunk

On Oct 15, 11:01 am, howesc  wrote:
> groups wouldn't let me attache a file.  here's the text:
>
> diff -r 57544ce34efe gluon/dal.py
> --- a/gluon/dal.py      Wed Oct 12 21:53:13 2011 -0500
> +++ b/gluon/dal.py      Sat Oct 15 08:54:00 2011 -0700
> @@ -3385,7 +3385,7 @@
>          (items, tablename, fields) =
> self.select_raw(query,fields,attributes)
>          # self.db['_lastsql'] = self._select(query,fields,attributes)
>          rows = [
> -            [t=='id' and int(item.key().id()) or getattr(item, t) for t in
> fields]
> +            [t=='id' and (int(item.key().id()) if item.key().id() else
> item.key().name()) or getattr(item, t) for t in fields]
>              for item in items]
>          colnames = ['%s.%s' % (tablename, t) for t in fields]
>          return self.parse(rows, colnames, False)


[web2py] Re: Failed to import a module that named with 'plugin_' prefix in application/modules directory.

2011-10-15 Thread villas
I believe you need to use a sub-folder in modules,  e.g. (untested)

modules/plugins_name/.py

from plugins. import YourClass



[web2py] Re: adding fields to auth.define_tables

2011-10-15 Thread Lucidguppy
Thanks - you wouldn't believe how many google searches I did - now I
find out its in the same book I'm looking at.

On Oct 15, 10:57 am, Anthony  wrote:
> Yes, seehttp://www.web2py.com/book/default/chapter/08#Customizing-Auth.
> There are two methods -- using auth.settings.extra_fields (if you just want
> to add a few extra fields to the end of the table definition) or creating
> your own custom auth_user table definition (if you need more thorough
> customization).
>
> Anthony
>
>
>
>
>
>
>
> On Saturday, October 15, 2011 10:50:28 AM UTC-4, Lucidguppy wrote:
>
> > In auth.define_tables - theres an argument to have a username in the
> > table. Which is nice to have.
>
> > Is there an easy way to use the default auth.define_tables but add a
> > couple of extra fields like "favorite_color" and
> > "what_is_your_quest"?
>
> > Thanks


[web2py] Re: Failed to import a module that named with 'plugin_' prefix in application/modules directory.

2011-10-15 Thread Massimo Di Pierro
correct every folder/subfolder must have an empty __init__.py

On Oct 15, 11:48 am, villas  wrote:
> I believe you need to use a sub-folder in modules,  e.g. (untested)
>
> modules/plugins_name/.py
>
> from plugins. import YourClass


[web2py] Re: adding fields to auth.define_tables

2011-10-15 Thread Anthony
extra_fields has been around a little while, but I think it was only 
recently added to the book (i.e., the recent 3.1 edition).

On Saturday, October 15, 2011 1:11:50 PM UTC-4, Lucidguppy wrote:
>
> Thanks - you wouldn't believe how many google searches I did - now I 
> find out its in the same book I'm looking at. 
>
> On Oct 15, 10:57 am, Anthony  wrote: 
> > Yes, seehttp://www.web2py.com/book/default/chapter/08#Customizing-Auth. 
> > There are two methods -- using auth.settings.extra_fields (if you just 
> want 
> > to add a few extra fields to the end of the table definition) or creating 
>
> > your own custom auth_user table definition (if you need more thorough 
> > customization). 
> > 
> > Anthony 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Saturday, October 15, 2011 10:50:28 AM UTC-4, Lucidguppy wrote: 
> > 
> > > In auth.define_tables - theres an argument to have a username in the 
> > > table. Which is nice to have. 
> > 
> > > Is there an easy way to use the default auth.define_tables but add a 
> > > couple of extra fields like "favorite_color" and 
> > > "what_is_your_quest"? 
> > 
> > > Thanks



[web2py] Re: plugin_wiki crud and auth

2011-10-15 Thread pinwc4
That is exactly what I needed to know.  I did not realize I could
reference the tables in that manner when setting the permissions.

It works for me now.

Thanks your help is greatly appreciated.


On Oct 15, 9:45 am, Massimo Di Pierro 
wrote:
> You can set permissions for a table that do not exist. Use 'tablename'
> instead of db.tablename. If unsure, post your model.
>
> On Oct 14, 9:26 pm, pinwc4  wrote:


[web2py] Re: plugin_wiki crud and auth

2011-10-15 Thread Massimo Di Pierro
In fact you can also set permissions for "tablename"s which are not
tables at all but just name you give to an object.

On Oct 15, 2:27 pm, pinwc4  wrote:
> That is exactly what I needed to know.  I did not realize I could
> reference the tables in that manner when setting the permissions.
>
> It works for me now.
>
> Thanks your help is greatly appreciated.
>
> On Oct 15, 9:45 am, Massimo Di Pierro 
> wrote:
>
>
>
>
>
>
>
> > You can set permissions for a table that do not exist. Use 'tablename'
> > instead of db.tablename. If unsure, post your model.
>
> > On Oct 14, 9:26 pm, pinwc4  wrote:


[web2py] Re: web2py on GAE and supplementary package usage

2011-10-15 Thread howesc
for libraries that GAE does not provide, put them in a site-packages folder 
just inside the web2py folder.  They will then be on your path.  it is up to 
the user to ensure that the libraries that you include follow the GAE rules.


[web2py] Custom Form Action empty

2011-10-15 Thread miroslavgojic
in controller I have next line for form

form = crud.create(db.name,next=URL('index'),message=T("some text"))

 in view I have

{{=form.custom.begin}}
{{=DIV(DIV('Name:',
_id='two'),DIV(form.custom.widget.fieldname,_id='three'),DIV(form.custom.submit,_id='for'),_id='one')}}
{{=form.custom.end}}

this code produce

 

is is possible to put some value in action and how


[web2py] Re: Custom Form Action empty

2011-10-15 Thread Anthony
After defining the form, try:

form['_action'] = your_value  # e.g., URL('controller', 'function', ...)

You can also do form.update(_action=your_value) or 
form.attributes.update(_action=your_value).

Basically, form is a helper object, _action is an attribute of the helper, 
and helpers behave like Python dictionaries with regard to their attributes 
(so the above are just regular dictionary methods). form.attributes is a 
dictionary storing just the attributes of the form, but you don't have to 
bother accessing it, as you can access the attributes directly from form.

Anthony

On Saturday, October 15, 2011 6:12:02 PM UTC-4, miroslavgojic wrote:
>
> in controller I have next line for form 
>
> form = crud.create(db.name,next=URL('index'),message=T("some text")) 
>
>  in view I have 
>
> {{=form.custom.begin}} 
> {{=DIV(DIV('Name:', 
> _id='two'),DIV(form.custom.widget.fieldname,_id='three'),DIV(form.custom.submit,_id='for'),_id='one')}}
>  
>
> {{=form.custom.end}} 
>
> this code produce 
>
>   
>
> is is possible to put some value in action and how



[web2py] Re: Google App Engine Launcher and Deployment

2011-10-15 Thread Simon Ashley
Thanks. Issue 474.

On Oct 16, 12:47 am, Massimo Di Pierro 
wrote:
> could be a bug in toolbar.  I never tried it in GAE. Open a ticket and
> will fix it asap.
>
> On Oct 15, 2:05 am, Simon Ashley  wrote:
>
>
>
>
>
>
>
> > Just a first time play with this.
> >   (Environment: Python 25, current Web2Py nightly source {copied to
> > the Python25 root} and fresh copy of the Google App Engine Launcher)
> > App is working fine from a command line python25 call
> > When run from the Launcher -> Browse, is fine with a static page, but
> > when accessing data, it throws the following:
>
> > Traceback (most recent call last):
> >   File "C:\Python25\gluon\restricted.py", line 194, in restricted
> >     exec ccode in environment
> >   File "C:/Python25/applications/demurage/views/generic.html", line
> > 98, in 
> >   File "C:\Python25\gluon\globals.py", line 310, in toolbar
> >     for i in thread.instances]
> >   File "C:\Python25\lib\_threading_local.py", line 193, in
> > __getattribute__
> >     return object.__getattribute__(self, name)
> > AttributeError: 'local' object has no attribute 'instances'
>
> > Table is generated in the GAE, data can be imported, but nothing
> > accessed through the application.
>
> > Any ideas?


[web2py] Re: plugin_wiki crud and auth

2011-10-15 Thread pinwc4
That makes sense now and will be very useful in some cases.

I should have just read the source code instead of pestering people as
it is very obvious now that I looked at it.  I just assumed that it
would be too complicated for a beginner like me to understand.  But
that is the beauty I see with Python, reading the code is much simpler
than other languages.



On Oct 15, 3:23 pm, Massimo Di Pierro 
wrote:
> In fact you can also set permissions for "tablename"s which are not
> tables at all but just name you give to an object.
>
> On Oct 15, 2:27 pm, pinwc4  wrote:
>


[web2py] Re: web2py on GAE and supplementary package usage

2011-10-15 Thread Minocha
I used the local_import function after copy-pasting the module
directory into the [application-name]/packages/ folder but even then i
get an error.
Please help

On Oct 15, 4:57 pm, Minocha  wrote:
> i'm new in deploying applications on the GAE using the web2py.
> I wanted to ask what is the procedure to make available external
> libraries for python controllers in web2py on platforms - GAE and also
> on external server where i would like to host a website.


[web2py] metraschedule metra.pickle file

2011-10-15 Thread Chris Steel
Hi Massimo,

Do you or we have the / a metra.pickle file around for metraschedule?
It is not included with the Metraschedule app. I think it used to be
under examples/static/metra.pickle. The app looks for it in
tests/metra.pickle

Thanks,

Christopher Steel

Voice of Access


[web2py] Re: metraschedule metra.pickle file

2011-10-15 Thread Massimo Di Pierro
If it is not in
http://web2py.com/MetraSchedule/static/web2py.app.metraschedule.w2p
then I do not have it.


On Oct 15, 9:43 pm, Chris Steel  wrote:
> Hi Massimo,
>
> Do you or we have the / a metra.pickle file around for metraschedule?
> It is not included with the Metraschedule app. I think it used to be
> under examples/static/metra.pickle. The app looks for it in
> tests/metra.pickle
>
> Thanks,
>
> Christopher Steel
>
> Voice of Access


[web2py] Re: web2py on GAE and supplementary package usage

2011-10-15 Thread Massimo Di Pierro
You should not use local_import. It is deprecated and anyway not
designed for this.

Just put the packages in site-packages, and use normal import. site-
packages is in sys.path.

On Oct 15, 8:54 pm, Minocha  wrote:
> I used the local_import function after copy-pasting the module
> directory into the [application-name]/packages/ folder but even then i
> get an error.
> Please help
>
> On Oct 15, 4:57 pm, Minocha  wrote:
>
>
>
>
>
>
>
> > i'm new in deploying applications on the GAE using the web2py.
> > I wanted to ask what is the procedure to make available external
> > libraries for python controllers in web2py on platforms - GAE and also
> > on external server where i would like to host a website.


[web2py] Debugging with uWSGI

2011-10-15 Thread luckysmack
I want to get dubugging setup, and the main options I see are using
winpdb, pydev, or wingide. But all the examples I see are to debug the
web2py.py app when it is run and the debugger grabs the process. But I
am using the cherokee webserver with uWSGI, so how would U use it in
this way? I want it to grab an existing process and monitor the port
(wingide calls it passive listening, I just don't want to have to buy
wing if I have other good options). I am leaning either towards using
winpdb with my current IDE, or using the pydev plugin in AptanaStudio.

So can anyone recommend how to setup debugging when im not running
web2py.py to start the process? Thanks.