[web2py] Re: Anvanced applications in gae

2010-06-25 Thread dlypka

For starters:

Refer to
http://arbingersys.blogspot.com/2008/04/google-app-engine-one-to-many-join_26.html?showComment=1244344382942#c5661660955046324965

And Here is the posting about using native GAE properties

http://groups.google.com/group/web2py/browse_thread/thread/7112ef7dee1ccf32/d2b0d24c0e499924?lnk=gst&q=native#d2b0d24c0e499924

So for example you would do

from gluon.contrib.gql import gae
:
:
   db.define_table('ChildItem',
# NOTE: web2py provides the 'id'
column automatically
   db.Field('idParentFolder','reference
MyParent'),
   db.Field('name','text'),
   db.Field('gaeParentInstance',
gae.ReferenceProperty(MyParent,
  required=False,
collection_name='linksFromChildItemToParent')))

   )

and define the parent class in a similar fashion.

It is also necessary to add some plumbing to find and track the native
GAE references
which lie underneath the web2py sql objects because the native refs
have to be
put into the collections.

I'll provide more details in some followup posts.

On Jun 25, 2:48 pm, Carles  wrote:
> Thanks a lot Dave.
>
> There isn't a deadline, tale your time :)
>
> Carles
>
> El 25/06/2010, a las 20:42, dlypka  escribió:
>
>
>
> > OK will do - please give me a few days...
>
> > On Jun 24, 8:43 pm, Carles Gonzalez  wrote:
> >> Not to be annoying, but can you post an example?
>
> >> Just to organize the things in my head...
>
> >> Thanks again.
>
> >> On Fri, Jun 25, 2010 at 2:41 AM, Carles Gonzalez  
> >> wrote:
> >>> Very interesting!
>
> >>> I'll try tomorrow.
>
> >>> Thanks a lot, Dave.
>
> >>> On Fri, Jun 25, 2010 at 1:21 AM, dlypka  wrote:
>  I've done a parent - to - many child GAE / web2py implementation using
>  SelfReference  fields (or you can use Reference as well) using the
>  technique for adding native GAE fields into a web2py table definition.
>
>  It gives fantastic retrieval performance because GAE automatically
>  adds the link from the child back into the parent's reference list
>  at the time you create each child.   When you later query for the
>  parent, voila GAE retrieves all the child entities along with it in
>  one backend call!
>
>  Hopefully this technique is relevant to your application.
>
>  I also develop some other tricks for inheriting native GAE classes
>  into your web2py model, though
>  this is less attractive perhaps now that GAE native properties can be
>  directly declared in web2py tables.
>
>  - Dave Lypka.
>
>  On Jun 21, 10:25 am, Carles Gonzalez  wrote:
> > Hi,
>
> > I have developed some applications in web2py, and 2 are running
> > currently in gae, but now i have serious problem.
>
> > My current project is a social application, and when i design
> > (example) the tables to make an user follow the actions other user
> > (twitter like) I find that many-to-many relationships in app-engine
> > are not easily supported.
>
> > From my understanding using the tools present in web2py right i would
> > need to do a lot of processing in memory, an that would hurt
> > performance greatly.
>
> > The pattern proposed by app store developers uses lists and "parent"
> > relationship:
>
> > class Message(db.Model):
> >     sender = db.StringProperty()
> >     body = db.TextProperty()
>
> > class MessageIndex(db.Model):
> >     receivers = db.StringListProperty()
>
> > indexes = MessageIndex.all(keys_only = True).filter('receivers = ', 
> > user_id)
> > keys = [k.parent() for k in indexes)
> > messages = db.get(keys)
>
> > For using that pattern in web2py I would need a method for specifying
> > the parent of a model instance. Can I specify that relationship using
> > any method I don't know? If not, would it be hard to implement?
>
> > Thanks in advance!


Re: [web2py] change the encoding

2010-06-25 Thread Álvaro Justen
On Thu, Jun 24, 2010 at 12:22, Jose  wrote:
> Hi,
>
> How can I change the encoding of the files edited with the editor's
> own web2py?

I think it is not a easy thing to do: you will need to modify the way
admin works with encoding. By default, web2py applications are UTF-8,
so you need to change the app admin to return and get latin1 to/from
the user (you need to change META tags on HTML and probably one HTTP
header). I don't know if internal web2py code is prepared to support
other encoding than utf-8.

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


Re: [web2py] a problem with routes.py

2010-06-25 Thread Álvaro Justen
On Fri, Jun 25, 2010 at 09:40, ilovesss2004  wrote:
> Hi,
> Here is code of my routes.py
>
> routes_in = (('/', '/myapp/default/index'),
>            )
>
> routes_out = (('/myapp/default/index', '/'),
>            )
>
> When I enter 127.0.0.1:8000 in browser, myapp do show but the ajax
> function does't work. I must enter 127.0.0.1:8000/myapp/default/index
> in browser then the ajax function will act.

Probably you are not calling the correct URLs for JavaScript/CSS/whatever.
Try to figure out what URLs your AJAX functions are calling (use print
and you'll get it on the shell, for example) to investigate.

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


[web2py] Web2Py Online Directory App

2010-06-25 Thread David
Has anyone completed an online directory type of application with
web2py before?

I've been asked to build a local city directory of vendors and
services that clients can log into and pay for products and services.
I thought web2py would be a good test for this kind of application but
I don't want to reinvent something that's already been done before if
it has.

Also I would need to find more information on payment processing for
online ad space etc.  I saw the paypal module but I would rather stay
away from that company since it is a private entity and not subject to
US banking rules.

Thanks,
David


[web2py] Re: change the encoding

2010-06-25 Thread NetAdmin
Oh Sorry,

I only use vi as my editor.



On Jun 25, 5:24 pm, Jose  wrote:
> On 25 jun, 18:24, NetAdmin  wrote:
>
> > OK,
>
> > I use Linux and vi
> > Here are my settings
>
> >   scroll=11           ttyfast
> >   fileencoding=utf-8
> >   fileencodings=ucs-bom,utf-8,default,latin1
> >   runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/
> > share/vim/
> > vim71,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/
> > after
>
> Okay, but I mean to choose the encoding from web2py web editor.


[web2py] Re: change the encoding

2010-06-25 Thread Jose


On 25 jun, 18:24, NetAdmin  wrote:
> OK,
>
> I use Linux and vi
> Here are my settings
>
>   scroll=11           ttyfast
>   fileencoding=utf-8
>   fileencodings=ucs-bom,utf-8,default,latin1
>   runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/
> share/vim/
> vim71,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/
> after

Okay, but I mean to choose the encoding from web2py web editor.


[web2py] Re: dynamic tables / expando object / GAE

2010-06-25 Thread mdipierro
yes you can do that

On Jun 25, 4:16 pm, NickFranceschina 
wrote:
> is it possible during runtime to create new table definitions and have
> them executed?   so instead of putting my models in db.py, I could
> pull the meta-data from a database and build the model on the fly when
> the app starts up?  (if it is on SQL, it will do the usual maintenance
> stuff... if it is on GAE it doesn't do anything)
>
> I'd like to let users create their own "types"... on GAE this is easy
> as there is no hard "schema" to follow... but I want the app to work
> both on GAE and SQL (which is why I'm using Web2py)... so wondering
> how that would work if I tried to define a table on the fly:
>
> i.e.
>
> default.py
>
>   def index():
>
>      fields = get_fields(); #returns a list of Field() objects
>      tbl = db.define_table(mytable,fields)
>
> Thank you,
> -Nick Franceschina


[web2py] Re: Forms partly filled with data from tables.

2010-06-25 Thread mdipierro
i'd use jqgrid

On Jun 25, 3:13 pm, Johann Spies  wrote:
> I suppose I will have to find a way to combine SQLTable and SQLForm :)
>
> Example
>
> Table A:
>
> Surname  |   Name |  School |  someotherdata...
>
> a               |       b    |    c        | ...
> d               |      e     |    f         | ...
>
> These people attend courses.  Another table (say B)  contains the
> attendance lists.
>
> What the customer wants is that when course "somecourse"  is selected
> with the purpose of filling in the attendance the form (which will
> populate table B)
>  should  be prepopulated from Table A and look like this :
>
> Course: Somecourse
>
> Teachers present:
>
> Surname  |  Name |  School | Time in              | Time out
>  a              |    b      |      c       | [to be filled in]   | [to
> be filled in]
>  d             |    e      |      f        | [to be filled in]   | [to
> be filled in]
>
> Each row in this form will be a new record in Table B. The customer
> wants the form to look like a paper form with the list of names of
> attendees thereon.
>
> Now my question:  How would you do this in the most efficient way?
>
> A Grid?
> Regards
> Johann
>
> --
> --
> "Finally, brethren, whatsoever things are true,  whatsoever things are
> honest, whatsoever things are  just, whatsoever things are pure,
> whatsoever things are lovely, whatsoever things are of good report; if
> there be any virtue, and if there be any praise, think on these
> things."    Philippians 4:8


[web2py] Re: GAE / Case sensitivity / canonical validator?

2010-06-25 Thread mdipierro
While it sould be easy to write such validator using the like
operator, it would not be portable because it would not work on gae
and would be slow in general. The preferred way is to use a hidden
autocomputed normalized field.

On Jun 25, 10:54 am, NickFranceschina 
wrote:
> Massimo,
>
> just realized that GQL does not allow for LOWER() or UPPER()... thus
> cannot do case-insensitive searches.  the generally suggested solution
> is to create another field and store the canonical form of the string
> you're trying to search
>
> example:
>   person.name = "Nick Franceschina"
>   person.canonical = "nick franceschina"
>
> would be nice to have a validator that could do this automatically...
> it would work like the IS_LOWER() validator, but would look into
> another field for the data... something like:
>   Field('canonical', 'string', requires=CANONICAL('person.name'))
>
> then I just put my data into "name" as I always do, and wouldn't have
> to write special code to do the canonical field...
>
> is there anything like this now, and I'm not seeing it?  i'll keep
> looking...
>
> Thanks,
> -Nick Franceschina


[web2py] Re: httpserver.log graphical stats

2010-06-25 Thread mdipierro
http://web2py.com/appliances/default/show/27

On Jun 25, 10:42 am, selecta  wrote:
> how can I get some nice graphical statistics from the httpserver.log?
> I tried to use webalizer but it cannot parse the log format, any other
> suggestions or fixes?


[web2py] Re: change the encoding

2010-06-25 Thread NetAdmin
OK,

I use Linux and vi
Here are my settings

  scroll=11   ttyfast
  fileencoding=utf-8
  fileencodings=ucs-bom,utf-8,default,latin1
  runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/
share/vim/
vim71,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/
after

On Jun 25, 3:43 pm, Jose  wrote:
> thank Mr.netadmin,
>
> I use FreeBSD and my shell is csh.
>
> % Echo $ LANG
> es_ES.ISO8859-1
>
> ISO8859-1 is Latin1, but coding of files created corresponds to utf-8.
>
> Jose


[web2py] How to enable "request_reset_password" function?

2010-06-25 Thread elfuego1
Hello,

I try to enable "request_reset_password" function but every time I
enter this page:
http://127.0.0.1:8000/project/default/user/request_reset_password I
receive message that the function is disabled.

Can you please tell me what should I do and  where to get it working?

Thank you in advance,
Andrew.


[web2py] dynamic tables / expando object / GAE

2010-06-25 Thread NickFranceschina
is it possible during runtime to create new table definitions and have
them executed?   so instead of putting my models in db.py, I could
pull the meta-data from a database and build the model on the fly when
the app starts up?  (if it is on SQL, it will do the usual maintenance
stuff... if it is on GAE it doesn't do anything)

I'd like to let users create their own "types"... on GAE this is easy
as there is no hard "schema" to follow... but I want the app to work
both on GAE and SQL (which is why I'm using Web2py)... so wondering
how that would work if I tried to define a table on the fly:

i.e.

default.py

  def index():

 fields = get_fields(); #returns a list of Field() objects
 tbl = db.define_table(mytable,fields)



Thank you,
-Nick Franceschina


[web2py] Re: change the encoding

2010-06-25 Thread Jose
thank Mr.netadmin,

I use FreeBSD and my shell is csh.

% Echo $ LANG
es_ES.ISO8859-1

ISO8859-1 is Latin1, but coding of files created corresponds to utf-8.

Jose


[web2py] Forms partly filled with data from tables.

2010-06-25 Thread Johann Spies
I suppose I will have to find a way to combine SQLTable and SQLForm :)

Example

Table A:

Surname  |   Name |  School |  someotherdata...

a   |   b|c| ...
d   |  e |f | ...

These people attend courses.  Another table (say B)  contains the
attendance lists.

What the customer wants is that when course "somecourse"  is selected
with the purpose of filling in the attendance the form (which will
populate table B)
 should  be prepopulated from Table A and look like this :

Course: Somecourse

Teachers present:

Surname  |  Name |  School | Time in  | Time out
 a  |b  |  c   | [to be filled in]   | [to
be filled in]
 d |e  |  f| [to be filled in]   | [to
be filled in]

Each row in this form will be a new record in Table B. The customer
wants the form to look like a paper form with the list of names of
attendees thereon.

Now my question:  How would you do this in the most efficient way?

A Grid?
Regards
Johann

-- 
-- 
"Finally, brethren, whatsoever things are true,  whatsoever things are
honest, whatsoever things are  just, whatsoever things are pure,
whatsoever things are lovely, whatsoever things are of good report; if
there be any virtue, and if there be any praise, think on these
things."Philippians 4:8


[web2py] Re: Downloading from "private" folder

2010-06-25 Thread weheh
Don't know what a range request is or what the syntax is of the stream
statement, but I'll do some reading and see if I can figure it out.
Can you point me at some doc on the subject?

On Jun 25, 2:14 am, mdipierro  wrote:
> The built-in download function can stream if it receives a range
> request from the client.
>
> On Jun 24, 3:35 pm, weheh  wrote:
>
>
>
> > Thanks! Makes sense. What method would you use to stream an mp3, ogg,
> > wav ... or other audio file? Also, could you clarify what the
> > "filename" argument represents -- is it the name you want the file to
> > be or the name of the file being input (I believe it's the latter)?
>
> > On Jun 24, 11:33 am, mdipierro  wrote:
>
> > > If you apply access control to your files, than they are referenced by
> > > the database. In this case you should use the
> > > db.table.field.store(stream,filename) method to store the stream into
> > > uploads. If there is no access control put it in static.
>
> > > On Jun 24, 10:14 am, weheh  wrote:
>
> > > > So where would I put text and mp3 files that are created by my system
> > > > (not uploaded) and available to end users subject to access control:
> > > > static or uploads? That doesn't seem to fall into any of your
> > > > conventional categories.
>
> > > > On Jun 24, 8:30 am, mdipierro  wrote:
>
> > > > > My convention is:
>
> > > > > static: files that are public
> > > > > uploads: files that are uploaded into the system and may be subject to
> > > > > access control
> > > > > private: files that the app needs but are not sent over the network
>
> > > > > If you use the built-in upload mechanism it is not a good idea to move
> > > > > the file.
>
> > > > > On Jun 23, 12:13 pm, weheh  wrote:
>
> > > > > > Massimo, thanks for the app. I'm studying it.
>
> > > > > > From the doc, I'm not sure I get a crystal clear understanding of 
> > > > > > what
> > > > > > the web2py convention is.
>
> > > > > > Let's say my app lets you upload a music mp3 file, a file with a
> > > > > > description (liner notes), and a jpeg (album cover). These get
> > > > > > uploaded to "uploads". Should I allow them to be downloaded from
> > > > > > uploads or do I need to move them both to "static" first?
>
> > > > > > What if I mix the uploaded mp3 with some more music to make another
> > > > > > mp3 file, which isn't uploaded. Should it be moved to the static
> > > > > > folder?
>
> > > > > > Finally, the doc says, "private files are accessed by the 
> > > > > > controllers
> > > > > > but not directly by the
> > > > > > developer." I've been trying to parse that statement but it makes no
> > > > > > sense to me. I'm the developer. I write the controller. My 
> > > > > > controller
> > > > > > tries to access private directly. Does that make me not the 
> > > > > > developer?
> > > > > > So what exactly is the purpose of the private folder?
>
> > > > > > On Jun 23, 3:15 am, mdipierro  wrote:
>
> > > > > > > Two issues:
>
> > > > > > > - you are donwloading from private not uploads folder. Thenically 
> > > > > > > this
> > > > > > > is ok but not a web2py convention. You should not expose the 
> > > > > > > content
> > > > > > > for the private folder. That is why it is called private. ;-)
>
> > > > > > > - you used embed to embed a file, but it should be used to embed a
> > > > > > > plugin. I have used a flash plugin for this purpose.
>
> > > > > > > Here is an app to manage music files that you can use as example:
>
> > > > > > >http://web2py.com/examples/static/web2py.app.music.w2p
>
> > > > > > > Massimo
>
> > > > > > > On Jun 22, 10:50 pm, weheh  wrote:
>
> > > > > > > > Continuing this old 
> > > > > > > > thread:http://groups.google.com/group/web2py/browse_thread/thread/59b66b3a24...
>
> > > > > > > > I'm having trouble getting an embedded mp3 from showing up in 
> > > > > > > > my web
> > > > > > > > page. I'm trying to implement this almost exactly as Massimo 
> > > > > > > > suggested
> > > > > > > > in the above thread. Anybody know why my code below isn't 
> > > > > > > > functioning?
>
> > > > > > > > #controller "audio.py"
> > > > > > > > def download_audio():
> > > > > > > >   f=os.path.join(request.folder,'private',request.args(0))
> > > > > > > >   return response.stream(open(f,'rb'))
>
> > > > > > > > #model "show_audio.py"
> > > > > > > > def show_audio():
> > > > > > > >   filename='audio/aab/hello_world.mp3'  # this is a hardcoded 
> > > > > > > > value
> > > > > > > > for this test case
> > > > > > > >   url=URL(r=request,c='audio',f='download_audio',args=filename)
> > > > > > > >   return EMBED(_src=url,_autoplay='true')
>
> > > > > > > > #view "index.html"
> > > > > > > > {{=show_audio()}}- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


[web2py] Re: Web2py Application Exhibition

2010-06-25 Thread NetAdmin

I'm the sole person behind the project right now. I may
ask others to help judge if I'm overwhelmed by the amount
of submissions.

Mr.Netadmin


On Jun 25, 10:47 am, Albert Abril  wrote:
> Nice :)
>
> Who's behind this challenge?
> I meant, who wanna judge? pay? etc.
>
> Thanks in advance.
>
> On Fri, Jun 25, 2010 at 10:28 AM, NetAdmin  wrote:
> > Web2py Application Exhibition
>
> > Do you have a Web2py app that you'd like to show the world?
> > If so, you may be interested in the Web2py Application Exhibition.
>
> > The WAE is a way to...
> > 1. Demonstrate what can be done with Web2py.
> > 2. Share and learn about useful web2py, python, Javascript, jQuery
> > etc. techniques.
> > 3. Earn some money toward that new  you've been craving.
>
> > Projects will be judged in the following areas.
>
> > Ease of use
> > Usefulness
> > Visual Appeal
>
> > The Rules
> > 1. Applications must be submitted no later than July 30, 2010
> > 2. Source must be included with your submissions.
> > 3. If the application is written by a team, Massimo can NOT be part of
> > the team.
> > 4. After a 2 week review period, on August 15, 2010, the winners will
> > be
> >   announced on the web2py-users list.
> > 5. The 1st place winner will receive $100 US Dollars, 2nd place will
> > receive $50
> > 6. You must enjoy using Web2py!
>
> > Massimo is not affiliated with this exhibition, ( maybe he'll help
> > judge if I can twist his arm )
> > so, if you have any questions or comments, I can be contacted at
> > mr.netad...@gmail.com


[web2py] Re: change the encoding

2010-06-25 Thread NetAdmin

I'm not sure if  you're using Linux, but if so, you may want to
try changing this setting in your bash_profile.

LC_ALL=en_US.utf8

I hope this helps

Mr.netadmin


On Jun 25, 6:11 am, Jose  wrote:
> On 24 jun, 13:27, mdipierro  wrote:
>
> > I do not know if that is possible
>
> I need to save files to latin1 instead of utf8 (apparently default). I
> know I can use iconv, but it gets annoying having to do so.
>
> Regards
> Jose


[web2py] Lazy loading

2010-06-25 Thread Carles
Is there any manner to lazy-load the components of web2py.

Sometimes load all the framework at the start is overkill.

Carles


Re: [web2py] Re: Anvanced applications in gae

2010-06-25 Thread Carles
Thanks a lot Dave.

There isn't a deadline, tale your time :)

Carles

El 25/06/2010, a las 20:42, dlypka  escribió:

> OK will do - please give me a few days...
> 
> On Jun 24, 8:43 pm, Carles Gonzalez  wrote:
>> Not to be annoying, but can you post an example?
>> 
>> Just to organize the things in my head...
>> 
>> Thanks again.
>> 
>> 
>> 
>> On Fri, Jun 25, 2010 at 2:41 AM, Carles Gonzalez  wrote:
>>> Very interesting!
>> 
>>> I'll try tomorrow.
>> 
>>> Thanks a lot, Dave.
>> 
>>> On Fri, Jun 25, 2010 at 1:21 AM, dlypka  wrote:
 I've done a parent - to - many child GAE / web2py implementation using
 SelfReference  fields (or you can use Reference as well) using the
 technique for adding native GAE fields into a web2py table definition.
>> 
 It gives fantastic retrieval performance because GAE automatically
 adds the link from the child back into the parent's reference list
 at the time you create each child.   When you later query for the
 parent, voila GAE retrieves all the child entities along with it in
 one backend call!
>> 
 Hopefully this technique is relevant to your application.
>> 
 I also develop some other tricks for inheriting native GAE classes
 into your web2py model, though
 this is less attractive perhaps now that GAE native properties can be
 directly declared in web2py tables.
>> 
 - Dave Lypka.
>> 
 On Jun 21, 10:25 am, Carles Gonzalez  wrote:
> Hi,
>> 
> I have developed some applications in web2py, and 2 are running
> currently in gae, but now i have serious problem.
>> 
> My current project is a social application, and when i design
> (example) the tables to make an user follow the actions other user
> (twitter like) I find that many-to-many relationships in app-engine
> are not easily supported.
>> 
> From my understanding using the tools present in web2py right i would
> need to do a lot of processing in memory, an that would hurt
> performance greatly.
>> 
> The pattern proposed by app store developers uses lists and "parent"
> relationship:
>> 
> class Message(db.Model):
> sender = db.StringProperty()
> body = db.TextProperty()
>> 
> class MessageIndex(db.Model):
> receivers = db.StringListProperty()
>> 
> indexes = MessageIndex.all(keys_only = True).filter('receivers = ', 
> user_id)
> keys = [k.parent() for k in indexes)
> messages = db.get(keys)
>> 
> For using that pattern in web2py I would need a method for specifying
> the parent of a model instance. Can I specify that relationship using
> any method I don't know? If not, would it be hard to implement?
>> 
> Thanks in advance!


[web2py] Re: Anvanced applications in gae

2010-06-25 Thread dlypka
OK will do - please give me a few days...

On Jun 24, 8:43 pm, Carles Gonzalez  wrote:
> Not to be annoying, but can you post an example?
>
> Just to organize the things in my head...
>
> Thanks again.
>
>
>
> On Fri, Jun 25, 2010 at 2:41 AM, Carles Gonzalez  wrote:
> > Very interesting!
>
> > I'll try tomorrow.
>
> > Thanks a lot, Dave.
>
> > On Fri, Jun 25, 2010 at 1:21 AM, dlypka  wrote:
> >> I've done a parent - to - many child GAE / web2py implementation using
> >> SelfReference  fields (or you can use Reference as well) using the
> >> technique for adding native GAE fields into a web2py table definition.
>
> >> It gives fantastic retrieval performance because GAE automatically
> >> adds the link from the child back into the parent's reference list
> >> at the time you create each child.   When you later query for the
> >> parent, voila GAE retrieves all the child entities along with it in
> >> one backend call!
>
> >> Hopefully this technique is relevant to your application.
>
> >> I also develop some other tricks for inheriting native GAE classes
> >> into your web2py model, though
> >> this is less attractive perhaps now that GAE native properties can be
> >> directly declared in web2py tables.
>
> >> - Dave Lypka.
>
> >> On Jun 21, 10:25 am, Carles Gonzalez  wrote:
> >>> Hi,
>
> >>> I have developed some applications in web2py, and 2 are running
> >>> currently in gae, but now i have serious problem.
>
> >>> My current project is a social application, and when i design
> >>> (example) the tables to make an user follow the actions other user
> >>> (twitter like) I find that many-to-many relationships in app-engine
> >>> are not easily supported.
>
> >>> From my understanding using the tools present in web2py right i would
> >>> need to do a lot of processing in memory, an that would hurt
> >>> performance greatly.
>
> >>> The pattern proposed by app store developers uses lists and "parent"
> >>> relationship:
>
> >>> class Message(db.Model):
> >>>     sender = db.StringProperty()
> >>>     body = db.TextProperty()
>
> >>> class MessageIndex(db.Model):
> >>>     receivers = db.StringListProperty()
>
> >>> indexes = MessageIndex.all(keys_only = True).filter('receivers = ', 
> >>> user_id)
> >>> keys = [k.parent() for k in indexes)
> >>> messages = db.get(keys)
>
> >>> For using that pattern in web2py I would need a method for specifying
> >>> the parent of a model instance. Can I specify that relationship using
> >>> any method I don't know? If not, would it be hard to implement?
>
> >>> Thanks in advance!


Re: [web2py] Re: a problem with routes.py

2010-06-25 Thread Vasile Ermicioi
may be you can post some of your ajax code: controller and view

also if there is an error it should be saved by web2py (even if it is ajax),
what it tells ?

check yourapp/errors/ folder


Re: [web2py] Re: elFinder-web2py , Filemanager for Web2py!

2010-06-25 Thread Giuseppe Luca Scrofani
Even following your indication I can't make it work :( I will retry
after dinner. I am surprised of how this project seems not interesting
to the others... It is very strange, In my humble, I think this have
to be shipped by default in web2py...


[web2py] GAE / Case sensitivity / canonical validator?

2010-06-25 Thread NickFranceschina
Massimo,

just realized that GQL does not allow for LOWER() or UPPER()... thus
cannot do case-insensitive searches.  the generally suggested solution
is to create another field and store the canonical form of the string
you're trying to search

example:
  person.name = "Nick Franceschina"
  person.canonical = "nick franceschina"


would be nice to have a validator that could do this automatically...
it would work like the IS_LOWER() validator, but would look into
another field for the data... something like:
  Field('canonical', 'string', requires=CANONICAL('person.name'))

then I just put my data into "name" as I always do, and wouldn't have
to write special code to do the canonical field...


is there anything like this now, and I'm not seeing it?  i'll keep
looking...

Thanks,
-Nick Franceschina


Re: [web2py] Web2py Application Exhibition

2010-06-25 Thread Albert Abril
Nice :)

Who's behind this challenge?
I meant, who wanna judge? pay? etc.

Thanks in advance.

On Fri, Jun 25, 2010 at 10:28 AM, NetAdmin  wrote:

> Web2py Application Exhibition
>
>
> Do you have a Web2py app that you'd like to show the world?
> If so, you may be interested in the Web2py Application Exhibition.
>
> The WAE is a way to...
> 1. Demonstrate what can be done with Web2py.
> 2. Share and learn about useful web2py, python, Javascript, jQuery
> etc. techniques.
> 3. Earn some money toward that new  you've been craving.
>
> Projects will be judged in the following areas.
>
> Ease of use
> Usefulness
> Visual Appeal
>
> The Rules
> 1. Applications must be submitted no later than July 30, 2010
> 2. Source must be included with your submissions.
> 3. If the application is written by a team, Massimo can NOT be part of
> the team.
> 4. After a 2 week review period, on August 15, 2010, the winners will
> be
>   announced on the web2py-users list.
> 5. The 1st place winner will receive $100 US Dollars, 2nd place will
> receive $50
> 6. You must enjoy using Web2py!
>
> Massimo is not affiliated with this exhibition, ( maybe he'll help
> judge if I can twist his arm )
> so, if you have any questions or comments, I can be contacted at
> mr.netad...@gmail.com
>


[web2py] httpserver.log graphical stats

2010-06-25 Thread selecta
how can I get some nice graphical statistics from the httpserver.log?
I tried to use webalizer but it cannot parse the log format, any other
suggestions or fixes?


[web2py] Re: Generate input from db field...

2010-06-25 Thread Yarko Tymciurak
On Jun 25, 3:50 am, Andrew Buchan  wrote:
> Yarko,
>
> I tried doing this with a DIV, but if I put the whole form within the DIV,

I meant submitting the first form, and doing a LOAD() in another part
of the page conditionally, based on some submit value of the first
form (instead of directing to another page).

I haven't done this, but it _should_ be straightforward.

I do understand the "running out of time" piece.

- Yarko

> that doesn't seem to work. If you mean just putting the input fields in the
> DIV, with the submit button outside of that, then that's what my original
> question was about: how to generate a table with labels/inputs by passing a
> list of Fields. Or did you mean a different way, I'm all ears :-)
> As long as I can use form.accepts to validate just those fields which are
> displayed, then it should work for me.
> Having said that, I'm past my deadline and struggling for time, and this is
> really a nice to have which I can't afford to spend too much time on before
> launching. But still, all suggestions are most welcome...
>
> On Fri, Jun 25, 2010 at 9:37 AM, Yarko Tymciurak <
>
> resultsinsoftw...@gmail.com> wrote:
> > On Jun 25, 3:24 am, Andrew Buchan  wrote:
> > > Sorry for delay in getting back. I eventually opted for a solution which
> > > does not involve JQuery, instead a department-specific list of fields is
> > > passed to SQLForm, which makes things so much simpler.
> > > The only draw back is that the user has to select a department on one
> > page,
> > > and is then redirected to another page with the 'create' form, but that's
> > a
> > > small price to pay for the simplicity of using self-submitting forms
>
> > If that's how you are doing it, then it would be a very small step to
> > make that "other page"
> > an ajax loaded css element on the first page - i.e.   first part of
> > form submitted gets
> > the second part of the page loaded.
>
> > > thereafter (after creating the initial record, 5 other actions can be
> > taken
> > > on it, and for all of those the department is already known, so it's
> > > easier).
> > > Anyway, thanks for the suggestions, and I now know a bit about JQuery
> > which
> > > will no doubt come in useful one day.
> > > Regards,
>
> > > On Tue, Jun 22, 2010 at 5:15 PM, mdipierro 
> > wrote:
> > > > This is no longer a client issue. I think you do handle the problem
> > > > correctly client side.
> > > > The problem is that if some fields exist in db but you do not want to
> > > > insert them you need to change the validator from
>
> > > > db.table.field.requires=blabla()
>
> > > > into
>
> > > > db.table.field.requires=IS_EMPTY_OR(blabla())
>
> > > > You can do this conditionally:
>
> > > > if request.vars.selectorfield='whatever':
> > > >    db.table.field.requires=IS_EMPTY_OR(blabla())
>
> > > > On Jun 22, 9:56 am, Andrew Buchan  wrote:
> > > > > Hi Massimo,
>
> > > > > I posted the code below before checking if the form would actually
> > > > submit.
> > > > > What now happens is that all the fields are put through validation,
> > > > > including those which I hid with JQuery, and needless to say, most of
> > > > them
> > > > > fail because they're empty!
>
> > > > > There's no way I can do away with the validators, and I'm struggling
> > to
> > > > > find-out how to make it not validate those fields I hid. If I can't
> > then
> > > > > I've just thrown away a crucial 5 hours on JQuery, nice learning
> > > > experience
> > > > > but if I have to start again with a different approach I won't be a
> > happy
> > > > > bunny and neither will my client :-|
>
> > > > > Any suggestions?
>
> > > > > On Tue, Jun 22, 2010 at 2:27 PM, Andrew Buchan 
> > > > wrote:
> > > > > > Massimo,
>
> > > > > > Thanks for that, I was about to reply saying that JQuery can't do
> > what
> > > > I
> > > > > > want it to, then thought I'd test my statement before making it.
> > Here's
> > > > the
> > > > > > code for anyone who's interested:
>
> > > > > > Its all in the controller, as I pretty much use only one single
> > > > > > multi-purpose view for all my pages :-)
>
> > > > > > 
>
> > > > > >     #Fields to be visible for all departments
> > > > > >     commonFields = [
> > > > > >         'Details',
> > > > > >         'Suggested_Action'
> > > > > >     ]
> > > > > >     form = SQLFORM.factory(db[TableName])
>
> > > > > >     #Create dict of department-specific fields, this is where you
> > make
> > > > > > changes when departments change the fields they require
> > > > > >     #Note: must all exist in table def in model, exclude common
> > fields
> > > > in
> > > > > > list above.
> > > > > >     DepartmentFields = dict()
> > > > > >     DepartmentFields['IT'] = ['Contract_Number', 'Details']
> > > > > >     DepartmentFields['Projects'] = ['Work_Order_Number',
> > > > > > 'Sales_Order_Number', 'Client']
>
> > > > > >     #Create javascript/JQuery string for department select's
> > onChange
> > > > > > event...
> > > > > >     deptchange = "$(\"TR[id^=

[web2py] Re: upload bug in filename

2010-06-25 Thread Yarko Tymciurak
Perhaps you can give us a few more specifics about your system, and
your test methods.

It seems that there is a filename limit of 226 (?) characters, and a
path limit of 255 characters on FAT32 filesystems (although brief
googling shows some inconsistent data).

In any case, there should be a specific error code - it would be good
to see if this makes it through back into python, and then ensure we
are doing appropriate exception catching.

Thank you,

- Yarko

On Jun 25, 3:39 am, Swell  wrote:
> Ok i have been able to reproduce the bug ,
> it works perfectly if the web2py tree is in c:\
> it doesnot if it is copied on the desktop(C:\Users\M\Desktop\web2py)
>
> so it seems that it is related the filenamepath(basename+filename)


Re: [web2py] Re: a problem with routes.py

2010-06-25 Thread Jonathan Lundell
On Jun 25, 2010, at 7:33 AM, ilovesss2004 wrote:

> the same

And with no routes.py at all?

> 
> On Jun 25, 4:18 pm, Jonathan Lundell  wrote:
>> On Jun 25, 2010, at 5:40 AM, ilovesss2004 wrote:
>> 
>>> Here is code of my routes.py
>> 
>>> routes_in = (('/', '/myapp/default/index'),
>>>)
>> 
>>> routes_out = (('/myapp/default/index', '/'),
>>>)
>> 
>>> When I enter 127.0.0.1:8000 in browser, myapp do show but the ajax
>>> function does't work. I must enter 127.0.0.1:8000/myapp/default/index
>>> in browser then the ajax function will act.
>> 
>> You might try:
>> 
>> routes_in = (('/?', '/myapp/default/index'),
>>)




Re: [web2py] Using username field instead of email field in Auth

2010-06-25 Thread Mathieu Clabaut
In your model (db.py) set at the beginning :

from gluon.tools import *
auth=Auth(globals(),db)
auth.define_tables(username=True)


Best regards,

-Mathieu
On Fri, Jun 25, 2010 at 14:03, Jacques van der Merwe
wrote:

> Greetings all,
>
> I would like to use an alternative authentication like LDAP for
> example, but would like to use the 'username' field instead of the
> default 'email' field. In the web2py book, it says "By default, Auth
> uses email and password for login, but it can, optionally, use
> username instead of email." I am struggling to find where to set this
> option. I've dug around in tools.py where the Auth class is defined,
> but I still cannot locate it.
>
> I would assume that when this option is set, the user/login form
> changes the email field to a username field? I hope this is the
> case. :)
>
> Any advice would be most welcome!
>
> Cheers,
> -Jacques


[web2py] Re: a problem with routes.py

2010-06-25 Thread ilovesss2004
the same

On Jun 25, 4:18 pm, Jonathan Lundell  wrote:
> On Jun 25, 2010, at 5:40 AM, ilovesss2004 wrote:
>
> > Here is code of my routes.py
>
> > routes_in = (('/', '/myapp/default/index'),
> >            )
>
> > routes_out = (('/myapp/default/index', '/'),
> >            )
>
> > When I enter 127.0.0.1:8000 in browser, myapp do show but the ajax
> > function does't work. I must enter 127.0.0.1:8000/myapp/default/index
> > in browser then the ajax function will act.
>
> You might try:
>
> routes_in = (('/?', '/myapp/default/index'),
>            )


[web2py] Using username field instead of email field in Auth

2010-06-25 Thread Jacques van der Merwe
Greetings all,

I would like to use an alternative authentication like LDAP for
example, but would like to use the 'username' field instead of the
default 'email' field. In the web2py book, it says "By default, Auth
uses email and password for login, but it can, optionally, use
username instead of email." I am struggling to find where to set this
option. I've dug around in tools.py where the Auth class is defined,
but I still cannot locate it.

I would assume that when this option is set, the user/login form
changes the email field to a username field? I hope this is the
case. :)

Any advice would be most welcome!

Cheers,
-Jacques


Re: [web2py] a problem with routes.py

2010-06-25 Thread Jonathan Lundell
On Jun 25, 2010, at 5:40 AM, ilovesss2004 wrote:

> Here is code of my routes.py
> 
> routes_in = (('/', '/myapp/default/index'),
>)
> 
> routes_out = (('/myapp/default/index', '/'),
>)
> 
> When I enter 127.0.0.1:8000 in browser, myapp do show but the ajax
> function does't work. I must enter 127.0.0.1:8000/myapp/default/index
> in browser then the ajax function will act.

You might try:

routes_in = (('/?', '/myapp/default/index'),
   )


[web2py] Re: a problem with routes.py

2010-06-25 Thread ilovesss2004
The same...

On Jun 25, 3:21 pm, Vasile Ermicioi  wrote:
> what happens if you delete routes_out ?


Re: [web2py] a problem with routes.py

2010-06-25 Thread Vasile Ermicioi
what happens if you delete routes_out ?


[web2py] a problem with routes.py

2010-06-25 Thread ilovesss2004
Hi,
Here is code of my routes.py

routes_in = (('/', '/myapp/default/index'),
)

routes_out = (('/myapp/default/index', '/'),
)

When I enter 127.0.0.1:8000 in browser, myapp do show but the ajax
function does't work. I must enter 127.0.0.1:8000/myapp/default/index
in browser then the ajax function will act.


[web2py] Unit Test in GAE

2010-06-25 Thread PanosJee
Hello everyone,
I want to test my in GAE environment because i want to use the task
queue and some custom GQL queries. I am trying to use Jon Romero 's
slice (http://www.web2pyslices.com/main/slices/take_slice/67  )
The problem is that it starts a web2py console and try to use sqlite
or mysql. Is it possible to launch web2py console in GAE environment?


[web2py] Re: change the encoding

2010-06-25 Thread Jose


On 24 jun, 13:27, mdipierro  wrote:
> I do not know if that is possible
>

I need to save files to latin1 instead of utf8 (apparently default). I
know I can use iconv, but it gets annoying having to do so.

Regards
Jose


[web2py] Re: ajax background function crashes web2py fcgi handler

2010-06-25 Thread ScOut3R
Sure, same results. It crashes at the return function.

On Jun 25, 11:56 am, mdipierro  wrote:
> can you try 1.79.2?
>
> Massimo
>
> On Jun 25, 4:52 am, ScOut3R  wrote:
>
>
>
> > Hello there again!
>
> > I've added some logging and with a double click submit I can see the
> > the response crashes before the return UL(*items).xml() part in the
> > first search function.
>
> > I hope this helps.
>
> > Best regards,
> > Mate
>
> > On Jun 24, 8:57 pm, ScOut3R  wrote:
>
> > > I've added session.unlock to each of the functions and it seems stable
> > > except under one condition and that is if I'm accidentally double
> > > click the submit button.
>
> > > I'm using MySQL as the backend.
>
> > > The first function (bg_quick_dvd()) got executed and it returns the
> > > value but the following just times out. I'll try to figure out at
> > > which part.
>
> > > On Jun 24, 8:24 pm, mdipierro  wrote:
>
> > > > This needs to be investigated. I think it may be a problem with
> > > > fcgi.py, not with web2py itself. Anywya, let's rule out problems with
> > > > session locking. Try add
>
> > > > session.unlock()
>
> > > > to those actions called via ajax that do not write session variables.
> > > > Do you still get the problem?
>
> > > > Do you use sqlite?
>
> > > > Can you add some print/logging statements to see which actions are
> > > > called, in which order and if they return?
>
> > > > On Jun 24, 12:14 pm, ScOut3R  wrote:
>
> > > > > Dear List,
>
> > > > > the ajax based background search crashes my web2py installation. It's
> > > > > version 1.77.3 and I'm using the fcgihandler to access the
> > > > > application. OS: OpenBSD 4.6, Python version is Python 2.5.4
> > > > > (r254:67916, Oct 19 2009, 01:52:14).
>
> > > > > As You can see below the search makes three database queries. The
> > > > > first search attempt works and the second crashes web2py. Would You be
> > > > > so kind to look into it?
>
> > > > > The error is the following:
>
> > > > > Unhandled exception in thread started by  > > > > of >
> > > > > Traceback (most recent call last):
> > > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > > 664, in run
> > > > >     self.process_input()
> > > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > > 700, in process_input
> > > > >     self._do_params(rec)
> > > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > > 799, in _do_params
> > > > >     self._start_request(req)
> > > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > > 783, in _start_request
> > > > >     req.run()
> > > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > > 592, in run
> > > > >     self._flush()
> > > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > > 599, in _flush
> > > > >     self.stdout.close()
> > > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > > 358, in close
> > > > >     self._conn.writeRecord(rec)
> > > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > > 715, in writeRecord
> > > > >     rec.write(self._sock)
> > > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > > 552, in write
> > > > >     self._sendall(sock, header)
> > > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > > 529, in _sendall
> > > > >     sent = sock.send(data)
> > > > > socket.error: (32, 'Broken pipe')
>
> > > > > The jquery snippet that calls the background functions:
>
> > > > > function dvd() { ajax('bg_quick_dvd', ['keyword', 'option'],
> > > > > 'target_dvd'); }
> > > > > function music_cd() { ajax('bg_quick_music_cd', ['keyword', 'option'],
> > > > > 'target_music_cd'); }
> > > > > function book() { ajax('bg_quick_book', ['keyword', 'option'],
> > > > > 'target_book');
>
> > > > > function start() {
> > > > >         if(jQuery('#title').attr('checked'))
> > > > >                 jQuery('#option').val('1');
> > > > >         if(jQuery('#store').attr('checked'))
> > > > >                 jQuery('#option').val('0');
>
> > > > >         dvd();
> > > > >         setTimeout('music_cd()', 150);
> > > > >         setTimeout('book()', 300);
>
> > > > > }
>
> > > > > And the backround functions:
>
> > > > > def bg_quick_dvd():
> > > > >         if (request.vars.option == '1'):
> > > > >                 pattern = '%' + request.vars.keyword + '%'
> > > > >                 dvds = db((db.dvds.user==user_id) &
> > > > > (db.dvds.title.like(pattern))).select(orderby=db.dvds.title)
> > > > >         else:
> > > > >                 dvds = db((db.dvds.user==user_id) &
> > > > > (db.dvds.store==request.vars.keyword)).select(orderby=db.dvds.title)
> > > > >         items = [A(row.title, _href=URL(c='dvd', r=request, f='show',
> > > > > args=row.id)) for row in dvds]
> > > > >         return UL(*items).xml()
>
> > > > > @auth.requires_login()
> > > > > def bg_quick_music_cd():
> >

[web2py] is_in_set hoirzontal radio widget and is_empty as default

2010-06-25 Thread selecta
when I create a form field with the following code

Field('open_source',requires =
IS_EMPTY_OR(IS_IN_SET((True, False), zero = 'unknown')),
widget=SQLFORM.widgets.radio.widget, default = None),

I get vertical aligned radio boxes. Is there a build in method for
showing the radio boxed horizontally aligned or do I have to write my
own widget class for that?

And

The default option should be None but the 'unknown' box is not check
when the widget is build, how can I change that?


[web2py] Re: ajax background function crashes web2py fcgi handler

2010-06-25 Thread mdipierro
can you try 1.79.2?

Massimo

On Jun 25, 4:52 am, ScOut3R  wrote:
> Hello there again!
>
> I've added some logging and with a double click submit I can see the
> the response crashes before the return UL(*items).xml() part in the
> first search function.
>
> I hope this helps.
>
> Best regards,
> Mate
>
> On Jun 24, 8:57 pm, ScOut3R  wrote:
>
> > I've added session.unlock to each of the functions and it seems stable
> > except under one condition and that is if I'm accidentally double
> > click the submit button.
>
> > I'm using MySQL as the backend.
>
> > The first function (bg_quick_dvd()) got executed and it returns the
> > value but the following just times out. I'll try to figure out at
> > which part.
>
> > On Jun 24, 8:24 pm, mdipierro  wrote:
>
> > > This needs to be investigated. I think it may be a problem with
> > > fcgi.py, not with web2py itself. Anywya, let's rule out problems with
> > > session locking. Try add
>
> > > session.unlock()
>
> > > to those actions called via ajax that do not write session variables.
> > > Do you still get the problem?
>
> > > Do you use sqlite?
>
> > > Can you add some print/logging statements to see which actions are
> > > called, in which order and if they return?
>
> > > On Jun 24, 12:14 pm, ScOut3R  wrote:
>
> > > > Dear List,
>
> > > > the ajax based background search crashes my web2py installation. It's
> > > > version 1.77.3 and I'm using the fcgihandler to access the
> > > > application. OS: OpenBSD 4.6, Python version is Python 2.5.4
> > > > (r254:67916, Oct 19 2009, 01:52:14).
>
> > > > As You can see below the search makes three database queries. The
> > > > first search attempt works and the second crashes web2py. Would You be
> > > > so kind to look into it?
>
> > > > The error is the following:
>
> > > > Unhandled exception in thread started by  > > > of >
> > > > Traceback (most recent call last):
> > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > 664, in run
> > > >     self.process_input()
> > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > 700, in process_input
> > > >     self._do_params(rec)
> > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > 799, in _do_params
> > > >     self._start_request(req)
> > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > 783, in _start_request
> > > >     req.run()
> > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > 592, in run
> > > >     self._flush()
> > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > 599, in _flush
> > > >     self.stdout.close()
> > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > 358, in close
> > > >     self._conn.writeRecord(rec)
> > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > 715, in writeRecord
> > > >     rec.write(self._sock)
> > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > 552, in write
> > > >     self._sendall(sock, header)
> > > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > > 529, in _sendall
> > > >     sent = sock.send(data)
> > > > socket.error: (32, 'Broken pipe')
>
> > > > The jquery snippet that calls the background functions:
>
> > > > function dvd() { ajax('bg_quick_dvd', ['keyword', 'option'],
> > > > 'target_dvd'); }
> > > > function music_cd() { ajax('bg_quick_music_cd', ['keyword', 'option'],
> > > > 'target_music_cd'); }
> > > > function book() { ajax('bg_quick_book', ['keyword', 'option'],
> > > > 'target_book');
>
> > > > function start() {
> > > >         if(jQuery('#title').attr('checked'))
> > > >                 jQuery('#option').val('1');
> > > >         if(jQuery('#store').attr('checked'))
> > > >                 jQuery('#option').val('0');
>
> > > >         dvd();
> > > >         setTimeout('music_cd()', 150);
> > > >         setTimeout('book()', 300);
>
> > > > }
>
> > > > And the backround functions:
>
> > > > def bg_quick_dvd():
> > > >         if (request.vars.option == '1'):
> > > >                 pattern = '%' + request.vars.keyword + '%'
> > > >                 dvds = db((db.dvds.user==user_id) &
> > > > (db.dvds.title.like(pattern))).select(orderby=db.dvds.title)
> > > >         else:
> > > >                 dvds = db((db.dvds.user==user_id) &
> > > > (db.dvds.store==request.vars.keyword)).select(orderby=db.dvds.title)
> > > >         items = [A(row.title, _href=URL(c='dvd', r=request, f='show',
> > > > args=row.id)) for row in dvds]
> > > >         return UL(*items).xml()
>
> > > > @auth.requires_login()
> > > > def bg_quick_music_cd():
> > > >         if (request.vars.option == '1'):
> > > >                 pattern = '%' + request.vars.keyword + '%'
> > > >                 music_cds = db((db.music_cds.user==user_id) &
> > > > (db.music_cds.title.like(pattern))).select(orderby=db.music_cds.title)
> > > >         else:
> > > >                

[web2py] Re: ajax background function crashes web2py fcgi handler

2010-06-25 Thread ScOut3R
Hello there again!

I've added some logging and with a double click submit I can see the
the response crashes before the return UL(*items).xml() part in the
first search function.

I hope this helps.

Best regards,
Mate

On Jun 24, 8:57 pm, ScOut3R  wrote:
> I've added session.unlock to each of the functions and it seems stable
> except under one condition and that is if I'm accidentally double
> click the submit button.
>
> I'm using MySQL as the backend.
>
> The first function (bg_quick_dvd()) got executed and it returns the
> value but the following just times out. I'll try to figure out at
> which part.
>
> On Jun 24, 8:24 pm, mdipierro  wrote:
>
>
>
> > This needs to be investigated. I think it may be a problem with
> > fcgi.py, not with web2py itself. Anywya, let's rule out problems with
> > session locking. Try add
>
> > session.unlock()
>
> > to those actions called via ajax that do not write session variables.
> > Do you still get the problem?
>
> > Do you use sqlite?
>
> > Can you add some print/logging statements to see which actions are
> > called, in which order and if they return?
>
> > On Jun 24, 12:14 pm, ScOut3R  wrote:
>
> > > Dear List,
>
> > > the ajax based background search crashes my web2py installation. It's
> > > version 1.77.3 and I'm using the fcgihandler to access the
> > > application. OS: OpenBSD 4.6, Python version is Python 2.5.4
> > > (r254:67916, Oct 19 2009, 01:52:14).
>
> > > As You can see below the search makes three database queries. The
> > > first search attempt works and the second crashes web2py. Would You be
> > > so kind to look into it?
>
> > > The error is the following:
>
> > > Unhandled exception in thread started by  > > of >
> > > Traceback (most recent call last):
> > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > 664, in run
> > >     self.process_input()
> > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > 700, in process_input
> > >     self._do_params(rec)
> > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > 799, in _do_params
> > >     self._start_request(req)
> > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > 783, in _start_request
> > >     req.run()
> > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > 592, in run
> > >     self._flush()
> > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > 599, in _flush
> > >     self.stdout.close()
> > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > 358, in close
> > >     self._conn.writeRecord(rec)
> > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > 715, in writeRecord
> > >     rec.write(self._sock)
> > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > 552, in write
> > >     self._sendall(sock, header)
> > >   File "/var/www/web2py/prod/gluon/contrib/gateways/fcgi.py", line
> > > 529, in _sendall
> > >     sent = sock.send(data)
> > > socket.error: (32, 'Broken pipe')
>
> > > The jquery snippet that calls the background functions:
>
> > > function dvd() { ajax('bg_quick_dvd', ['keyword', 'option'],
> > > 'target_dvd'); }
> > > function music_cd() { ajax('bg_quick_music_cd', ['keyword', 'option'],
> > > 'target_music_cd'); }
> > > function book() { ajax('bg_quick_book', ['keyword', 'option'],
> > > 'target_book');
>
> > > function start() {
> > >         if(jQuery('#title').attr('checked'))
> > >                 jQuery('#option').val('1');
> > >         if(jQuery('#store').attr('checked'))
> > >                 jQuery('#option').val('0');
>
> > >         dvd();
> > >         setTimeout('music_cd()', 150);
> > >         setTimeout('book()', 300);
>
> > > }
>
> > > And the backround functions:
>
> > > def bg_quick_dvd():
> > >         if (request.vars.option == '1'):
> > >                 pattern = '%' + request.vars.keyword + '%'
> > >                 dvds = db((db.dvds.user==user_id) &
> > > (db.dvds.title.like(pattern))).select(orderby=db.dvds.title)
> > >         else:
> > >                 dvds = db((db.dvds.user==user_id) &
> > > (db.dvds.store==request.vars.keyword)).select(orderby=db.dvds.title)
> > >         items = [A(row.title, _href=URL(c='dvd', r=request, f='show',
> > > args=row.id)) for row in dvds]
> > >         return UL(*items).xml()
>
> > > @auth.requires_login()
> > > def bg_quick_music_cd():
> > >         if (request.vars.option == '1'):
> > >                 pattern = '%' + request.vars.keyword + '%'
> > >                 music_cds = db((db.music_cds.user==user_id) &
> > > (db.music_cds.title.like(pattern))).select(orderby=db.music_cds.title)
> > >         else:
> > >                 music_cds = db((db.music_cds.user==user_id) &
> > > (db.music_cds.store==request.vars.keyword)).select(orderby=db.music_cds.tit
> > >  le)
> > >         items = [A(row.title, _href=URL(c='music_cd', r=request, f='show',
> > > args=row.id)) for row in music_cds]
> > >         r

Re: [web2py] Re: Generate input from db field...

2010-06-25 Thread Andrew Buchan
Yarko,

I tried doing this with a DIV, but if I put the whole form within the DIV,
that doesn't seem to work. If you mean just putting the input fields in the
DIV, with the submit button outside of that, then that's what my original
question was about: how to generate a table with labels/inputs by passing a
list of Fields. Or did you mean a different way, I'm all ears :-)
As long as I can use form.accepts to validate just those fields which are
displayed, then it should work for me.
Having said that, I'm past my deadline and struggling for time, and this is
really a nice to have which I can't afford to spend too much time on before
launching. But still, all suggestions are most welcome...


On Fri, Jun 25, 2010 at 9:37 AM, Yarko Tymciurak <
resultsinsoftw...@gmail.com> wrote:

> On Jun 25, 3:24 am, Andrew Buchan  wrote:
> > Sorry for delay in getting back. I eventually opted for a solution which
> > does not involve JQuery, instead a department-specific list of fields is
> > passed to SQLForm, which makes things so much simpler.
> > The only draw back is that the user has to select a department on one
> page,
> > and is then redirected to another page with the 'create' form, but that's
> a
> > small price to pay for the simplicity of using self-submitting forms
>
> If that's how you are doing it, then it would be a very small step to
> make that "other page"
> an ajax loaded css element on the first page - i.e.   first part of
> form submitted gets
> the second part of the page loaded.
>
>
> > thereafter (after creating the initial record, 5 other actions can be
> taken
> > on it, and for all of those the department is already known, so it's
> > easier).
> > Anyway, thanks for the suggestions, and I now know a bit about JQuery
> which
> > will no doubt come in useful one day.
> > Regards,
> >
> > On Tue, Jun 22, 2010 at 5:15 PM, mdipierro 
> wrote:
> > > This is no longer a client issue. I think you do handle the problem
> > > correctly client side.
> > > The problem is that if some fields exist in db but you do not want to
> > > insert them you need to change the validator from
> >
> > > db.table.field.requires=blabla()
> >
> > > into
> >
> > > db.table.field.requires=IS_EMPTY_OR(blabla())
> >
> > > You can do this conditionally:
> >
> > > if request.vars.selectorfield='whatever':
> > >db.table.field.requires=IS_EMPTY_OR(blabla())
> >
> > > On Jun 22, 9:56 am, Andrew Buchan  wrote:
> > > > Hi Massimo,
> >
> > > > I posted the code below before checking if the form would actually
> > > submit.
> > > > What now happens is that all the fields are put through validation,
> > > > including those which I hid with JQuery, and needless to say, most of
> > > them
> > > > fail because they're empty!
> >
> > > > There's no way I can do away with the validators, and I'm struggling
> to
> > > > find-out how to make it not validate those fields I hid. If I can't
> then
> > > > I've just thrown away a crucial 5 hours on JQuery, nice learning
> > > experience
> > > > but if I have to start again with a different approach I won't be a
> happy
> > > > bunny and neither will my client :-|
> >
> > > > Any suggestions?
> >
> > > > On Tue, Jun 22, 2010 at 2:27 PM, Andrew Buchan 
> > > wrote:
> > > > > Massimo,
> >
> > > > > Thanks for that, I was about to reply saying that JQuery can't do
> what
> > > I
> > > > > want it to, then thought I'd test my statement before making it.
> Here's
> > > the
> > > > > code for anyone who's interested:
> >
> > > > > Its all in the controller, as I pretty much use only one single
> > > > > multi-purpose view for all my pages :-)
> >
> > > > > 
> >
> > > > > #Fields to be visible for all departments
> > > > > commonFields = [
> > > > > 'Details',
> > > > > 'Suggested_Action'
> > > > > ]
> > > > > form = SQLFORM.factory(db[TableName])
> >
> > > > > #Create dict of department-specific fields, this is where you
> make
> > > > > changes when departments change the fields they require
> > > > > #Note: must all exist in table def in model, exclude common
> fields
> > > in
> > > > > list above.
> > > > > DepartmentFields = dict()
> > > > > DepartmentFields['IT'] = ['Contract_Number', 'Details']
> > > > > DepartmentFields['Projects'] = ['Work_Order_Number',
> > > > > 'Sales_Order_Number', 'Client']
> >
> > > > > #Create javascript/JQuery string for department select's
> onChange
> > > > > event...
> > > > > deptchange = "$(\"TR[id^=no_table]\").hide();" +\
> > > > > "var selectedDept = $('#To_Department :selected').text();"
> +\
> > > > > "var fieldsToShow = [];" +\
> > > > > "switch(selectedDept){"
> > > > > for dept, fields in DepartmentFields.items():
> > > > > fields.extend(commonFields )
> > > > > deptchange += "case '%s': fieldsToShow=%s;break;" % (dept,
> > > fields )
> > > > > deptchange += "default: fieldsToShow=[];};for (f in
> > > > > fieldsToShow){$('#no_table_' + fields

[web2py] Re: upload bug in filename

2010-06-25 Thread Swell
Ok i have been able to reproduce the bug ,
it works perfectly if the web2py tree is in c:\
it doesnot if it is copied on the desktop(C:\Users\M\Desktop\web2py)

so it seems that it is related the filenamepath(basename+filename)


[web2py] Re: Generate input from db field...

2010-06-25 Thread Yarko Tymciurak
On Jun 25, 3:24 am, Andrew Buchan  wrote:
> Sorry for delay in getting back. I eventually opted for a solution which
> does not involve JQuery, instead a department-specific list of fields is
> passed to SQLForm, which makes things so much simpler.
> The only draw back is that the user has to select a department on one page,
> and is then redirected to another page with the 'create' form, but that's a
> small price to pay for the simplicity of using self-submitting forms

If that's how you are doing it, then it would be a very small step to
make that "other page"
an ajax loaded css element on the first page - i.e.   first part of
form submitted gets
the second part of the page loaded.


> thereafter (after creating the initial record, 5 other actions can be taken
> on it, and for all of those the department is already known, so it's
> easier).
> Anyway, thanks for the suggestions, and I now know a bit about JQuery which
> will no doubt come in useful one day.
> Regards,
>
> On Tue, Jun 22, 2010 at 5:15 PM, mdipierro  wrote:
> > This is no longer a client issue. I think you do handle the problem
> > correctly client side.
> > The problem is that if some fields exist in db but you do not want to
> > insert them you need to change the validator from
>
> > db.table.field.requires=blabla()
>
> > into
>
> > db.table.field.requires=IS_EMPTY_OR(blabla())
>
> > You can do this conditionally:
>
> > if request.vars.selectorfield='whatever':
> >    db.table.field.requires=IS_EMPTY_OR(blabla())
>
> > On Jun 22, 9:56 am, Andrew Buchan  wrote:
> > > Hi Massimo,
>
> > > I posted the code below before checking if the form would actually
> > submit.
> > > What now happens is that all the fields are put through validation,
> > > including those which I hid with JQuery, and needless to say, most of
> > them
> > > fail because they're empty!
>
> > > There's no way I can do away with the validators, and I'm struggling to
> > > find-out how to make it not validate those fields I hid. If I can't then
> > > I've just thrown away a crucial 5 hours on JQuery, nice learning
> > experience
> > > but if I have to start again with a different approach I won't be a happy
> > > bunny and neither will my client :-|
>
> > > Any suggestions?
>
> > > On Tue, Jun 22, 2010 at 2:27 PM, Andrew Buchan 
> > wrote:
> > > > Massimo,
>
> > > > Thanks for that, I was about to reply saying that JQuery can't do what
> > I
> > > > want it to, then thought I'd test my statement before making it. Here's
> > the
> > > > code for anyone who's interested:
>
> > > > Its all in the controller, as I pretty much use only one single
> > > > multi-purpose view for all my pages :-)
>
> > > > 
>
> > > >     #Fields to be visible for all departments
> > > >     commonFields = [
> > > >         'Details',
> > > >         'Suggested_Action'
> > > >     ]
> > > >     form = SQLFORM.factory(db[TableName])
>
> > > >     #Create dict of department-specific fields, this is where you make
> > > > changes when departments change the fields they require
> > > >     #Note: must all exist in table def in model, exclude common fields
> > in
> > > > list above.
> > > >     DepartmentFields = dict()
> > > >     DepartmentFields['IT'] = ['Contract_Number', 'Details']
> > > >     DepartmentFields['Projects'] = ['Work_Order_Number',
> > > > 'Sales_Order_Number', 'Client']
>
> > > >     #Create javascript/JQuery string for department select's onChange
> > > > event...
> > > >     deptchange = "$(\"TR[id^=no_table]\").hide();" +\
> > > >         "var selectedDept = $('#To_Department :selected').text();" +\
> > > >         "var fieldsToShow = [];" +\
> > > >         "switch(selectedDept){"
> > > >     for dept, fields in DepartmentFields.items():
> > > >         fields.extend(commonFields )
> > > >         deptchange += "case '%s': fieldsToShow=%s;break;" % (dept,
> > fields )
> > > >     deptchange += "default: fieldsToShow=[];};for (f in
> > > > fieldsToShow){$('#no_table_' + fieldsToShow[f] + '__row').show();};"
>
> > > >     #Create the department select html control and insert at the top of
> > the
> > > > form (place this wrong and you will get very strange results when
> > hiding
> > > > parts of the form)
> > > >     DepartmentsRows = db(db.department.id >0 ).select()
> > > >     Departments = [DepartmentsRows[i]['department_name'] for i in
> > > > range(len(DepartmentsRows))]
> > > >     form[0].insert(0, TR(TD('To Department: '),TD(
> > > >                 SELECT( Departments , _name='To_Department',
> > > > _id='To_Department', _onChange=deptchange ),
> > > >             )))
>
> > > > I agree it's not ideal storing part of the logic in python, and part in
> > > > JQuery, but at least this way the dict representing the variable data
> > can be
> > > > kept in python (we do this for the DAL so why not...).
>
> > > > I would still like to know the answer to me first question though: can
> > I
> > > > create INPUT/SELECT/TEXTAREA bits directly from the table definition
> > f

[web2py] Web2py Application Exhibition

2010-06-25 Thread NetAdmin
Web2py Application Exhibition


Do you have a Web2py app that you'd like to show the world?
If so, you may be interested in the Web2py Application Exhibition.

The WAE is a way to...
1. Demonstrate what can be done with Web2py.
2. Share and learn about useful web2py, python, Javascript, jQuery
etc. techniques.
3. Earn some money toward that new  you've been craving.

Projects will be judged in the following areas.

Ease of use
Usefulness
Visual Appeal

The Rules
1. Applications must be submitted no later than July 30, 2010
2. Source must be included with your submissions.
3. If the application is written by a team, Massimo can NOT be part of
the team.
4. After a 2 week review period, on August 15, 2010, the winners will
be
   announced on the web2py-users list.
5. The 1st place winner will receive $100 US Dollars, 2nd place will
receive $50
6. You must enjoy using Web2py!

Massimo is not affiliated with this exhibition, ( maybe he'll help
judge if I can twist his arm )
so, if you have any questions or comments, I can be contacted at
mr.netad...@gmail.com


Re: [web2py] Re: Generate input from db field...

2010-06-25 Thread Andrew Buchan
Sorry for delay in getting back. I eventually opted for a solution which
does not involve JQuery, instead a department-specific list of fields is
passed to SQLForm, which makes things so much simpler.
The only draw back is that the user has to select a department on one page,
and is then redirected to another page with the 'create' form, but that's a
small price to pay for the simplicity of using self-submitting forms
thereafter (after creating the initial record, 5 other actions can be taken
on it, and for all of those the department is already known, so it's
easier).
Anyway, thanks for the suggestions, and I now know a bit about JQuery which
will no doubt come in useful one day.
Regards,


On Tue, Jun 22, 2010 at 5:15 PM, mdipierro  wrote:

> This is no longer a client issue. I think you do handle the problem
> correctly client side.
> The problem is that if some fields exist in db but you do not want to
> insert them you need to change the validator from
>
> db.table.field.requires=blabla()
>
> into
>
> db.table.field.requires=IS_EMPTY_OR(blabla())
>
> You can do this conditionally:
>
> if request.vars.selectorfield='whatever':
>db.table.field.requires=IS_EMPTY_OR(blabla())
>
>
>
> On Jun 22, 9:56 am, Andrew Buchan  wrote:
> > Hi Massimo,
> >
> > I posted the code below before checking if the form would actually
> submit.
> > What now happens is that all the fields are put through validation,
> > including those which I hid with JQuery, and needless to say, most of
> them
> > fail because they're empty!
> >
> > There's no way I can do away with the validators, and I'm struggling to
> > find-out how to make it not validate those fields I hid. If I can't then
> > I've just thrown away a crucial 5 hours on JQuery, nice learning
> experience
> > but if I have to start again with a different approach I won't be a happy
> > bunny and neither will my client :-|
> >
> > Any suggestions?
> >
> > On Tue, Jun 22, 2010 at 2:27 PM, Andrew Buchan 
> wrote:
> > > Massimo,
> >
> > > Thanks for that, I was about to reply saying that JQuery can't do what
> I
> > > want it to, then thought I'd test my statement before making it. Here's
> the
> > > code for anyone who's interested:
> >
> > > Its all in the controller, as I pretty much use only one single
> > > multi-purpose view for all my pages :-)
> >
> > > 
> >
> > > #Fields to be visible for all departments
> > > commonFields = [
> > > 'Details',
> > > 'Suggested_Action'
> > > ]
> > > form = SQLFORM.factory(db[TableName])
> >
> > > #Create dict of department-specific fields, this is where you make
> > > changes when departments change the fields they require
> > > #Note: must all exist in table def in model, exclude common fields
> in
> > > list above.
> > > DepartmentFields = dict()
> > > DepartmentFields['IT'] = ['Contract_Number', 'Details']
> > > DepartmentFields['Projects'] = ['Work_Order_Number',
> > > 'Sales_Order_Number', 'Client']
> >
> > > #Create javascript/JQuery string for department select's onChange
> > > event...
> > > deptchange = "$(\"TR[id^=no_table]\").hide();" +\
> > > "var selectedDept = $('#To_Department :selected').text();" +\
> > > "var fieldsToShow = [];" +\
> > > "switch(selectedDept){"
> > > for dept, fields in DepartmentFields.items():
> > > fields.extend(commonFields )
> > > deptchange += "case '%s': fieldsToShow=%s;break;" % (dept,
> fields )
> > > deptchange += "default: fieldsToShow=[];};for (f in
> > > fieldsToShow){$('#no_table_' + fieldsToShow[f] + '__row').show();};"
> >
> > > #Create the department select html control and insert at the top of
> the
> > > form (place this wrong and you will get very strange results when
> hiding
> > > parts of the form)
> > > DepartmentsRows = db(db.department.id >0 ).select()
> > > Departments = [DepartmentsRows[i]['department_name'] for i in
> > > range(len(DepartmentsRows))]
> > > form[0].insert(0, TR(TD('To Department: '),TD(
> > > SELECT( Departments , _name='To_Department',
> > > _id='To_Department', _onChange=deptchange ),
> > > )))
> >
> > > I agree it's not ideal storing part of the logic in python, and part in
> > > JQuery, but at least this way the dict representing the variable data
> can be
> > > kept in python (we do this for the DAL so why not...).
> >
> > > I would still like to know the answer to me first question though: can
> I
> > > create INPUT/SELECT/TEXTAREA bits directly from the table definition
> field
> > > without going via SQLFORM? Anyone?
> >
> > > ---
> >
> > > On Mon, Jun 21, 2010 at 5:35 PM, mdipierro  >wrote:
> >
> > >> This is what I would do
> >
> > >> - make a single for that contains all fields you need
> > >> - use jQuery in the view so that depending on the selected department
> > >> some fields are hidden
> >
> > >> On Jun 21, 3:38 am, Andrew Buchan  wrote:
> > >> > Hello,
> >
> > >

Re: [web2py] have I forgot something?

2010-06-25 Thread Zoom.Quiet
On Fri, Jun 25, 2010 at 16:16, mdipierro  wrote:
> I am trying to catch up with emails and messages since I have been
> traveling.
> Did I miss something important that has not yet been addressed? If so
> please ping the thread.
>
> BTW. I am in Italy (Pescara) for the next 40 days so if somebody is

good place, hope great holiday ;-)

> around here we could get together. I could also organize a mini
> course. Email me personally about this.
>
> Massimo



-- 
http://zoomquiet.org 人生苦短? Pythonic!


[web2py] have I forgot something?

2010-06-25 Thread mdipierro
I am trying to catch up with emails and messages since I have been
traveling.
Did I miss something important that has not yet been addressed? If so
please ping the thread.

BTW. I am in Italy (Pescara) for the next 40 days so if somebody is
around here we could get together. I could also organize a mini
course. Email me personally about this.

Massimo


[web2py] Re: python 2.4 support

2010-06-25 Thread mdipierro
Tim sent me a patch that should make Rocket compatible with 2.4. It is
in trunk. Can you please try it and let us know?

Massimo

On Jun 13, 10:09 pm, Cory Coager  wrote:
> Another problem is, I can't launch from the cli because the rocket
> module doesn't work with python2.4:
>
> -bash-3.2$ python web2py.py -i 127.0.0.1 -p 8001 -a 'password'
> sh: ifconfig: command not found
> WARNING:root:unable to import Rocket
> web2py Enterprise Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2010
> Version 1.79.2 (2010-06-08 22:45:26)
> Database drivers available: MySQL, PostgreSQL
> Starting hardcron...
> please visit:
>        http://127.0.0.1:8001
> use "kill -SIGTERM 21185" to shutdown the web2py server
> Traceback (most recent call last):
>   File "web2py.py", line 20, in ?
>     gluon.widget.start(cron=True)
>   File "/path/to/gluon/widget.py", line 863, in start
>     path=options.folder)
>   File "/path/to/gluon/main.py", line 618, in __init__
>     rocket.SERVER_NAME = server_name
> NameError: global name 'rocket' is not defined


[web2py] Re: upload bug in filename

2010-06-25 Thread Swell
Thx you for your help, i am thinking now that it is maybe not the
filename itself that is wrong but maybe filepathname. I mean that it
is the concat of the basename and filename is maybe too long . i am
going to look at this (by changing the web2py src tree to c:\ so that
a shorter basename is going to be generated )

i ll let u know
Emmanuel


[web2py] Re: Invalid reset password

2010-06-25 Thread mdipierro
Trying to catch up with messages

Can you please list steps to reproduce the problem? I am not sure I
understand.

On Jun 18, 5:50 pm, selecta  wrote:
> I got the "Invalidresetpassword" when clicking (twice?? did not
> check it) the confirmation link that was send with the email, this
> error message is somewhat misleading
>
> On Jun 18, 6:59 pm, pecos1046  wrote:
>
> > I also get the "Invalidresetpassword" flash on a requestreset
> >password. I have looked at the posts regarding this issue but I can't
> > quite follow the proposed cure.
> > Any help would be appreciated.
>
> > Peter
>
> > On Jun 1, 10:36 pm, weheh  wrote:
>
> > > I'm trying to get the retrieve_password functionality working. I've
> > > done all the mail setup, but when I select the retrieve_password link,
> > > I get a flash "Invalidresetpassword". I expected to get a form to
> > > let me specify the target email account. Any ideas what's going on?