[web2py] Re: Get rid of a label in web2py SQLFORM

2011-08-26 Thread annet
Hi Jason,

This would have worked:

db.table.field.label=None


Kind regards,

Annet.


Re: [web2py] new feature in trunk: auth.settings.login_after_registration

2011-08-26 Thread Bruno Rocha
Very nice feature, I am using. but there is a small problem.

to reproduce do this:

set:
auth.settings.registration_requires_verification = True
auth.settings.login_after_registration = True

decorate action with:
@auth.requires(auth.user and not auth.user.registration_key)

user registers and loggin in to the site, user has no access to the
decorated function so the user goes to email and clicks in


http://0.0.0.0:8000/app/default/user/verify_email/5d42...  #here is the
problem!

According to tools.py line 1900, this action does:

 else:
user.update_record(registration_key = '')
current.session.flash = self.messages.email_verified

It is only updating the database not the auth.user object, so user has no
key in db, but there's still key in auth.user.registration_key

need to be changed to something like

 else:
user.update_record(registration_key = '')
*auth.user.registration_key = '' # how to update the auth.user
from here??*
current.session.flash = self.messages.email_verified





On Thu, Aug 25, 2011 at 10:43 AM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 Some times I need the following:

 I want people to register and be able to play with some parts of the
 app but not everything until they verify their email. yet I do not
 want them to have to wait for the email in oder to se the system.

 Now (in trunk) you can do:

auth.settings.registration_requires_verification = True
auth.settings.login_after_registration = True

 and block some actions with

   @auth.requires(auth.user and not auth.user.registration_key)

 The user will login, receive an email and be able to use the app
 (before verifying registration, except the decorated actions), until
 the session expires. After the user clicks on the email link, the user
 will be able to login again with full access.




-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


Re: [web2py] new feature in trunk: auth.settings.login_after_registration

2011-08-26 Thread Bruno Rocha
Or, we need to logout the user and force the to login again.


Re: [web2py] new feature in trunk: auth.settings.login_after_registration

2011-08-26 Thread Bruno Rocha
temporarily solved with auth.settings.verify_email_next = URL(r=request,
c='default', f='user', args='logout')

so when user loggin again he got no auth.user.registration_key

But, there is a way to do it inside tools.py verify_email ?


[web2py] Re: Understanding Rocket Threads

2011-08-26 Thread Ray (a.k.a. Iceberg)
Thank you Anthony, I knew session.forget() but did not know it would
be so helpful for performance. I'll try that in my projects from now
on.

Regards,
Ray

On Aug 26, 2:42 am, Anthony abasta...@gmail.com wrote:
 If you don't explicitly forget the session, the session file will lock on
 each request, so subsequent requests will be blocked. Maybe you could forget
 the session on requests that don't need it and just keep it for requests
 that do need it (i.e., form submissions).

 Note, to immediately unlock the session file, you need to do
 session.forget(response), not just session.forget().

 Anthony







 On Thursday, August 25, 2011 2:14:54 PM UTC-4, G wrote:

  I tried session.forget() but found that forms submitted by ajax in
  components don't seem to work without a session, so that won't work in
  my case.

  I also tried removing the SQLite db, it may have helped some but I'm
  still testing.

  Thanks again for the suggestions

  On Aug 24, 4:18 pm, Michele Comitini michele@gmail.com
  wrote:
   Try session.forget() and see what happens

   mic

   2011/8/25 G glenn@gmail.com:

Thank you for the suggestion. I made a test application that used no
database accesses (no auth and randomly generated data). It showed the
same behavior, so I do not think it is the culprit. In addition, since
the application is monitor only, the real application only reads from
the database, which I hope would not impose a transaction lock.

G

On Aug 24, 3:20 pm, ron_m ron.m...@gmail.com wrote:
You also need to consider the database type used by the application
  for the
model. The SQLite database has a transaction lock which will cause the

application to look like it is single threaded if the database is held
  in a
transaction pending state while the background work is performed.


[web2py] Drop box and populating text area.

2011-08-26 Thread annet
I have a table with standard mail messages, in a form I would like to
have a drop box displaying the subjects of the mail message and when
the user selects a subject I would like to populate a text area with
the standard text. I guess this an AJAX thing, since I know very
little about AJAX I hope someone could provide me with an example of
how to implement this.

Kind regards,

Annet.


Re: [web2py] routes.py

2011-08-26 Thread Kenneth Lundström

On 26.8.2011 7:57, Jonathan Lundell wrote:

On Aug 25, 2011, at 9:28 PM, Kenneth Lundström wrote:


On 26.8.2011 5:21, Jonathan Lundell wrote:

On Aug 25, 2011, at 4:48 PM, Kenneth Lundström wrote:


I'd like to have three types of routings:

a) web2py.main_domain.comdefaults to init, but you can choose the 
application with web2py.main_domain.com

b) testing.main_domain.com leads to application: testing

c) development.main_domain.comleads to application: testing, 
controller:ticket and function: create_new

is this possible?

Not quite. The parametric router will come close, with something like this in 
the BASE router:

   default_application = init,
   domains = {   testing.main_domain.com : testing,
   development.main_domain.com : testing/ticket,
 },

...I think, but it does not yet support per-controller default functions.

Thanks Jonathan and Anthony.

So to get as near as possible at the moment I could do:

development.main_domain.com : testing/ticket_create_new,

then create a new controller called ticket_create_new with a index function 
that does what my testing/ticket/create_new would have done?
 I think that should work. But there aren't corresponding unit tests, 
so there could be problems. Give it a try, and if it doesn't behave the 
way you think it should, let me know.


Yes, it works.


Kenneth




[web2py] Spell Check in text field ?

2011-08-26 Thread António Ramos
hello, is it possible to have spell check in a text field?


thank you


Re: [web2py] Re: New 'represent' syntax

2011-08-26 Thread Johann Spies
Thanks.

It will be very helpful if somebody can update these lines in the book
because  it still not clear to me how to use the new syntax in each of these
instances.  I still do not know how 'record' is defined here.

db.mytable.name.represent = lambda name: name.capitalize()

db.mytable.other_id.represent = lambda id: db.other(id).myfield


db.mytable.some_uploadfield.represent = lambda value: \


A http://web2py.com/book/default/docstring/A('get it', _href=URL
http://web2py.com/book/default/docstring/URL('download',
args=value))


I have no idea how to use 'record' e.g. in your example of the new grid:

db.dog.owner.represent = lambda x,record: db.person[x].name

is not correct

Regards
Johann
-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


[web2py] SQLFORM not handling hidden fields? Or do I have a bug?

2011-08-26 Thread Cliff
I use SQLFORM something like this:

field_list = 'dog_name dog_weight dog_birth_date'.split(' ')
hidden = {'dog_owner' : some_known_value} # We already know who owns
this dog
form = SQLFORM(db.sometable, fields=field_list, hidden=hidden)

When I look at the rendered page, the hidden fields are on the form.
But when I submit the form, SQLFORM doesn't insert the values from the
hidden fields, even though I can see them in request.vars.

Is this the way it's supposed to work or do I have a bug?

Thanks,
Cliff Kachinske



[web2py] Re: GAE deployment problem

2011-08-26 Thread Jarrod Cugley
Still can't figure it out, I think I doing something wrong with GAE
but I can't figure out what it is, I've tried searching for it but
can't find any solutions.

I've got to the point where it uploads a blank app that seems to just
display 'Hello world' on the front page and nothing else (which is not
my app)

On Aug 26, 2:07 pm, Jarrod Cugley jcug...@gmail.com wrote:
 Oh I didn't know GAE had logs too whoops.

 It gives me the warning:

 File referenced by handler not found: gaehandler.py

 Any idea what that means?

 On Aug 26, 1:58 pm, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:







  Check the GAE logs on the dashboard.

  On Aug 25, 10:32 pm, Jarrod Cugley jcug...@gmail.com wrote:

   So I've created a basic website that works on the web2py server, so I
   wanted to test it on the GAE, these are my steps so far:

   1. read:http://web2py.com/book/default/chapter/11#Google-App-Engine
   2. copied the app.example.yaml into my app.yaml and changed the id to
   the same id I used to create my app on GAE
   3. Added the existing folder directory to GAE launcher
   4. Run it, and it spits this out in the log:

   *** Running dev_appserver with the following flags:
       --admin_console_server= --port=8080
   Python command: /usr/bin/python2.6
   Warning: You are using a Python runtime (2.6) that is more recent than
   the production runtime environment (2.5). Your application may use
   features that are not available in the production environment and may
   not work correctly when deployed to production.
   WARNING  2011-08-26 03:22:33,391 datastore_file_stub.py:512] Could not
   read datastore data from /var/folders/t3/
   yh6qg8x93q989_mdzgh9frd8gn/T/dev_appserver.datastore
   INFO     2011-08-26 03:22:33,392 rdbms_sqlite.py:58] Connecting to
   SQLite database '' with file '/var/folders/t3/
   yh6qg8x93q989_mdzgh9frd8gn/T/dev_appserver.rdbms'
   WARNING  2011-08-26 03:22:33,396 dev_appserver.py:4748] Could not
   initialize images API; you are likely missing the Python PIL module.
   ImportError: No module named _imaging
   INFO     2011-08-26 03:22:33,405 dev_appserver_multiprocess.py:637]
   Running application selfemployedlist on port 8080:http://localhost:8080

   5. clicked the browse button in GAE launcher and it spits back 
   this:https://gist.github.com/1172615
   6. deploy it to GAE and it prints this in the GAE launcher log:

   INFO     2011-08-26 03:24:12,743 dev_appserver_main.py:667] Server
   interrupted by user, terminating

   *** Running appfg.py with the following flags:
       --no_cookies --email=jcug...@gmail.com --passin update
   Application: selfemployedlist; version: 1
   Host: appengine.google.com

   Starting update of app: selfemployedlist, version: 1
   Scanning files on local disk.
   Cloning 30 static files.
   Cloning 135 application files.
   Cloned 100 files.
   Uploading 18 files and blobs.
   Uploaded 18 files and blobs
   Compilation starting.
   Compilation completed.
   Starting deployment.
   Checking if deployment succeeded.
   Will check again in 1 seconds.
   Checking if deployment succeeded.
   Will check again in 2 seconds.
   Checking if deployment succeeded.
   Will check again in 4 seconds.
   Checking if deployment succeeded.
   Deployment successful.
   Checking if updated app version is serving.
   Completed update of app: selfemployedlist, version: 1
   Password for jcug...@gmail.com: If deploy fails you might need to
   'rollback' manually.
   The Make Symlinks... menu option can help with command-line work.
   *** appcfg.py has finished with exit code 0 ***

   7. Then view the version I just uploaded on GAE and it shows me this
   in the browser:

   Error: Server Error

   The server encountered an error and could not complete your request.
   If the problem persists, please report your problem and mention this
   error message and the query that caused it.


[web2py] SQLFORM not handling hidden fields? Or do I have a bug?

2011-08-26 Thread Cliff
I use SQLFORM something like this:

fields = 'dog_name dog_weight dog_birtdate'.split(' ')
hidden = {'dog_owner' : some_known_value} # We already know who the
owner is
SQLFORM(db.dogs, fields=fields, hidden=hidden)

The hidden fields are on the form.  When I submit the form, they are
in request.vars, but SQLFORM does not insert them in the database.

Is this the way it's supposed to work or do I have a bug?

Thanks,
Cliff Kachinske


Re: [web2py] Spell Check in text field ?

2011-08-26 Thread Bruno Rocha
plugin_chkeditor has spell check

2011/8/26 António Ramos ramstei...@gmail.com

 hello, is it possible to have spell check in a text field?


 thank you




-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


Re: [web2py] Re: New 'represent' syntax

2011-08-26 Thread Martín Mulone
db.dog.owner.represent = lambda value, row: db.person(value).name

Value is the value of the current field, in this example dog owner is
an id of the person for example 1, so to display person name I have
to pass this value to search a person with this id:
db.person(value).name.

Row is the all row of the current record, perhaps for this example is
not need it. But for example suppose I have to list dogs name blast
his age.


db.dog.name.represent = lambda value, row: '%s (%s)'%(value, row.age)

Result:

Name
---
doggy (2)
gog (12)



2011/8/26 Johann Spies johann.sp...@gmail.com

 Thanks.

 It will be very helpful if somebody can update these lines in the book
 because  it still not clear to me how to use the new syntax in each of these
 instances.  I still do not know how 'record' is defined here.

 db.mytable.name.represent = lambda name: name.capitalize()


 db.mytable.other_id.represent = lambda id: db.other(id).myfield



 db.mytable.some_uploadfield.represent = lambda value: \



 A http://web2py.com/book/default/docstring/A('get it', _href=URL 
 http://web2py.com/book/default/docstring/URL('download', args=value))



 I have no idea how to use 'record' e.g. in your example of the new grid:

 db.dog.owner.represent = lambda x,record: db.person[x].name

 is not correct

 Regards
 Johann
 --
  May grace and peace be yours in abundance through the full knowledge of
 God and of Jesus our Lord!  His divine power has given us everything we need
 for life and godliness through the full knowledge of the one who called us
 by his own glory and excellence.
 2 Pet. 1:2b,3a




-- 
 http://martin.tecnodoc.com.ar


Re: [web2py] Re: New 'represent' syntax

2011-08-26 Thread Martín Mulone
Another thing when you are using SQLFORM.grid and .smartgrid this notation
is required:

db.dog.owner.represent = lambda value, row: db.person(value).name

*because this notation raise an error:*


db.dog.owner.represent = lambda value: db.person(value).name

(take this in consideration or you are going to get mad)

2011/8/26 Martín Mulone mulone.mar...@gmail.com

 db.dog.owner.represent = lambda value, row: db.person(value).name

 Value is the value of the current field, in this example dog owner is an id 
 of the person for example 1, so to display person name I have to pass this 
 value to search a person with this id: db.person(value).name.

 Row is the all row of the current record, perhaps for this example is not 
 need it. But for example suppose I have to list dogs name blast his age.


 db.dog.name.represent = lambda value, row: '%s (%s)'%(value, row.age)

 Result:

 Name
 ---
 doggy (2)
 gog (12)



 2011/8/26 Johann Spies johann.sp...@gmail.com

 Thanks.

 It will be very helpful if somebody can update these lines in the book
 because  it still not clear to me how to use the new syntax in each of these
 instances.  I still do not know how 'record' is defined here.

 db.mytable.name.represent = lambda name: name.capitalize()



 db.mytable.other_id.represent = lambda id: db.other(id).myfield




 db.mytable.some_uploadfield.represent = lambda value: \




 A http://web2py.com/book/default/docstring/A('get it', _href=URL 
 http://web2py.com/book/default/docstring/URL('download', args=value))




 I have no idea how to use 'record' e.g. in your example of the new grid:


 db.dog.owner.represent = lambda x,record: db.person[x].name


 is not correct

 Regards
 Johann
 --
  May grace and peace be yours in abundance through the full knowledge of
 God and of Jesus our Lord!  His divine power has given us everything we need
 for life and godliness through the full knowledge of the one who called us
 by his own glory and excellence.
 2 Pet. 1:2b,3a




 --
  http://martin.tecnodoc.com.ar




-- 
 http://martin.tecnodoc.com.ar


[web2py] How do I import modules?

2011-08-26 Thread Jarrod Cugley
I've tried local_import().. Which seems to be deprecated from what
I've read in this group

I've tried from mymodule import class, and this doesn't seem to work
either? Is there any documentation on this? Cause I can't really find
anything that helps me. This is my code:

### controller/default.py ###
def search():
from objects import Searching
return dict(show=Searching.show(db))

### modules/objects.py ###
from gluon import *
request = current.request

class Searching(object):
@staticmethod
def show(db):
search = db(db.listing.title==request.args(0).replace(_,
)).select(db.listing.ALL)
items = []
for person in search:
items.append(DIV(A(person.first_name, _href=URL('listing',
args=person.id

return TAG[''](*items)

### Error = ImportError: cannot import name Searching ###


Can anyone figure out what I've done wrong?


Re: [web2py] How do I import modules?

2011-08-26 Thread Martín Mulone
You have the last version?, You have _init_.py in module?, You try changing
objects to another name, pehaps a name-conflict?.

2011/8/26 Jarrod Cugley jcug...@gmail.com

 I've tried local_import().. Which seems to be deprecated from what
 I've read in this group

 I've tried from mymodule import class, and this doesn't seem to work
 either? Is there any documentation on this? Cause I can't really find
 anything that helps me. This is my code:

 ### controller/default.py ###
 def search():
from objects import Searching
return dict(show=Searching.show(db))

 ### modules/objects.py ###
 from gluon import *
 request = current.request

 class Searching(object):
@staticmethod
def show(db):
search = db(db.listing.title==request.args(0).replace(_,
 )).select(db.listing.ALL)
items = []
for person in search:
items.append(DIV(A(person.first_name, _href=URL('listing',
 args=person.id

return TAG[''](*items)

 ### Error = ImportError: cannot import name Searching ###


 Can anyone figure out what I've done wrong?




-- 
 http://martin.tecnodoc.com.ar


[web2py] Re: table, grid, smartgrid, getting better

2011-08-26 Thread peter
Thanks to Massimo and Bruno for this. It is very nice to be able to
choose the style of the table. A couple of suggestions. It would be
good if the 'vars' are passed with the 'view', 'edit' etc and then
passed back again, so the order and keywords are persistent. It would
also be useful if the 'page number' were included in the vars so that
one also returned to the same page. At some stage control over
colwidths would be nice.

Is there an easy way to overide the view function?

Thanks
Peter



On Aug 24, 2:02 pm, Johann Spies johann.sp...@gmail.com wrote:
  TypeError: lambda() takes exactly 1 argument (2 given)

 I still get this error with the following model (all 'represent'  lines
 commented out):

  db.define_table('akb_articles',
                 Field('title'),
                 Field('primaryauthor'),
                 Field('authors', 'text'),
                 Field('rp_author', length=64,
                        requires =
 IS_EMPTY_OR(IS_IN_DB(db,'akb_reprint.uuid', '%(rp_author)s'))),
                 Field('journal',
                       requires = IS_IN_DB(db,'akb_journal.uuid',
 '%(title)s')),
                 Field('bib_id'),
                 Field('bib_pages'),
                 Field('doctype'),
                 Field('language'),
                 Field('abstract', 'text'),
                 Field('bib_vol'),
                 Field('bib_date'),
                 Field('url'),
                 Field('pubyear', compute= lambda x: x['bib_date'][-4:]),
                 Field('ut', # isi-unieke rekordnommer

 requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.ut'))),
                 Field('scopus_id',
 requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.scopus_id'))),
                 Field('sabinet_id',
 requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.sabinet_id'))),
                 Field('isap_id',
 requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.isap_id'))),
                 Field('category', 'list:string', IS_EMPTY_OR(
                     IS_IN_DB(db,'akb_categories.uuid',
                              '%(category)s',
                              multiple=True))),
                 Field('heading', 'list:string',  IS_EMPTY_OR(
                     IS_IN_DB(db,'akb_headings.uuid', '%(headings)s',
                              multiple=True))),
                 Field('art_eq',compute= lambda x: art_ekw(x)),
                 akb_signature,
                 #format = '%(title)s'
                )

 There is no 'lambda' in akb_signature.

 Regards
 Johann

 --
  May grace and peace be yours in abundance through the full knowledge of God
 and of Jesus our Lord!  His divine power has given us everything we need for
 life and godliness through the full knowledge of the one who called us by
 his own glory and excellence.
                                                     2 Pet. 1:2b,3a


[web2py] Re: How do I import modules?

2011-08-26 Thread Jarrod Cugley
I have version 1.97.1 which I'm assuming is the latest version
considering I've been coding for around a month now.

I have a blank file in my modules folder called __init__.py

I tried changing the names of things but got the same error

:(

On Aug 26, 8:29 pm, Martín Mulone mulone.mar...@gmail.com wrote:
 You have the last version?, You have _init_.py in module?, You try changing
 objects to another name, pehaps a name-conflict?.

 2011/8/26 Jarrod Cugley jcug...@gmail.com









  I've tried local_import().. Which seems to be deprecated from what
  I've read in this group

  I've tried from mymodule import class, and this doesn't seem to work
  either? Is there any documentation on this? Cause I can't really find
  anything that helps me. This is my code:

  ### controller/default.py ###
  def search():
     from objects import Searching
     return dict(show=Searching.show(db))

  ### modules/objects.py ###
  from gluon import *
  request = current.request

  class Searching(object):
     @staticmethod
     def show(db):
         search = db(db.listing.title==request.args(0).replace(_,
  )).select(db.listing.ALL)
         items = []
         for person in search:
             items.append(DIV(A(person.first_name, _href=URL('listing',
  args=person.id

         return TAG[''](*items)

  ### Error = ImportError: cannot import name Searching ###

  Can anyone figure out what I've done wrong?

 --
  http://martin.tecnodoc.com.ar


[web2py] Passing variables and field values to crud onaccept function

2011-08-26 Thread Noel Villamor
The model:

db.define_table('comment', Field('txt'), Field('tag'))

How do I pass/access the variable xyz, and the txt and tag field
values in funcdone below?

def funcdone(form):
comment_id = form.vars.id
...

def post_comment():
   xyz = 123
   form = crud.create(db.comment, onaccept=funcdone)
   return dict(form=form)

Thanks!


[web2py] Re: How do I import modules?

2011-08-26 Thread Jarrod Cugley
Wow. Don't ask me why, but it's working now, I didn't change anything
at all... I did restart web2py however...

I'm pretty confused but whatever it was, it's working now, thanks
Martin, I'll be sure to post again if it breaks hahahaha!

On Aug 26, 8:29 pm, Martín Mulone mulone.mar...@gmail.com wrote:
 You have the last version?, You have _init_.py in module?, You try changing
 objects to another name, pehaps a name-conflict?.

 2011/8/26 Jarrod Cugley jcug...@gmail.com









  I've tried local_import().. Which seems to be deprecated from what
  I've read in this group

  I've tried from mymodule import class, and this doesn't seem to work
  either? Is there any documentation on this? Cause I can't really find
  anything that helps me. This is my code:

  ### controller/default.py ###
  def search():
     from objects import Searching
     return dict(show=Searching.show(db))

  ### modules/objects.py ###
  from gluon import *
  request = current.request

  class Searching(object):
     @staticmethod
     def show(db):
         search = db(db.listing.title==request.args(0).replace(_,
  )).select(db.listing.ALL)
         items = []
         for person in search:
             items.append(DIV(A(person.first_name, _href=URL('listing',
  args=person.id

         return TAG[''](*items)

  ### Error = ImportError: cannot import name Searching ###

  Can anyone figure out what I've done wrong?

 --
  http://martin.tecnodoc.com.ar


Re: [web2py] Re: How do I import modules?

2011-08-26 Thread Martín Mulone
Yes you have to reload web2py everytime you make a change when you are using
modules. Or put this line in a top of your model:

if request.is_local: #disable in production enviromentfrom
gluon.custom_import import track_changestrack_changes()


Another: Last web2py is 1.98.2

2011/8/26 Jarrod Cugley jcug...@gmail.com

 Wow. Don't ask me why, but it's working now, I didn't change anything
 at all... I did restart web2py however...

 I'm pretty confused but whatever it was, it's working now, thanks
 Martin, I'll be sure to post again if it breaks hahahaha!

 On Aug 26, 8:29 pm, Martín Mulone mulone.mar...@gmail.com wrote:
  You have the last version?, You have _init_.py in module?, You try
 changing
  objects to another name, pehaps a name-conflict?.
 
  2011/8/26 Jarrod Cugley jcug...@gmail.com
 
 
 
 
 
 
 
 
 
   I've tried local_import().. Which seems to be deprecated from what
   I've read in this group
 
   I've tried from mymodule import class, and this doesn't seem to work
   either? Is there any documentation on this? Cause I can't really find
   anything that helps me. This is my code:
 
   ### controller/default.py ###
   def search():
  from objects import Searching
  return dict(show=Searching.show(db))
 
   ### modules/objects.py ###
   from gluon import *
   request = current.request
 
   class Searching(object):
  @staticmethod
  def show(db):
  search = db(db.listing.title==request.args(0).replace(_,
   )).select(db.listing.ALL)
  items = []
  for person in search:
  items.append(DIV(A(person.first_name, _href=URL('listing',
   args=person.id
 
  return TAG[''](*items)
 
   ### Error = ImportError: cannot import name Searching ###
 
   Can anyone figure out what I've done wrong?
 
  --
   http://martin.tecnodoc.com.ar




-- 
 http://martin.tecnodoc.com.ar


[web2py] Re: Problem with Oracle access and web2py database administration

2011-08-26 Thread Tim Korb
Yes, that seems to have fixed it.  Thanks!

[web2py] Simple question. Remove 2 or more spaces from a srtring

2011-08-26 Thread António Ramos
I know its a simple question but
How to
Remove 2 or more spaces from a string in a simple line of code?
thank you


[web2py] Re: Database performance

2011-08-26 Thread Massimo Di Pierro
Good to know.

The difference between
 {{rows = dataSet.select()}}
and
 {{rows = db.executesql(dataSet._select())}}
is that the former calls the function parse which loops over the
175K rows and converts them into objects.

On Aug 26, 12:08 am, HughBarker hbar...@gmail.com wrote:
 Thanks for the reply.

 {{rows = db.executesql(dataSet._select())}} executes in 0.16s.

 On Aug 26, 2:09 pm, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:







  Try by replacing

   {{rows = dataSet.select()}}

  with

   {{rows = db.executesql(dataSet._select())}}

  and tell me what get.

  Anyway, your raw sql select is only feting a third of the rows that
  that web2py is fetching.
  web2py is also doing a lot of extra work converting the list of
  records from tuples to dictionaries.

  On Aug 25, 9:48 pm, HughBarker hbar...@gmail.com wrote:

   Hi,
   I'm new to web2py - first of all, thanks for such an excellent
   framework. It's certainly a breath of fresh air after writing J2EE
   webapps.

   Anyway, I'm building an application, part of which plots large
   datasets (using the JS Highstocks library). I've defined a table like
   this:

   db.define_table('Underway_Data',
       Field('UTCtime', 'datetime'),
       Field('waterTemp', 'double'),
       Field('waterTempQC', 'integer'),
       Field('latitude', 'double'),
       Field('latitudeQC', 'integer'),
       Field('longitude', 'double'),
       Field('longitudeQC', 'integer'))

   and populated it with data, about 175k rows (postgres on ubuntu,
   web2py is residing on the same server and setup using the 'one step
   production deployment' script)

   Running the database query:

         {{resolution=5}}
         {{query = (db.Underway_Data.id%resolution==0)}}
         {{dataSet = db(query)}}
         {{tic = time.clock()}}
         {{rows = dataSet.select()}}
         {{toc = time.clock()}}

   will take about 4.5 seconds (the resolution variable subsamples the
   data for performance reasons).

   While it is a fair amount of data to be pushing around, 4.5 seconds
   seems slow to me. I wrote a simple benchmark in pure python:

   import psycopg2, time
   tic = time.clock()
   conn = psycopg2.connect(host=ubuntu-geospatial-server user=postgres
   password= dbname=geospatial)
   cur = conn.cursor()
   cur.execute(SELECT Underway_Data.id, Underway_Data.UTCtime,
   Underway_Data.waterTemp, Underway_Data.waterTempQC,
   Underway_Data.latitude, Underway_Data.latitudeQC,
   Underway_Data.longitude, Underway_Data.longitudeQC FROM Underway_Data
   WHERE ((Underway_Data.id % 5) = 0);)
   rows = cur.fetchall()
   toc = time.clock()
   print toc-tic
   cur.close()
   conn.close()

   which runs in ~0.13 seconds.

   (the query I use is the output of db(query)._select() )

   Am I missing something here? Is there anything I can do to increase
   performance?

   Regards,
   Hugh.


[web2py] Re: Filtering dropdown

2011-08-26 Thread Massimo Di Pierro
I think you want:

subset=db(db.person.id=100)
db.dog.owner.requires = IS_IN_DB(subset, 'person.id', '%(name)s')

the value of _and is used in validation but ignored when building the
dropdown

On Aug 26, 12:55 am, Noel Villamor noe...@gmail.com wrote:
 From the manual:

 subset=db(db.person.id100)
 db.dog.owner.requires = IS_IN_DB(db, 'person.id', '%(name)s',

 _and=IS_NOT_IN_DB(subset,'person.id'))

 Am I right in my interpretation that the dog.owner dropdown will only
 show person names who are not in the subset?

 Am trying to implement '_and' but it seems to be not working as I
 expected. Is this because the subset validation is not a filter
 function but rather as merely a check upon form submit?


[web2py] Re: GAE deployment problem

2011-08-26 Thread Massimo Di Pierro
Look at the source of the code you are deploying. There should be a
file:

web2py/gaehandler.py

for some reason this file did not get deployed on GAE. Perhaps you
accidentally deleted it?

massimo

On Aug 25, 11:07 pm, Jarrod Cugley jcug...@gmail.com wrote:
 Oh I didn't know GAE had logs too whoops.

 It gives me the warning:

 File referenced by handler not found: gaehandler.py

 Any idea what that means?

 On Aug 26, 1:58 pm, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:







  Check the GAE logs on the dashboard.

  On Aug 25, 10:32 pm, Jarrod Cugley jcug...@gmail.com wrote:

   So I've created a basic website that works on the web2py server, so I
   wanted to test it on the GAE, these are my steps so far:

   1. read:http://web2py.com/book/default/chapter/11#Google-App-Engine
   2. copied the app.example.yaml into my app.yaml and changed the id to
   the same id I used to create my app on GAE
   3. Added the existing folder directory to GAE launcher
   4. Run it, and it spits this out in the log:

   *** Running dev_appserver with the following flags:
       --admin_console_server= --port=8080
   Python command: /usr/bin/python2.6
   Warning: You are using a Python runtime (2.6) that is more recent than
   the production runtime environment (2.5). Your application may use
   features that are not available in the production environment and may
   not work correctly when deployed to production.
   WARNING  2011-08-26 03:22:33,391 datastore_file_stub.py:512] Could not
   read datastore data from /var/folders/t3/
   yh6qg8x93q989_mdzgh9frd8gn/T/dev_appserver.datastore
   INFO     2011-08-26 03:22:33,392 rdbms_sqlite.py:58] Connecting to
   SQLite database '' with file '/var/folders/t3/
   yh6qg8x93q989_mdzgh9frd8gn/T/dev_appserver.rdbms'
   WARNING  2011-08-26 03:22:33,396 dev_appserver.py:4748] Could not
   initialize images API; you are likely missing the Python PIL module.
   ImportError: No module named _imaging
   INFO     2011-08-26 03:22:33,405 dev_appserver_multiprocess.py:637]
   Running application selfemployedlist on port 8080:http://localhost:8080

   5. clicked the browse button in GAE launcher and it spits back 
   this:https://gist.github.com/1172615
   6. deploy it to GAE and it prints this in the GAE launcher log:

   INFO     2011-08-26 03:24:12,743 dev_appserver_main.py:667] Server
   interrupted by user, terminating

   *** Running appfg.py with the following flags:
       --no_cookies --email=jcug...@gmail.com --passin update
   Application: selfemployedlist; version: 1
   Host: appengine.google.com

   Starting update of app: selfemployedlist, version: 1
   Scanning files on local disk.
   Cloning 30 static files.
   Cloning 135 application files.
   Cloned 100 files.
   Uploading 18 files and blobs.
   Uploaded 18 files and blobs
   Compilation starting.
   Compilation completed.
   Starting deployment.
   Checking if deployment succeeded.
   Will check again in 1 seconds.
   Checking if deployment succeeded.
   Will check again in 2 seconds.
   Checking if deployment succeeded.
   Will check again in 4 seconds.
   Checking if deployment succeeded.
   Deployment successful.
   Checking if updated app version is serving.
   Completed update of app: selfemployedlist, version: 1
   Password for jcug...@gmail.com: If deploy fails you might need to
   'rollback' manually.
   The Make Symlinks... menu option can help with command-line work.
   *** appcfg.py has finished with exit code 0 ***

   7. Then view the version I just uploaded on GAE and it shows me this
   in the browser:

   Error: Server Error

   The server encountered an error and could not complete your request.
   If the problem persists, please report your problem and mention this
   error message and the query that caused it.


[web2py] Re: Passing variables and field values to crud onaccept function

2011-08-26 Thread Massimo Di Pierro
def funcdone(form,xyz):
comment_id = form.vars.id
...
def post_comment():
   xyz = 123
   form = crud.create(db.comment, onaccept=lambda
form,xyz=xyz:funcdone(form,xyz))
   return dict(form=form)

On Aug 26, 5:38 am, Noel Villamor noe...@gmail.com wrote:
 The model:

 db.define_table('comment', Field('txt'), Field('tag'))

 How do I pass/access the variable xyz, and the txt and tag field
 values in funcdone below?

 def funcdone(form):
     comment_id = form.vars.id
     ...

 def post_comment():
    xyz = 123
    form = crud.create(db.comment, onaccept=funcdone)
    return dict(form=form)

 Thanks!


[web2py] Re: Simple question. Remove 2 or more spaces from a srtring

2011-08-26 Thread Massimo Di Pierro
import re
text = re.sub('\s\s+',' ',text)

On Aug 26, 6:46 am, António Ramos ramstei...@gmail.com wrote:
 I know its a simple question but
 How to
 Remove 2 or more spaces from a string in a simple line of code?
 thank you


Re: [web2py] Re: Simple question. Remove 2 or more spaces from a srtring

2011-08-26 Thread António Ramos
Simplicity is an art.
Thank you Massimo

2011/8/26 Massimo Di Pierro massimo.dipie...@gmail.com

 import re
 text = re.sub('\s\s+',' ',text)

 On Aug 26, 6:46 am, António Ramos ramstei...@gmail.com wrote:
  I know its a simple question but
  How to
  Remove 2 or more spaces from a string in a simple line of code?
  thank you



[web2py] Re: SQLFORM not handling hidden fields? Or do I have a bug?

2011-08-26 Thread Massimo Di Pierro
Can I see the model?

On Aug 26, 4:43 am, Cliff cjk...@gmail.com wrote:
 I use SQLFORM something like this:

 fields = 'dog_name dog_weight dog_birtdate'.split(' ')
 hidden = {'dog_owner' : some_known_value} # We already know who the
 owner is
 SQLFORM(db.dogs, fields=fields, hidden=hidden)

 The hidden fields are on the form.  When I submit the form, they are
 in request.vars, but SQLFORM does not insert them in the database.

 Is this the way it's supposed to work or do I have a bug?

 Thanks,
 Cliff Kachinske


[web2py] Re: How do I import modules?

2011-08-26 Thread Jarrod Cugley
Do you know if the updating from the web2py framework is working yet?
It says it experimental when you do it, but does it work?

On Aug 26, 8:43 pm, Martín Mulone mulone.mar...@gmail.com wrote:
 Yes you have to reload web2py everytime you make a change when you are using
 modules. Or put this line in a top of your model:

 if request.is_local: #disable in production enviroment    from
 gluon.custom_import import track_changes    track_changes()

 Another: Last web2py is 1.98.2

 2011/8/26 Jarrod Cugley jcug...@gmail.com









  Wow. Don't ask me why, but it's working now, I didn't change anything
  at all... I did restart web2py however...

  I'm pretty confused but whatever it was, it's working now, thanks
  Martin, I'll be sure to post again if it breaks hahahaha!

  On Aug 26, 8:29 pm, Martín Mulone mulone.mar...@gmail.com wrote:
   You have the last version?, You have _init_.py in module?, You try
  changing
   objects to another name, pehaps a name-conflict?.

   2011/8/26 Jarrod Cugley jcug...@gmail.com

I've tried local_import().. Which seems to be deprecated from what
I've read in this group

I've tried from mymodule import class, and this doesn't seem to work
either? Is there any documentation on this? Cause I can't really find
anything that helps me. This is my code:

### controller/default.py ###
def search():
   from objects import Searching
   return dict(show=Searching.show(db))

### modules/objects.py ###
from gluon import *
request = current.request

class Searching(object):
   @staticmethod
   def show(db):
       search = db(db.listing.title==request.args(0).replace(_,
)).select(db.listing.ALL)
       items = []
       for person in search:
           items.append(DIV(A(person.first_name, _href=URL('listing',
args=person.id

       return TAG[''](*items)

### Error = ImportError: cannot import name Searching ###

Can anyone figure out what I've done wrong?

   --
    http://martin.tecnodoc.com.ar

 --
  http://martin.tecnodoc.com.ar


Re: [w2py-dev] Re: [web2py] new feature in trunk: auth.settings.login_after_registration

2011-08-26 Thread Massimo Di Pierro
I did not check it but I think your idea below should work. Check trunk.

On Aug 26, 2011, at 1:36 AM, Bruno Rocha wrote:

 Very nice feature, I am using. but there is a small problem.
 
 to reproduce do this:
 
 set: 
 auth.settings.registration_requires_verification = True
 auth.settings.login_after_registration = True
 
 decorate action with:
 @auth.requires(auth.user and not auth.user.registration_key)
 
 user registers and loggin in to the site, user has no access to the decorated 
 function so the user goes to email and clicks in 
 
 
 http://0.0.0.0:8000/app/default/user/verify_email/5d42...  #here is the 
 problem!
 
 According to tools.py line 1900, this action does:
 
  else:
 user.update_record(registration_key = '')
 current.session.flash = self.messages.email_verified
 
 It is only updating the database not the auth.user object, so user has no key 
 in db, but there's still key in auth.user.registration_key 
 
 need to be changed to something like
 
  else:
 user.update_record(registration_key = '')
 auth.user.registration_key = '' # how to update the auth.user 
 from here??
 current.session.flash = self.messages.email_verified
 
 
 
 
 
 On Thu, Aug 25, 2011 at 10:43 AM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:
 Some times I need the following:
 
 I want people to register and be able to play with some parts of the
 app but not everything until they verify their email. yet I do not
 want them to have to wait for the email in oder to se the system.
 
 Now (in trunk) you can do:
 
auth.settings.registration_requires_verification = True
auth.settings.login_after_registration = True
 
 and block some actions with
 
   @auth.requires(auth.user and not auth.user.registration_key)
 
 The user will login, receive an email and be able to use the app
 (before verifying registration, except the decorated actions), until
 the session expires. After the user clicks on the email link, the user
 will be able to login again with full access.
 
 
 
 -- 
 
 
 
 --
 Bruno Rocha
 [ About me: http://zerp.ly/rochacbruno ]
 [ Aprenda a programar: http://CursoDePython.com.br ]
 [ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
 [ Consultoria em desenvolvimento web: http://www.blouweb.com ]
 
 
 -- 
 mail from:GoogleGroups web2py-developers mailing list
 make speech: web2py-develop...@googlegroups.com
 unsubscribe: web2py-developers+unsubscr...@googlegroups.com
 details : http://groups.google.com/group/web2py-developers
 the project: http://code.google.com/p/web2py/
 official : http://www.web2py.com/



[web2py] Re: How do I import modules?

2011-08-26 Thread Massimo Di Pierro
It works but some problems have been reported under windows due to the
fact that some files are locked and cannot be overwritten during the
update.

On Aug 26, 7:44 am, Jarrod Cugley jcug...@gmail.com wrote:
 Do you know if the updating from the web2py framework is working yet?
 It says it experimental when you do it, but does it work?

 On Aug 26, 8:43 pm, Martín Mulone mulone.mar...@gmail.com wrote:







  Yes you have to reload web2py everytime you make a change when you are using
  modules. Or put this line in a top of your model:

  if request.is_local: #disable in production enviroment    from
  gluon.custom_import import track_changes    track_changes()

  Another: Last web2py is 1.98.2

  2011/8/26 Jarrod Cugley jcug...@gmail.com

   Wow. Don't ask me why, but it's working now, I didn't change anything
   at all... I did restart web2py however...

   I'm pretty confused but whatever it was, it's working now, thanks
   Martin, I'll be sure to post again if it breaks hahahaha!

   On Aug 26, 8:29 pm, Martín Mulone mulone.mar...@gmail.com wrote:
You have the last version?, You have _init_.py in module?, You try
   changing
objects to another name, pehaps a name-conflict?.

2011/8/26 Jarrod Cugley jcug...@gmail.com

 I've tried local_import().. Which seems to be deprecated from what
 I've read in this group

 I've tried from mymodule import class, and this doesn't seem to work
 either? Is there any documentation on this? Cause I can't really find
 anything that helps me. This is my code:

 ### controller/default.py ###
 def search():
    from objects import Searching
    return dict(show=Searching.show(db))

 ### modules/objects.py ###
 from gluon import *
 request = current.request

 class Searching(object):
    @staticmethod
    def show(db):
        search = db(db.listing.title==request.args(0).replace(_,
 )).select(db.listing.ALL)
        items = []
        for person in search:
            items.append(DIV(A(person.first_name, _href=URL('listing',
 args=person.id

        return TAG[''](*items)

 ### Error = ImportError: cannot import name Searching ###

 Can anyone figure out what I've done wrong?

--
 http://martin.tecnodoc.com.ar

  --
   http://martin.tecnodoc.com.ar


[web2py] Re: Simple question. Remove 2 or more spaces from a srtring

2011-08-26 Thread DenesL

' '.join(text.split())

no regex :)


[web2py] Re: OWASP Top 10 web app vuln # 10

2011-08-26 Thread ee...@seccuris.com
Looked in trunk and issue has been resolved. Thanks.

-Eric


Re: [web2py] Re: New 'represent' syntax

2011-08-26 Thread Johann Spies
Hallo Martín,

Thanks for your reply.

Unfortunately the problem persists:

I have in Massimo's demo code for the SQLFORM.smartgrid/grid:

def index():
db.define_table('person',Field('name'),format='%(name)s')

db.define_table('dog',Field('name'),Field('owner',db.person),format='%(name)s')
db.define_table('comment',Field('body'),Field('dog',db.dog))
#db.dog.owner.represent = lambda x, record: db.person(x).name
db.dog.owner.represent = lambda value, row: db.person(value).name

and I still get:

TypeError: lambda() takes exactly 2 arguments (1 given)


This is a bit frustrating and I have wasted a lot of time trying to get it
to work.

Regards
Johann

-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


Re: [web2py] Re: New 'represent' syntax

2011-08-26 Thread Bruno Rocha
Do you have some field.of type list:... ?

I am having trouble with it in grid.

http://zerp.ly/rochacbruno
Em 26/08/2011 10:54, Johann Spies johann.sp...@gmail.com escreveu:
 Hallo Martín,

 Thanks for your reply.

 Unfortunately the problem persists:

 I have in Massimo's demo code for the SQLFORM.smartgrid/grid:

 def index():
 db.define_table('person',Field('name'),format='%(name)s')


db.define_table('dog',Field('name'),Field('owner',db.person),format='%(name)s')
 db.define_table('comment',Field('body'),Field('dog',db.dog))
 #db.dog.owner.represent = lambda x, record: db.person(x).name
 db.dog.owner.represent = lambda value, row: db.person(value).name

 and I still get:

 TypeError: lambda() takes exactly 2 arguments (1 given)


 This is a bit frustrating and I have wasted a lot of time trying to get it
 to work.

 Regards
 Johann

 --
 May grace and peace be yours in abundance through the full knowledge of
God
 and of Jesus our Lord! His divine power has given us everything we need
for
 life and godliness through the full knowledge of the one who called us by
 his own glory and excellence.
 2 Pet. 1:2b,3a


[web2py] Re: table, grid, smartgrid, getting better

2011-08-26 Thread peter
making the 'records found' display conditional upon keywords not being
null would be good.
Thanks
Peter
On Aug 26, 11:35 am, peter peterchutchin...@gmail.com wrote:
 Thanks to Massimo and Bruno for this. It is very nice to be able to
 choose the style of the table. A couple of suggestions. It would be
 good if the 'vars' are passed with the 'view', 'edit' etc and then
 passed back again, so the order and keywords are persistent. It would
 also be useful if the 'page number' were included in the vars so that
 one also returned to the same page. At some stage control over
 colwidths would be nice.

 Is there an easy way to overide the view function?

 Thanks
 Peter

 On Aug 24, 2:02 pm, Johann Spies johann.sp...@gmail.com wrote:



   TypeError: lambda() takes exactly 1 argument (2 given)

  I still get this error with the following model (all 'represent'  lines
  commented out):

   db.define_table('akb_articles',
                  Field('title'),
                  Field('primaryauthor'),
                  Field('authors', 'text'),
                  Field('rp_author', length=64,
                         requires =
  IS_EMPTY_OR(IS_IN_DB(db,'akb_reprint.uuid', '%(rp_author)s'))),
                  Field('journal',
                        requires = IS_IN_DB(db,'akb_journal.uuid',
  '%(title)s')),
                  Field('bib_id'),
                  Field('bib_pages'),
                  Field('doctype'),
                  Field('language'),
                  Field('abstract', 'text'),
                  Field('bib_vol'),
                  Field('bib_date'),
                  Field('url'),
                  Field('pubyear', compute= lambda x: x['bib_date'][-4:]),
                  Field('ut', # isi-unieke rekordnommer

  requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.ut'))),
                  Field('scopus_id',
  requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.scopus_id'))),
                  Field('sabinet_id',
  requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.sabinet_id'))),
                  Field('isap_id',
  requires=IS_EMPTY_OR(IS_NOT_IN_DB(db,'akb_articles.isap_id'))),
                  Field('category', 'list:string', IS_EMPTY_OR(
                      IS_IN_DB(db,'akb_categories.uuid',
                               '%(category)s',
                               multiple=True))),
                  Field('heading', 'list:string',  IS_EMPTY_OR(
                      IS_IN_DB(db,'akb_headings.uuid', '%(headings)s',
                               multiple=True))),
                  Field('art_eq',compute= lambda x: art_ekw(x)),
                  akb_signature,
                  #format = '%(title)s'
                 )

  There is no 'lambda' in akb_signature.

  Regards
  Johann

  --
   May grace and peace be yours in abundance through the full knowledge of God
  and of Jesus our Lord!  His divine power has given us everything we need for
  life and godliness through the full knowledge of the one who called us by
  his own glory and excellence.
                                                      2 Pet. 1:2b,3a- Hide 
  quoted text -

 - Show quoted text -


Re: [web2py] Re: New 'represent' syntax

2011-08-26 Thread Martín Mulone
To debug the problem, start passing one by one the fields:

fields = [db.dog.id,
  db.dog.owner
  ]

SQLFORM.grid(
...
fields=fields,
...
)



2011/8/26 Bruno Rocha rochacbr...@gmail.com

 Do you have some field.of type list:... ?

 I am having trouble with it in grid.

 http://zerp.ly/rochacbruno
 Em 26/08/2011 10:54, Johann Spies johann.sp...@gmail.com escreveu:

  Hallo Martín,
 
  Thanks for your reply.
 
  Unfortunately the problem persists:
 
  I have in Massimo's demo code for the SQLFORM.smartgrid/grid:
 
  def index():
  db.define_table('person',Field('name'),format='%(name)s')
 
 
 db.define_table('dog',Field('name'),Field('owner',db.person),format='%(name)s')
  db.define_table('comment',Field('body'),Field('dog',db.dog))
  #db.dog.owner.represent = lambda x, record: db.person(x).name
  db.dog.owner.represent = lambda value, row: db.person(value).name
 
  and I still get:
 
  TypeError: lambda() takes exactly 2 arguments (1 given)
 
 
  This is a bit frustrating and I have wasted a lot of time trying to get
 it
  to work.
 
  Regards
  Johann
 
  --
  May grace and peace be yours in abundance through the full knowledge of
 God
  and of Jesus our Lord! His divine power has given us everything we need
 for
  life and godliness through the full knowledge of the one who called us by
  his own glory and excellence.
  2 Pet. 1:2b,3a




-- 
 http://martin.tecnodoc.com.ar


[web2py] Re: SQLFORM not handling hidden fields? Or do I have a bug?

2011-08-26 Thread Cliff
Massimo,

Thank you.

Of course.

Here are are the real table defs:
+++
++
db.define_table('purchase_orders',
Field('issue_date', 'date'),
Field('number', length=24, requires=IS_NOT_EMPTY(),
  required=True, notnull=True, comment='Required'),
Field('supplier', db.suppliers),
Field('shipto', db.locations, label='Ship To'),
Field('billto', db.locations, label='Bill To'),
Field('del_terms', db.del_terms, label='Delivery Terms'),
Field('currency', db.currencies),
Field('pmt_terms', db.pmt_terms, label='Payment Terms'),
Field('project_no', length=12, label='Project Number'),
Field('taxable', 'list:string', default='No'),
Field('po_contact', db.contacts,
label='Purchase Order Contact'),
Field('ap_contact',  db.contacts,
label='Accounts Payable Contact'),
Field('vendor_rep',  db.contacts,
label='Vendor Representative'),
Field('documentation_required', 'list:reference documentation',
comment='Click to select.  Use Ctrl key for multiple
selection.')
)
db.purchase_orders.taxable.requires = IS_IN_SET(['Yes', 'No'])
db.purchase_orders.shipto.requires = IS_IN_DB(db, db.locations.id, '%
(name)s',
zero='Choice required')
db.purchase_orders.billto.requires = IS_IN_DB(db, db.locations.id, '%
(name)s',
zero='Choice required')
db.purchase_orders.supplier.requires = IS_IN_DB(db, db.suppliers.id, '%
(name)s',
zero='Choice required')
db.purchase_orders.del_terms.requires = IS_IN_DB(db, db.del_terms.id,
'%(name)s',
zero='Choice required')
db.purchase_orders.currency.requires = IS_IN_DB(db, db.currencies.id,
'%(name)s',
zero='Choice required')
db.purchase_orders.pmt_terms.requires = IS_IN_DB(db, db.pmt_terms.id,
'%(name)s',
zero='Choice required')
db.purchase_orders.po_contact.requires = IS_IN_DB(
db(), db.contacts.id, '%(first_name)s, %(middle_name)s, %
(last_name)s, %(generation)s ',
zero='Choice required')
db.purchase_orders.ap_contact.requires = IS_IN_DB(
db(), db.contacts.id, '%(first_name)s',
zero='Choice required')
db.purchase_orders.vendor_rep.requires = IS_IN_DB(
db(), db.supplier_contacts.id, '%(first_name)s',
zero='Choice required')

db.define_table('suppliers',
Field('name', length=256, required=True, notnull=True),
Field('address', length=64),
Field('address_2', length=64),
Field('city', length=32),
Field('state', length=24),
Field('zip', length=18),
Field('website', length=512, requires=IS_URL()),
format = '%(name)s'
)


db.define_table(
'supplier_contacts',
Field('supplier_id', db.suppliers),
Field('first_name', length=32, required=True, notnull=True),
Field('middle_name', length=32),
Field('last_name', length=32, required=True, notnull=True),
Field('generation', length=16),
Field('email', length=512,
  requires=IS_EMPTY_OR(IS_EMAIL('invalid email'))),
Field('mobile', length=18, label='Mobile phone'),
Field('land_line', length=18),
Field('fax', length=18),
format='%(first_name)s, %(middle_name)s, %(last_name)s, %
(generation)s'
)
db.supplier_contacts.supplier_id.requires = IS_IN_DB(
db, db.suppliers.id, '%(name)s', zero='Choose'
)
db.supplier_contacts.supplier_id.readable = False
db.supplier_contacts.supplier_id.writable = False

+++
++

This is the actual call from the controller:
# we already know the supplier_id and vendor_rep
hidden['supplier']=supplier_id
hidden['vendor_rep'=vendor_rep
field_lst = 'issue_date number shipto billto del_terms
currency pmt_terms project_no taxable po_contact ap_contact
documentation_required'.split(' ')
form = SQLTABLE(db.suppliers, fields=field_lst,
hidden=hidden)



On Aug 26, 8:39 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 Can I see the model?

 On Aug 26, 4:43 am, Cliff cjk...@gmail.com wrote:







  I use SQLFORM something like this:

  fields = 'dog_name dog_weight dog_birtdate'.split(' ')
  hidden = {'dog_owner' : some_known_value} # We already know who the
  owner is
  SQLFORM(db.dogs, fields=fields, hidden=hidden)

  The hidden fields are on the form.  When I submit the form, they are
  in request.vars, but SQLFORM does not insert them in the database.

  Is this the way it's supposed to work or do I have a bug?

  Thanks,
  Cliff Kachinske


[web2py] How do I run external cron when using mod_wsgi?

2011-08-26 Thread Eric Scott
OK, maybe my last question was phrased so naively that it wasn't fit
to answer.  So I'll re-phrase: the web2py manual says that to run
external cron, the -J and -N command line parameters need to be
set.

If you are running external cron, make sure you add the -N command
line parameter to your web2py startup script or config so there is no
collision of multiple types of cron.

So what do users need to do who are not running web2py from the
command line?  Can we not use the external cron option?

And yes, I've used the manual and Google extensively to look for an
answer to this problem.  I can only find references to the fact that
it's possible to pass command line arguments to mod_wsgi when using
web2py.  I can't find out how.  If it's in the manual, I can't find
it.  I see where windows users can use options.conf, but it's clearly
only for windows users.  If it's possible for linux, I'm guessing
either the apache config or the wsgi handler files, but I'd like to
know for sure.

Thank you in advance for your help.

Eric


[web2py] Re: Drop box and populating text area.

2011-08-26 Thread Cliff
Web2py comes with jquery bundled in.

You can find some simple examples at 
http://www.web2py.com/book/default/chapter/10,

That should get you started.

The jquery website has a reasonably good getting started tutorial.
Also pretty decent api and event documentation.  I think the .change
event would be most useful for you.  Also the .val function.

On Aug 26, 3:55 am, annet annet.verm...@gmail.com wrote:
 I have a table with standard mail messages, in a form I would like to
 have a drop box displaying the subjects of the mail message and when
 the user selects a subject I would like to populate a text area with
 the standard text. I guess this an AJAX thing, since I know very
 little about AJAX I hope someone could provide me with an example of
 how to implement this.

 Kind regards,

 Annet.


[web2py] Published my collection of plugins

2011-08-26 Thread kenji4569
Hi, I've just published a collection of plugins which I'd created for
some web2py products (mainly cms sites) in my job:

The index page:
http://dev.s-cubism.com/web2py_plugins

The plugins are below:

[Form Widgets]
 Horizontal Radio Widget http://dev.s-cubism.com/plugin_hradio_widget
 Multiple Select Widget http://dev.s-cubism.com/plugin_multiselect_widget
 Suggest Widget http://dev.s-cubism.com/plugin_suggest_widget
 Lazy Options Widget http://dev.s-cubism.com/plugin_lazy_options_widget
 Anytime Widget http://dev.s-cubism.com/plugin_anytime_widget
 Color Widget http://dev.s-cubism.com/plugin_color_widget
 elRTE WYSIWYG Widget http://dev.s-cubism.com/plugin_elrte_widget
 Uploadify Widget http://dev.s-cubism.com/plugin_uploadify_widget

[Form Customize]
 Solid Form http://dev.s-cubism.com/plugin_solidform
 Not-Empty Marker http://dev.s-cubism.com/plugin_notemptymarker

[Table Customize]
 Solid Table http://dev.s-cubism.com/plugin_solidtable
 Pagenator http://dev.s-cubism.com/plugin_paginator
 Table Scope http://dev.s-cubism.com/plugin_tablescope
 Table Checkbox http://dev.s-cubism.com/plugin_tablecheckbox
 Table Permuter http://dev.s-cubism.com/plugin_tablepermuter

You can try demos, see souces, and download plugins (MIT Licence).
I'll appreciate your feedback and advises (especially for design
decisions).
I'll keep trying to create useful plugins and to improve them!


[web2py] Re: Published my collection of plugins

2011-08-26 Thread Massimo Di Pierro
WOW. fantastic!

massimo

On Aug 26, 11:35 am, kenji4569 hos...@s-cubism.jp wrote:
 Hi, I've just published a collection of plugins which I'd created for
 some web2py products (mainly cms sites) in my job:

 The index page:http://dev.s-cubism.com/web2py_plugins

 The plugins are below:

 [Form Widgets]
  Horizontal Radio Widgethttp://dev.s-cubism.com/plugin_hradio_widget
  Multiple Select Widgethttp://dev.s-cubism.com/plugin_multiselect_widget
  Suggest Widgethttp://dev.s-cubism.com/plugin_suggest_widget
  Lazy Options Widgethttp://dev.s-cubism.com/plugin_lazy_options_widget
  Anytime Widgethttp://dev.s-cubism.com/plugin_anytime_widget
  Color Widgethttp://dev.s-cubism.com/plugin_color_widget
  elRTE WYSIWYG Widgethttp://dev.s-cubism.com/plugin_elrte_widget
  Uploadify Widgethttp://dev.s-cubism.com/plugin_uploadify_widget

 [Form Customize]
  Solid Formhttp://dev.s-cubism.com/plugin_solidform
  Not-Empty Markerhttp://dev.s-cubism.com/plugin_notemptymarker

 [Table Customize]
  Solid Tablehttp://dev.s-cubism.com/plugin_solidtable
  Pagenatorhttp://dev.s-cubism.com/plugin_paginator
  Table Scopehttp://dev.s-cubism.com/plugin_tablescope
  Table Checkboxhttp://dev.s-cubism.com/plugin_tablecheckbox
  Table Permuterhttp://dev.s-cubism.com/plugin_tablepermuter

 You can try demos, see souces, and download plugins (MIT Licence).
 I'll appreciate your feedback and advises (especially for design
 decisions).
 I'll keep trying to create useful plugins and to improve them!


[web2py] linux help

2011-08-26 Thread Massimo Di Pierro
How would you write a cron job that automatically restarts apache when
the file web2py/VERSION is touched/modified and works on both ubuntu
and fedora?


Re: [web2py] linux help

2011-08-26 Thread Sebastian E. Ovide
what about something like this ?

#!/bin/bash
if test /path/to/VERSION -nt /path/to/VERSION.track
then
 # touch VERSION.track
 # restart apache
else
 nothing
fi


and run it in cron once every 5 minutes or so 

On Fri, Aug 26, 2011 at 5:43 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 How would you write a cron job that automatically restarts apache when
 the file web2py/VERSION is touched/modified and works on both ubuntu
 and fedora?


Re: [web2py] Re: Mobile detector

2011-08-26 Thread Angelo Compagnucci
Hi Ross,

I have explained myself too convoluted!

You are right on is_mobile and polymorphism, I read too
approximatively the code.

You are right also on attch always the is_mobile True/False to the
result object, is more simple to test for true false than that if
exists or not.

I hope it will be included as soon as possible!

Thank you!

2011/8/24 Ross Peoples ross.peop...@gmail.com:
 Well, the reason is_mobile is in the base object is for polymorphism to
 work. If we later did do a WindowsMobile(Dist): class, we can easily set
 is_mobile = True in it, since Dist is a subclass of the DetectorBase. I just
 left is_mobile attached to the response even if it's not mobile because it
 makes it easier to test. Someone may test by trying if ua.is_mobile ==
 False. So if is_mobile doesn't exist, it equals None and the test will fail.
 The routine runs pretty quickly. The thing that takes the longest is string
 searching.


Re: [web2py] linux help

2011-08-26 Thread Jonathan Lundell
On Aug 26, 2011, at 9:51 AM, Sebastian E. Ovide wrote:

 what about something like this ?
 
 #!/bin/bash
 if test /path/to/VERSION -nt /path/to/VERSION.track
 then
  # touch VERSION.track
  # restart apache
 else
  nothing
 fi
 
 
 and run it in cron once every 5 minutes or so 

I think that's basically the way to do it (and it should work fine on OS X, 
too). One caveat, though. Is web2py ready to start as soon as VERSION is 
written? If there's any housekeeping (unpacking or the like) that needs to 
happen first, the restart might be premature.

Also, might it be useful to have web2py touch a timestamp file when it starts 
(well, not if it's under GAE, but otherwise)? That would give us a hook for an 
uptime function, as well as supporting this functionality.

As with my caveat, it has a bit of a race problem, since the timestamp file 
gets touched some finite time after the restart event. Maybe something like:

if test... ; then
sleep 1
if test...; then
now do your stuff
fi
fi

 
 On Fri, Aug 26, 2011 at 5:43 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:
 How would you write a cron job that automatically restarts apache when
 the file web2py/VERSION is touched/modified and works on both ubuntu
 and fedora?




Re: [web2py] Re: Mobile detector

2011-08-26 Thread Ross Peoples
I submitted this to Massimo for inclusion. Now we wait :)

[web2py] Re: Published my collection of plugins

2011-08-26 Thread Ross Peoples
These are really great. The color picker plugin and form plugins are really 
useful to me. Thank you for sharing these. Maybe some of these could be 
integrated into web2py.

[web2py] Re: How do I run external cron when using mod_wsgi?

2011-08-26 Thread Ross Peoples
Forgive me if I have misunderstood your question, but it sounds like you are 
expecting web2py to start external cron for you. If this is the case, then 
that is incorrect. What external cron means is a completely separate 
process (in this case, the Unix cron scheduler) that needs to run a script. 
When running a background task that you would normally use cron for, you can 
start this task in a web2py environment so that it can use db, cache, etc. 
To do this, you would run using a cron line similar to this (in crontab -e, 
for example):

0 9 * * 1-5python /var/web2py/web2py.py -S app_name -M -J -R 
scripts/my_script.py

At 9AM, Monday through Friday, this runs the my_script.py file in your 
application's /scripts folder. The -J tells web2py that it is being executed 
as a cron job so that it doesn't start Rocket and open up a port needlessly. 
This also allows your applications to detect whether a script was executed 
by a web request or by a cron script. Why would this be important, you ask?

In one of my applications, I want to force all traffic over SSL, so in my 
model, I have this:

 FORCED SSL #
from gluon.settings import global_settings
if global_settings.cronjob:
print 'Running as shell script.'
elif not request.is_https:
session.secure()
redirect('https://%s/%s' % (request.env.http_host, request.application))
#

Since trying to redirect a cron script to SSL will fail, I want to check for 
that and only force HTTP connections to redirect to use HTTPS.

So to answer your question, you do not pass arguments to mod_wsgi. You start 
another web2py instance using -S, -M, and -J options to run a background 
process. Hope that helps.


[web2py] Re: How do I run external cron when using mod_wsgi?

2011-08-26 Thread Ross Peoples
Correction on that last, -S is what tells web2py to not start Rocket, while 
-J is what tells web2py that it is running as a background process.

Re: [web2py] Published my collection of plugins

2011-08-26 Thread Bruno Rocha
Great!

Lazy Options and Anytime are amazing,

AnyTime fits perfectly with the new web2py scheduller!

On Fri, Aug 26, 2011 at 1:35 PM, kenji4569 hos...@s-cubism.jp wrote:

 Hi, I've just published a collection of plugins which I'd created for
 some web2py products (mainly cms sites) in my job:

 The index page:
 http://dev.s-cubism.com/web2py_plugins

 The plugins are below:

 [Form Widgets]
  Horizontal Radio Widget http://dev.s-cubism.com/plugin_hradio_widget
  Multiple Select Widget http://dev.s-cubism.com/plugin_multiselect_widget
  Suggest Widget http://dev.s-cubism.com/plugin_suggest_widget
  Lazy Options Widget http://dev.s-cubism.com/plugin_lazy_options_widget
  Anytime Widget http://dev.s-cubism.com/plugin_anytime_widget
  Color Widget http://dev.s-cubism.com/plugin_color_widget
  elRTE WYSIWYG Widget http://dev.s-cubism.com/plugin_elrte_widget
  Uploadify Widget http://dev.s-cubism.com/plugin_uploadify_widget

 [Form Customize]
  Solid Form http://dev.s-cubism.com/plugin_solidform
  Not-Empty Marker http://dev.s-cubism.com/plugin_notemptymarker

 [Table Customize]
  Solid Table http://dev.s-cubism.com/plugin_solidtable
  Pagenator http://dev.s-cubism.com/plugin_paginator
  Table Scope http://dev.s-cubism.com/plugin_tablescope
  Table Checkbox http://dev.s-cubism.com/plugin_tablecheckbox
  Table Permuter http://dev.s-cubism.com/plugin_tablepermuter

 You can try demos, see souces, and download plugins (MIT Licence).
 I'll appreciate your feedback and advises (especially for design
 decisions).
 I'll keep trying to create useful plugins and to improve them!




-- 



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]


Re: [web2py] Re: Lazy virtual fields - strange result!

2011-08-26 Thread Martin Weissenboeck
I got:

Traceback (most recent call last):
...
db.item.lazy_total_price=Field.lazy(lambda
self:self.item.unit_price*self.item.quantity)
AttributeError: type object 'Field' has no attribute 'lazy'

Version 1.98.2 (2011-08-25 19:11:31)

Martin

2011/8/25 Massimo Di Pierro massimo.dipie...@gmail.com

 The nightly build or trunk.

 On Aug 25, 10:24 am, Martin Weissenboeck mweis...@gmail.com wrote:
  Thank you. Which version of web2py? 1.98.2 does not know Field.lazy
 
  2011/8/25 Massimo Di Pierro massimo.dipie...@gmail.com
 
 
 
 
 
 
 
   We are moving away from this because of many problems. Try this
   instead. It is still experimental but may go into stable soon.
 
   def vfields():
 db.define_table('item',
   Field('unit_price','double'),
   Field('quantity','integer'))
 db(db.item.id0).delete()
 
  db.item.lazy_total_price=Field.lazy(lambda
   self:self.item.unit_price*self.item.quantity)
 
  db.item.bulk_insert([{'unit_price':12.00, 'quantity': 15},
   {'unit_price':10.00, 'quantity': 99},
   {'unit_price':120.00, 'quantity': 2},])
 res = []
 for r in db(db.item.id0).select():
   res.append([r.unit_price, r.quantity, r.lazy_total_price()])
 return dict(res=res)
 
   On Aug 25, 7:50 am, Martin Weissenboeck mweis...@gmail.com wrote:
I wanted to learn more about lazy virtual fields and therefore I have
repeated the example from the book:
 
def vfields():
   db.define_table('item',
 Field('unit_price','double'),
 Field('quantity','integer'))
 
   db(db.item.id0).delete()
 
   class MyVirtualFields:
 def lazy_total_price(self):
   return lambda self=self:
 self.item.unit_price*self.item.quantity
 
   db.item.virtualfields.append (MyVirtualFields())
 
   db.item.bulk_insert([{'unit_price':12.00, 'quantity': 15},
 {'unit_price':10.00, 'quantity': 99},
 {'unit_price':120.00, 'quantity': 2},])
 
   res = []
   for r in db(db.item.id0).select():
 res.append([r.unit_price, r.quantity, r.lazy_total_price()])
   return dict(res=res)
 
The expected output is:
  [[12.0, 15, 180.0], [10.0, 99, 990.0], [120.0, 2, 240.0]]
 
But I got
*  [[12.0, 15, *240.0]*, [10.0, 99, *240.0*], [120.0, 2, 240.0]]*
*
*
*Three times the same result.
*
I have read the book and my program over and over again - but I
 cannot
   see
any error.*
*
 
Does somebody have an idea?
Martin



[web2py] Re: fluxflex

2011-08-26 Thread Alan Etkin
Hi, the method you mentioned for application upload via url does the
trick for large app files. The problem is that the user is forced to
place an installer online somewhere as source for download. It would
be very useful to be able to upload files normally. Also tried to
upload with git but i dont see how to do it for one application into
the pre-installed web2py folder.

On 23 ago, 04:44, Yota Ichino www.i...@gmail.com wrote:
 nic,

 Plugin_wiki is a large file size. You can not upload large file.
 You need to paste http://web2py.com/examples/static/
 web2py.plugin.wiki.w2p to Use a url.

 On 8月23日, 午前11:00, nic nicats...@gmail.com wrote:

  This looks fantastic.
  Got web2py up and running in 2 mins as advertised.
  However when I tried to install the plugin_wiki I got the following
  error.

  
  Internal Server Error
  The server encountered an internal error or misconfiguration and was
  unable to complete your request.
  Please contact the server administrator, sys...@fluxflex.com and
  inform them of the time the error occurred, and anything you might
  have done that may have caused the  error.
  More information about this error may be available in the server error
  log.
  Apache/2.2.17 (Ubuntu) Server at wtpapps.fluxflex.com Port 443

  Has anyone been able to install the plugin_wiki or know how to access
  the server error log ?




Re: [web2py] Re: Published my collection of plugins

2011-08-26 Thread Angelo Compagnucci
I think that some of this should be included in web2py!

Great work!

2011/8/26 Massimo Di Pierro massimo.dipie...@gmail.com:
 WOW. fantastic!

 massimo

 On Aug 26, 11:35 am, kenji4569 hos...@s-cubism.jp wrote:
 Hi, I've just published a collection of plugins which I'd created for
 some web2py products (mainly cms sites) in my job:

 The index page:http://dev.s-cubism.com/web2py_plugins

 The plugins are below:

 [Form Widgets]
  Horizontal Radio Widgethttp://dev.s-cubism.com/plugin_hradio_widget
  Multiple Select Widgethttp://dev.s-cubism.com/plugin_multiselect_widget
  Suggest Widgethttp://dev.s-cubism.com/plugin_suggest_widget
  Lazy Options Widgethttp://dev.s-cubism.com/plugin_lazy_options_widget
  Anytime Widgethttp://dev.s-cubism.com/plugin_anytime_widget
  Color Widgethttp://dev.s-cubism.com/plugin_color_widget
  elRTE WYSIWYG Widgethttp://dev.s-cubism.com/plugin_elrte_widget
  Uploadify Widgethttp://dev.s-cubism.com/plugin_uploadify_widget

 [Form Customize]
  Solid Formhttp://dev.s-cubism.com/plugin_solidform
  Not-Empty Markerhttp://dev.s-cubism.com/plugin_notemptymarker

 [Table Customize]
  Solid Tablehttp://dev.s-cubism.com/plugin_solidtable
  Pagenatorhttp://dev.s-cubism.com/plugin_paginator
  Table Scopehttp://dev.s-cubism.com/plugin_tablescope
  Table Checkboxhttp://dev.s-cubism.com/plugin_tablecheckbox
  Table Permuterhttp://dev.s-cubism.com/plugin_tablepermuter

 You can try demos, see souces, and download plugins (MIT Licence).
 I'll appreciate your feedback and advises (especially for design
 decisions).
 I'll keep trying to create useful plugins and to improve them!


[web2py] Re: Published my collection of plugins

2011-08-26 Thread DenesL
+1
specially like Anytime and Solid Table


Re: [web2py] Re: Published my collection of plugins

2011-08-26 Thread Stef Mientki

On 26-08-2011 19:18, Ross Peoples wrote:
These are really great. The color picker plugin and form plugins are really useful to me. Thank 
you for sharing these. Maybe some of these could be integrated into web2py. 

+1


Re: [web2py] Re: fluxflex

2011-08-26 Thread Yota Ichino
Alan Etkin,

 Also tried to upload with git but i dont see how to do it for one application 
 into
 the pre-installed web2py folder.
The way is copying web2py/applications/YOUR_APP folder to same cloned folder.



2011/8/27 Alan Etkin spame...@gmail.com:
 Hi, the method you mentioned for application upload via url does the
 trick for large app files. The problem is that the user is forced to
 place an installer online somewhere as source for download. It would
 be very useful to be able to upload files normally. Also tried to
 upload with git but i dont see how to do it for one application into
 the pre-installed web2py folder.

 On 23 ago, 04:44, Yota Ichino www.i...@gmail.com wrote:
 nic,

 Plugin_wiki is a large file size. You can not upload large file.
 You need to paste http://web2py.com/examples/static/
 web2py.plugin.wiki.w2p to Use a url.

 On 8月23日, 午前11:00, nic nicats...@gmail.com wrote:

  This looks fantastic.
  Got web2py up and running in 2 mins as advertised.
  However when I tried to install the plugin_wiki I got the following
  error.

  
  Internal Server Error
  The server encountered an internal error or misconfiguration and was
  unable to complete your request.
  Please contact the server administrator, sys...@fluxflex.com and
  inform them of the time the error occurred, and anything you might
  have done that may have caused the  error.
  More information about this error may be available in the server error
  log.
  Apache/2.2.17 (Ubuntu) Server at wtpapps.fluxflex.com Port 443

  Has anyone been able to install the plugin_wiki or know how to access
  the server error log ?




[web2py] Re: SQLFORM not handling hidden fields? Or do I have a bug?

2011-08-26 Thread Anthony
Does it work if you set db.supplier_contacts.supplier_id.writable = True in 
the controller function?

On Friday, August 26, 2011 11:12:31 AM UTC-4, Cliff wrote:

 Massimo, 

 Thank you. 

 Of course. 

 Here are are the real table defs: 
 +++ 
 ++ 
 db.define_table('purchase_orders', 
 Field('issue_date', 'date'), 
 Field('number', length=24, requires=IS_NOT_EMPTY(), 
   required=True, notnull=True, comment='Required'), 
 Field('supplier', db.suppliers), 
 Field('shipto', db.locations, label='Ship To'), 
 Field('billto', db.locations, label='Bill To'), 
 Field('del_terms', db.del_terms, label='Delivery Terms'), 
 Field('currency', db.currencies), 
 Field('pmt_terms', db.pmt_terms, label='Payment Terms'), 
 Field('project_no', length=12, label='Project Number'), 
 Field('taxable', 'list:string', default='No'), 
 Field('po_contact', db.contacts, 
 label='Purchase Order Contact'), 
 Field('ap_contact',  db.contacts, 
 label='Accounts Payable Contact'), 
 Field('vendor_rep',  db.contacts, 
 label='Vendor Representative'), 
 Field('documentation_required', 'list:reference documentation', 
 comment='Click to select.  Use Ctrl key for multiple 
 selection.') 
 ) 
 db.purchase_orders.taxable.requires = IS_IN_SET(['Yes', 'No']) 
 db.purchase_orders.shipto.requires = IS_IN_DB(db, db.locations.id, '% 
 (name)s', 
 zero='Choice required') 
 db.purchase_orders.billto.requires = IS_IN_DB(db, db.locations.id, '% 
 (name)s', 
 zero='Choice required') 
 db.purchase_orders.supplier.requires = IS_IN_DB(db, db.suppliers.id, '% 
 (name)s', 
 zero='Choice required') 
 db.purchase_orders.del_terms.requires = IS_IN_DB(db, db.del_terms.id, 
 '%(name)s', 
 zero='Choice required') 
 db.purchase_orders.currency.requires = IS_IN_DB(db, db.currencies.id, 
 '%(name)s', 
 zero='Choice required') 
 db.purchase_orders.pmt_terms.requires = IS_IN_DB(db, db.pmt_terms.id, 
 '%(name)s', 
 zero='Choice required') 
 db.purchase_orders.po_contact.requires = IS_IN_DB( 
 db(), db.contacts.id, '%(first_name)s, %(middle_name)s, % 
 (last_name)s, %(generation)s ', 
 zero='Choice required') 
 db.purchase_orders.ap_contact.requires = IS_IN_DB( 
 db(), db.contacts.id, '%(first_name)s', 
 zero='Choice required') 
 db.purchase_orders.vendor_rep.requires = IS_IN_DB( 
 db(), db.supplier_contacts.id, '%(first_name)s', 
 zero='Choice required') 

 db.define_table('suppliers', 
 Field('name', length=256, required=True, notnull=True), 
 Field('address', length=64), 
 Field('address_2', length=64), 
 Field('city', length=32), 
 Field('state', length=24), 
 Field('zip', length=18), 
 Field('website', length=512, requires=IS_URL()), 
 format = '%(name)s' 
 ) 


 db.define_table( 
 'supplier_contacts', 
 Field('supplier_id', db.suppliers), 
 Field('first_name', length=32, required=True, notnull=True), 
 Field('middle_name', length=32), 
 Field('last_name', length=32, required=True, notnull=True), 
 Field('generation', length=16), 
 Field('email', length=512, 
   requires=IS_EMPTY_OR(IS_EMAIL('invalid email'))), 
 Field('mobile', length=18, label='Mobile phone'), 
 Field('land_line', length=18), 
 Field('fax', length=18), 
 format='%(first_name)s, %(middle_name)s, %(last_name)s, % 
 (generation)s' 
 ) 
 db.supplier_contacts.supplier_id.requires = IS_IN_DB( 
 db, db.suppliers.id, '%(name)s', zero='Choose' 
 ) 
 db.supplier_contacts.supplier_id.readable = False 
 db.supplier_contacts.supplier_id.writable = False 

 +++ 
 ++ 

 This is the actual call from the controller: 
 # we already know the supplier_id and vendor_rep 
 hidden['supplier']=supplier_id 
 hidden['vendor_rep'=vendor_rep 
 field_lst = 'issue_date number shipto billto del_terms 
 currency pmt_terms project_no taxable po_contact ap_contact 
 documentation_required'.split(' ') 
 form = SQLTABLE(db.suppliers, fields=field_lst, 
 hidden=hidden) 



 On Aug 26, 8:39 am, Massimo Di Pierro massimo@gmail.com 
 wrote: 
  Can I see the model? 
  
  On Aug 26, 4:43 am, Cliff cjk...@gmail.com wrote: 
  
  
  
  
  
  
  
   I use SQLFORM something like this: 
  
   fields = 'dog_name dog_weight dog_birtdate'.split(' ') 
   hidden = {'dog_owner' : some_known_value} # We already know who the 
   owner is 
   SQLFORM(db.dogs, fields=fields, hidden=hidden) 
  
   The hidden fields are on the form.  When I submit the form, they are 
   in request.vars, but SQLFORM does not insert them in the database. 
  
   Is this the way it's supposed to work or do I have a bug? 
  
   Thanks, 

[web2py] Re: Passing variables and field values to crud onaccept function

2011-08-26 Thread Noel Villamor

Excellent! This is what I love w/ web2py, it is s flexible!

On Aug 27, 12:14 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 def funcdone(form,xyz):
     comment_id = form.vars.id
     ...
 def post_comment():
    xyz = 123
    form = crud.create(db.comment, onaccept=lambda
 form,xyz=xyz:funcdone(form,xyz))
    return dict(form=form)

 On Aug 26, 5:38 am, Noel Villamor noe...@gmail.com wrote:







  The model:

  db.define_table('comment', Field('txt'), Field('tag'))

  How do I pass/access the variable xyz, and the txt and tag field
  values in funcdone below?

  def funcdone(form):
      comment_id = form.vars.id
      ...

  def post_comment():
     xyz = 123
     form = crud.create(db.comment, onaccept=funcdone)
     return dict(form=form)

  Thanks!


[web2py] Re: Published my collection of plugins

2011-08-26 Thread Massimo Di Pierro
I would take a patch to include anytime.js in web2py as a replacement
to calendar.js. I like the way it is internationalized.

I would also take a patch to add multiline support to SQLTABLE

On Aug 26, 2:07 pm, DenesL denes1...@yahoo.ca wrote:
 +1
 specially like Anytime and Solid Table


[web2py] Re: Published my collection of plugins

2011-08-26 Thread Massimo Di Pierro
Do you want to host and manage all plugins? You have done an excellent
job here. You deserve to be the plugin master.

Massimo

On Aug 26, 11:35 am, kenji4569 hos...@s-cubism.jp wrote:
 Hi, I've just published a collection of plugins which I'd created for
 some web2py products (mainly cms sites) in my job:

 The index page:http://dev.s-cubism.com/web2py_plugins

 The plugins are below:

 [Form Widgets]
  Horizontal Radio Widgethttp://dev.s-cubism.com/plugin_hradio_widget
  Multiple Select Widgethttp://dev.s-cubism.com/plugin_multiselect_widget
  Suggest Widgethttp://dev.s-cubism.com/plugin_suggest_widget
  Lazy Options Widgethttp://dev.s-cubism.com/plugin_lazy_options_widget
  Anytime Widgethttp://dev.s-cubism.com/plugin_anytime_widget
  Color Widgethttp://dev.s-cubism.com/plugin_color_widget
  elRTE WYSIWYG Widgethttp://dev.s-cubism.com/plugin_elrte_widget
  Uploadify Widgethttp://dev.s-cubism.com/plugin_uploadify_widget

 [Form Customize]
  Solid Formhttp://dev.s-cubism.com/plugin_solidform
  Not-Empty Markerhttp://dev.s-cubism.com/plugin_notemptymarker

 [Table Customize]
  Solid Tablehttp://dev.s-cubism.com/plugin_solidtable
  Pagenatorhttp://dev.s-cubism.com/plugin_paginator
  Table Scopehttp://dev.s-cubism.com/plugin_tablescope
  Table Checkboxhttp://dev.s-cubism.com/plugin_tablecheckbox
  Table Permuterhttp://dev.s-cubism.com/plugin_tablepermuter

 You can try demos, see souces, and download plugins (MIT Licence).
 I'll appreciate your feedback and advises (especially for design
 decisions).
 I'll keep trying to create useful plugins and to improve them!


[web2py] Re: validators.py IS_IN_DB.__call__ elif self.theset must compare with str instead?

2011-08-26 Thread Carlos
just asking again ... thanks.

[web2py] ProgrammingError: LOB variable no longer valid after subsequent fetch

2011-08-26 Thread Tim Korb
In moving my database backend to Oracle, I'm getting this error:

ProgrammingError: LOB variable no longer valid after subsequent fetch


when trying to access the db.auth_event table.  The db.auth_group table 
works (it also has a CLOB type field).

There are posts from 2009 that this problem has been fixed.  Could there be 
something wrong with my tables?  (I did have to jump through some migrate 
hoops to get the backend moved over.)


[web2py] IS_IN_SET with integers

2011-08-26 Thread Carlos
Hi,

Should the following work (directly, e.g. from shell)?:

IS_IN_SET([1,2,3])(2)

I can see that it returns an error if the __call__ arg is not a string.

The following works ok:

IS_IN_SET([1,2,3])('2')

So my question is: should IS_IN_SET work directly with integers (instead of 
converting them to strings first)?.

Thanks,

   Carlos



[web2py] Has anyone configured web2py on the Basic Amazon Linux AMI?

2011-08-26 Thread Chris
I'm trying to set up and use web2py using the Amazon-branded Linux AMI
-- aka ami-8c1fece5

I seem to have it running on localhost -- but can't access it from a
remote machine, although I do have maximum security permissions turned
on, and am trying to access using the verified public IP address :
port number.

Is there some additional step to make the web2py process accessible
externally?

I'm frustrated :)  Would appreciate any help from the experts.


[web2py] Re: How do I run external cron when using mod_wsgi?

2011-08-26 Thread Eric Scott
OK, I've totally misunderstood what web2py external cron integration
meant.  I thought that I would be integrating system cron to run using
the web2py crontab.  I understand now that it's just describing a way
to use the system cron to call web2py, which means it's easy to set
command line parameters.  Now it all makes sense.

I do use cron and understand how to set it on a linux system.  The way
external cron was described on one site I found online, it sounded
like web2py somehow integrated with the system cron utility in such a
way that I could set the system cron using the crontab on the web2py
admin.

Thanks so much for clearing that up.  I just need to use system cron
utility as usual and set web2py command line switches as I would with
any program I run on the system cron.

Thanks again!

Eric


On Aug 26, 1:57 pm, Ross Peoples ross.peop...@gmail.com wrote:
 Correction on that last, -S is what tells web2py to not start Rocket, while
 -J is what tells web2py that it is running as a background process.


Re: [web2py] Re: fluxflex

2011-08-26 Thread Yota Ichino
oops! mistakes.

How to add a application:
1. clone from fluxflex repository.
2. copy your application(in web2py/applications/YOUR_APP) to
public_html/applications folder in the repository.
3. add new files to the repository.
4. commit and push


2011年8月27日4:55 Yota Ichino www.i...@gmail.com:
 Alan Etkin,

 Also tried to upload with git but i dont see how to do it for one 
 application into
 the pre-installed web2py folder.
 The way is copying web2py/applications/YOUR_APP folder to same cloned folder.



 2011/8/27 Alan Etkin spame...@gmail.com:
 Hi, the method you mentioned for application upload via url does the
 trick for large app files. The problem is that the user is forced to
 place an installer online somewhere as source for download. It would
 be very useful to be able to upload files normally. Also tried to
 upload with git but i dont see how to do it for one application into
 the pre-installed web2py folder.

 On 23 ago, 04:44, Yota Ichino www.i...@gmail.com wrote:
 nic,

 Plugin_wiki is a large file size. You can not upload large file.
 You need to paste http://web2py.com/examples/static/
 web2py.plugin.wiki.w2p to Use a url.

 On 8月23日, 午前11:00, nic nicats...@gmail.com wrote:

  This looks fantastic.
  Got web2py up and running in 2 mins as advertised.
  However when I tried to install the plugin_wiki I got the following
  error.

  
  Internal Server Error
  The server encountered an internal error or misconfiguration and was
  unable to complete your request.
  Please contact the server administrator, sys...@fluxflex.com and
  inform them of the time the error occurred, and anything you might
  have done that may have caused the  error.
  More information about this error may be available in the server error
  log.
  Apache/2.2.17 (Ubuntu) Server at wtpapps.fluxflex.com Port 443

  Has anyone been able to install the plugin_wiki or know how to access
  the server error log ?





[web2py] Re: ProgrammingError: LOB variable no longer valid after subsequent fetch

2011-08-26 Thread Massimo Di Pierro
Can you tell me the steps to reproduce the problem. Oracle deals with
BLOB in a different ways that any other database.

On Aug 26, 4:53 pm, Tim Korb jtk...@gmail.com wrote:
 In moving my database backend to Oracle, I'm getting this error:

 ProgrammingError: LOB variable no longer valid after subsequent fetch

 when trying to access the db.auth_event table.  The db.auth_group table
 works (it also has a CLOB type field).

 There are posts from 2009 that this problem has been fixed.  Could there be
 something wrong with my tables?  (I did have to jump through some migrate
 hoops to get the backend moved over.)


[web2py] Re: IS_IN_SET with integers

2011-08-26 Thread Massimo Di Pierro
I think you are right.

On Aug 26, 5:10 pm, Carlos carlosgali...@gmail.com wrote:
 Hi,

 Should the following work (directly, e.g. from shell)?:

     IS_IN_SET([1,2,3])(2)

 I can see that it returns an error if the __call__ arg is not a string.

 The following works ok:

     IS_IN_SET([1,2,3])('2')

 So my question is: should IS_IN_SET work directly with integers (instead of
 converting them to strings first)?.

 Thanks,

    Carlos


[web2py] Access Admin Interface via http without SSL or SSH

2011-08-26 Thread rami
Hello,

I recently decided to use web2py to develop a website and I have
Apache server with mod_wsgi on RedHat CENTOS.
What I want is to be able to develop a website using web2py and then
allow others to edit this website through web2py. For that it means
that I should be able to have access to the admin interface through
HTTP. However, I tried to see if I can access the Welcome default
application and I can, however I cannot access the administration
interface from here.

I tried looking at the options to access this admin interface however,
I need HTTPS or SSH or just comment some lines in /applications/admin/
models/access.py

I have spend quite a lot of time in trying to do this and it is
getting quite frustrating, but nothing that I tried works. I need to
get my website done and I will try other frameworks I can't get to
this admin interface soon.

So I tried:

1)
I tried looking in the HTTPS, but this server already had installed
Apache and mod_wsgi and mod_ssl on it. I tried tweaking it by editing /
etc/httpd/conf.d/ssl.conf  and after the


##
## SSL Virtual Host Context
##

VirtualHost _default_:443


I added this:

346  WSGIScriptAlias / /PATHTOWEB2PY/web2py/wsgihandler.py/ -

347
348   Directory /opt/web-apps/web2py
349 AllowOverride None
350 Order Allow,Deny
351 Deny from all
352 Files wsgihandler.py
353   Allow from all
354 /Files
355   /Directory
356
357   AliasMatch ^/([^/]+)/static/(.*) /opt/web-apps/web2py/
applications/\$1/static/\$2
358
359   Directory /opt/web-apps/web2py/applications/*/static
360 Options -Indexes
361 ExpiresActive On
362 ExpiresDefault access plus 1 hour
363 Order Allow,Deny
364 Allow from all
365   /Directory


This now when I try accessing the welcome app and the admin interface
in it, it still does not work giving me the
admin disabled because unable to access password file

I am not sure whether I should try setting up a virtual host for *443?

2)
Secondly, since I am not worried about the security here for web2py
and I wanted to disable the check for secure connection according to
this post:
http://www.web2pyslices.com/slices/take_slice/76

I edited
web2py/applications/admin/models/access.py
web2py/applications/admin/controllers/appadmin.py
and even the
applications/welcome/controllers/appadmin.py
that should allow admin access through the default Welcome
Application.

And this still did not work and I do not have access to the admin
interface. Do I have to do anything in addition to editing those files
and commenting these lines in those files (see below)?

#if request.env.web2py_runtime_gae:
#session_db = DAL('gae')
#session.connect(request, response, db=session_db)
#hosts = (http_host, )

#if request.env.http_x_forwarded_for or request.is_https:
#session.secure()
#elif not request.is_local and not DEMO_MODE:
#raise HTTP(200, T('Admin is disabled because insecure channel'))

 Any hints on how to access this admin interface on either of the two
methods that I tried???

Any help would be really appreciated!

Thank you so much.




[web2py] Re: Has anyone configured web2py on the Basic Amazon Linux AMI?

2011-08-26 Thread pbreit
The Amazon AMI is pretty locked down by default. I presume you've reviewed 
all the docs?
http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?LinuxAMIUserGuide.html

Would you be able to go with Ubuntu or some other AMI?


Re: [web2py] Access Admin Interface via http without SSL or SSH

2011-08-26 Thread Kenneth Lundström

 I am not sure whether I should try setting up a virtual host for *443?

If you´re running your web2py instance on an virtual host you have to 
have the virtual host directive for 443 too. I could send you my virutla 
host file.



Kenneth



[web2py] Re: New Plugin: plugin_ckeditor

2011-08-26 Thread tomt
FYI:  I ran into a problem using plugin_ckeditor when running web2py
on python 2.5.2.  It generates an error associated with modules/
plugin_ckeditor.py at line 44:

43  *self.settings.extra_fields.get(upload_name, []),
44  migrate = migrate,

When I upgraded python to 2.7.2 everything worked as designed with no
errors.

Just thought others might want to know. - Tom


[web2py] Re: GAE deployment problem

2011-08-26 Thread Jarrod Cugley
I'm kind of confused because I downloaded web2py on the mac and I have
a web2py.app file that has the folder 'Contents' inside it which then
has inside it: Frameworks, MacOS, Resources.

I've been treating Resources as my top-level folder for web2py because
it seems to be what works, but it doesn't have the gaehandler.py in
it? What do I do?

On Aug 26, 10:12 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 Look at the source of the code you are deploying. There should be a
 file:

 web2py/gaehandler.py

 for some reason this file did not get deployed on GAE. Perhaps you
 accidentally deleted it?

 massimo

 On Aug 25, 11:07 pm, Jarrod Cugley jcug...@gmail.com wrote:







  Oh I didn't know GAE had logs too whoops.

  It gives me the warning:

  File referenced by handler not found: gaehandler.py

  Any idea what that means?

  On Aug 26, 1:58 pm, Massimo Di Pierro massimo.dipie...@gmail.com
  wrote:

   Check the GAE logs on the dashboard.

   On Aug 25, 10:32 pm, Jarrod Cugley jcug...@gmail.com wrote:

So I've created a basic website that works on the web2py server, so I
wanted to test it on the GAE, these are my steps so far:

1. read:http://web2py.com/book/default/chapter/11#Google-App-Engine
2. copied the app.example.yaml into my app.yaml and changed the id to
the same id I used to create my app on GAE
3. Added the existing folder directory to GAE launcher
4. Run it, and it spits this out in the log:

*** Running dev_appserver with the following flags:
    --admin_console_server= --port=8080
Python command: /usr/bin/python2.6
Warning: You are using a Python runtime (2.6) that is more recent than
the production runtime environment (2.5). Your application may use
features that are not available in the production environment and may
not work correctly when deployed to production.
WARNING  2011-08-26 03:22:33,391 datastore_file_stub.py:512] Could not
read datastore data from /var/folders/t3/
yh6qg8x93q989_mdzgh9frd8gn/T/dev_appserver.datastore
INFO     2011-08-26 03:22:33,392 rdbms_sqlite.py:58] Connecting to
SQLite database '' with file '/var/folders/t3/
yh6qg8x93q989_mdzgh9frd8gn/T/dev_appserver.rdbms'
WARNING  2011-08-26 03:22:33,396 dev_appserver.py:4748] Could not
initialize images API; you are likely missing the Python PIL module.
ImportError: No module named _imaging
INFO     2011-08-26 03:22:33,405 dev_appserver_multiprocess.py:637]
Running application selfemployedlist on port 8080:http://localhost:8080

5. clicked the browse button in GAE launcher and it spits back 
this:https://gist.github.com/1172615
6. deploy it to GAE and it prints this in the GAE launcher log:

INFO     2011-08-26 03:24:12,743 dev_appserver_main.py:667] Server
interrupted by user, terminating

*** Running appfg.py with the following flags:
    --no_cookies --email=jcug...@gmail.com --passin update
Application: selfemployedlist; version: 1
Host: appengine.google.com

Starting update of app: selfemployedlist, version: 1
Scanning files on local disk.
Cloning 30 static files.
Cloning 135 application files.
Cloned 100 files.
Uploading 18 files and blobs.
Uploaded 18 files and blobs
Compilation starting.
Compilation completed.
Starting deployment.
Checking if deployment succeeded.
Will check again in 1 seconds.
Checking if deployment succeeded.
Will check again in 2 seconds.
Checking if deployment succeeded.
Will check again in 4 seconds.
Checking if deployment succeeded.
Deployment successful.
Checking if updated app version is serving.
Completed update of app: selfemployedlist, version: 1
Password for jcug...@gmail.com: If deploy fails you might need to
'rollback' manually.
The Make Symlinks... menu option can help with command-line work.
*** appcfg.py has finished with exit code 0 ***

7. Then view the version I just uploaded on GAE and it shows me this
in the browser:

Error: Server Error

The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this
error message and the query that caused it.


Re: [web2py] Re: GAE deployment problem

2011-08-26 Thread Jonathan Lundell
On Aug 26, 2011, at 6:32 PM, Jarrod Cugley wrote:

 I'm kind of confused because I downloaded web2py on the mac and I have
 a web2py.app file that has the folder 'Contents' inside it which then
 has inside it: Frameworks, MacOS, Resources.
 
 I've been treating Resources as my top-level folder for web2py because
 it seems to be what works, but it doesn't have the gaehandler.py in
 it? What do I do?

Download the source (instead of the Mac package) if you're deploying on GAE. 
It'll work fine on OS X, too.

[web2py] Re: Access Admin Interface via http without SSL or SSH

2011-08-26 Thread rami
Thank you, much for getting back with me.

I have news :) I got what I tried at 2) working. I was able to disable
the check for secure connection. What I forgot to do is to make sure
there is a parameters_.py file for the port I set my virtual host
on (I only had parameters_8000.py).

However, since I spent a few days trying to get this web2py through
HTTPS working anyway, I would like to get it to work this way too if
possible.
Therefore, let's continue to investigate 1).

Kenneth, sure, send me that file please. I guess then I would have to
comment the default virtual host that is set already in the etc/httpd/
conf.d/ssl.conf file, right? After the directive VirtualHost
_default_:443 I just have to comment everything and add this new
virtual host for 443 instead.


[web2py] Re: Published my collection of plugins

2011-08-26 Thread Christopher Steel
What a fantastic collection of plugins. Design wise I would say you are in 
the right zone, clean, light and nice examples.

Great job!

Chris


[web2py] fluxflex - how to?

2011-08-26 Thread MidGe
I am trying to use fluxflex but I must be missing something
fundamental as I do not understand what is happening when I follow the
instructions.

First of all, it all seems to be working fine. I can see the site and
I can log in admin etc...

When I use git to clone the fluxflex install on my machine, it gives
me a nearly empty repository!  I would expect to get an install
similar to the one I get when I unpack web2py on my machine.  I cannot
see any applications, let alone other files that I may need modify or
create, like routes.py.

Can someone point out to me where am I supposed to make the changes I
may require?  Where is the install of web2py located?  Should it not
be there when I git clone the flexflux instance to my drive?

Any help or pointer to a help would be greatly appreciated.



[web2py] Re: New Plugin: plugin_ckeditor

2011-08-26 Thread Massimo Di Pierro
Those two lines need to be exchanged since the syntax is only
supported in 2.7 and later.

On Aug 26, 8:24 pm, tomt tom_tren...@yahoo.com wrote:
 FYI:  I ran into a problem using plugin_ckeditor when running web2py
 on python 2.5.2.  It generates an error associated with modules/
 plugin_ckeditor.py at line 44:

 43  *self.settings.extra_fields.get(upload_name, []),
 44  migrate = migrate,

 When I upgraded python to 2.7.2 everything worked as designed with no
 errors.

 Just thought others might want to know. - Tom


[web2py] Re: GAE deployment problem

2011-08-26 Thread Jarrod Cugley
Ok, I've done that, but now what am I meant to do with the GAE
launcher settings? The documentation in the web2py book makes no
sense, I've done what it says but it doesn't work? In GAE launcher
what are the following settings meant to be?:

Application Name = ?
Application Directory = ?

when I set the directory to be web2py it just creates a new folder and
then I copy everything from web2py/applications/myapp into web2py/
myapp?

I'm so confused...

On Aug 27, 11:41 am, Jonathan Lundell jlund...@pobox.com wrote:
 On Aug 26, 2011, at 6:32 PM, Jarrod Cugley wrote:

  I'm kind of confused because I downloaded web2py on the mac and I have
  a web2py.app file that has the folder 'Contents' inside it which then
  has inside it: Frameworks, MacOS, Resources.

  I've been treating Resources as my top-level folder for web2py because
  it seems to be what works, but it doesn't have the gaehandler.py in
  it? What do I do?

 Download the source (instead of the Mac package) if you're deploying on GAE. 
 It'll work fine on OS X, too.


[web2py] Re: GAE deployment problem

2011-08-26 Thread Massimo Di Pierro
This is an old video but perhaps it may help:
http://vimeo.com/3703345

On Aug 26, 9:51 pm, Jarrod Cugley jcug...@gmail.com wrote:
 Ok, I've done that, but now what am I meant to do with the GAE
 launcher settings? The documentation in the web2py book makes no
 sense, I've done what it says but it doesn't work? In GAE launcher
 what are the following settings meant to be?:

 Application Name = ?
 Application Directory = ?

 when I set the directory to be web2py it just creates a new folder and
 then I copy everything from web2py/applications/myapp into web2py/
 myapp?

 I'm so confused...

 On Aug 27, 11:41 am, Jonathan Lundell jlund...@pobox.com wrote:







  On Aug 26, 2011, at 6:32 PM, Jarrod Cugley wrote:

   I'm kind of confused because I downloaded web2py on the mac and I have
   a web2py.app file that has the folder 'Contents' inside it which then
   has inside it: Frameworks, MacOS, Resources.

   I've been treating Resources as my top-level folder for web2py because
   it seems to be what works, but it doesn't have the gaehandler.py in
   it? What do I do?

  Download the source (instead of the Mac package) if you're deploying on 
  GAE. It'll work fine on OS X, too.


[web2py] Re: GAE deployment problem

2011-08-26 Thread Jarrod Cugley
Massimo, I watched the video, it was very helpful thank you, but I'm
still confused with how to upload my app onto GAE.

My app is inside the following directory: /web2py/applications/myapp

So I set my GAE launcher directory to: /web2py/

So I leave the application name empty? And where do the app.yaml and
queue.yaml files go?

I still get errors because it can't find modules like dev_appengine.py
and gaehander.py (which is in my web2py folder)

On Aug 27, 1:03 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 This is an old video but perhaps it may help:http://vimeo.com/3703345

 On Aug 26, 9:51 pm, Jarrod Cugley jcug...@gmail.com wrote:







  Ok, I've done that, but now what am I meant to do with the GAE
  launcher settings? The documentation in the web2py book makes no
  sense, I've done what it says but it doesn't work? In GAE launcher
  what are the following settings meant to be?:

  Application Name = ?
  Application Directory = ?

  when I set the directory to be web2py it just creates a new folder and
  then I copy everything from web2py/applications/myapp into web2py/
  myapp?

  I'm so confused...

  On Aug 27, 11:41 am, Jonathan Lundell jlund...@pobox.com wrote:

   On Aug 26, 2011, at 6:32 PM, Jarrod Cugley wrote:

I'm kind of confused because I downloaded web2py on the mac and I have
a web2py.app file that has the folder 'Contents' inside it which then
has inside it: Frameworks, MacOS, Resources.

I've been treating Resources as my top-level folder for web2py because
it seems to be what works, but it doesn't have the gaehandler.py in
it? What do I do?

   Download the source (instead of the Mac package) if you're deploying on 
   GAE. It'll work fine on OS X, too.


[web2py] Re: GAE deployment problem

2011-08-26 Thread Jarrod Cugley
Ok after hours of fiddling (yes it somehow took me that long HAHAHA) I
figured it out, thanks for the assistance Mass and Jon :)

On Aug 27, 2:08 pm, Jarrod Cugley jcug...@gmail.com wrote:
 Massimo, I watched the video, it was very helpful thank you, but I'm
 still confused with how to upload my app onto GAE.

 My app is inside the following directory: /web2py/applications/myapp

 So I set my GAE launcher directory to: /web2py/

 So I leave the application name empty? And where do the app.yaml and
 queue.yaml files go?

 I still get errors because it can't find modules like dev_appengine.py
 and gaehander.py (which is in my web2py folder)

 On Aug 27, 1:03 pm, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:







  This is an old video but perhaps it may help:http://vimeo.com/3703345

  On Aug 26, 9:51 pm, Jarrod Cugley jcug...@gmail.com wrote:

   Ok, I've done that, but now what am I meant to do with the GAE
   launcher settings? The documentation in the web2py book makes no
   sense, I've done what it says but it doesn't work? In GAE launcher
   what are the following settings meant to be?:

   Application Name = ?
   Application Directory = ?

   when I set the directory to be web2py it just creates a new folder and
   then I copy everything from web2py/applications/myapp into web2py/
   myapp?

   I'm so confused...

   On Aug 27, 11:41 am, Jonathan Lundell jlund...@pobox.com wrote:

On Aug 26, 2011, at 6:32 PM, Jarrod Cugley wrote:

 I'm kind of confused because I downloaded web2py on the mac and I have
 a web2py.app file that has the folder 'Contents' inside it which then
 has inside it: Frameworks, MacOS, Resources.

 I've been treating Resources as my top-level folder for web2py because
 it seems to be what works, but it doesn't have the gaehandler.py in
 it? What do I do?

Download the source (instead of the Mac package) if you're deploying on 
GAE. It'll work fine on OS X, too.


[web2py] Re: GAE deployment problem

2011-08-26 Thread Jarrod Cugley
One more thing, right now my URL is:

http://1.myapp.appspot.com/myapp/default/index

How would I make this:

http://myapp.appspot.com/

Without breaking everything?

On Aug 27, 3:15 pm, Jarrod Cugley jcug...@gmail.com wrote:
 Ok after hours of fiddling (yes it somehow took me that long HAHAHA) I
 figured it out, thanks for the assistance Mass and Jon :)

 On Aug 27, 2:08 pm, Jarrod Cugley jcug...@gmail.com wrote:







  Massimo, I watched the video, it was very helpful thank you, but I'm
  still confused with how to upload my app onto GAE.

  My app is inside the following directory: /web2py/applications/myapp

  So I set my GAE launcher directory to: /web2py/

  So I leave the application name empty? And where do the app.yaml and
  queue.yaml files go?

  I still get errors because it can't find modules like dev_appengine.py
  and gaehander.py (which is in my web2py folder)

  On Aug 27, 1:03 pm, Massimo Di Pierro massimo.dipie...@gmail.com
  wrote:

   This is an old video but perhaps it may help:http://vimeo.com/3703345

   On Aug 26, 9:51 pm, Jarrod Cugley jcug...@gmail.com wrote:

Ok, I've done that, but now what am I meant to do with the GAE
launcher settings? The documentation in the web2py book makes no
sense, I've done what it says but it doesn't work? In GAE launcher
what are the following settings meant to be?:

Application Name = ?
Application Directory = ?

when I set the directory to be web2py it just creates a new folder and
then I copy everything from web2py/applications/myapp into web2py/
myapp?

I'm so confused...

On Aug 27, 11:41 am, Jonathan Lundell jlund...@pobox.com wrote:

 On Aug 26, 2011, at 6:32 PM, Jarrod Cugley wrote:

  I'm kind of confused because I downloaded web2py on the mac and I 
  have
  a web2py.app file that has the folder 'Contents' inside it which 
  then
  has inside it: Frameworks, MacOS, Resources.

  I've been treating Resources as my top-level folder for web2py 
  because
  it seems to be what works, but it doesn't have the gaehandler.py in
  it? What do I do?

 Download the source (instead of the Mac package) if you're deploying 
 on GAE. It'll work fine on OS X, too.


[web2py] Re: GAE deployment problem

2011-08-26 Thread Anthony
Have you looked at this section of the book yet: 
http://web2py.com/book/default/chapter/04#URL-Rewrite


On Saturday, August 27, 2011 1:22:53 AM UTC-4, Jarrod Cugley wrote:

 One more thing, right now my URL is: 

 http://1.myapp.appspot.com/myapp/default/index 

 How would I make this: 

 http://myapp.appspot.com/ 

 Without breaking everything? 

 On Aug 27, 3:15 pm, Jarrod Cugley jcu...@gmail.com wrote: 
  Ok after hours of fiddling (yes it somehow took me that long HAHAHA) I 
  figured it out, thanks for the assistance Mass and Jon :) 
  
  On Aug 27, 2:08 pm, Jarrod Cugley jcu...@gmail.com wrote: 
  
  
  
  
  
  
  
   Massimo, I watched the video, it was very helpful thank you, but I'm 
   still confused with how to upload my app onto GAE. 
  
   My app is inside the following directory: /web2py/applications/myapp 
  
   So I set my GAE launcher directory to: /web2py/ 
  
   So I leave the application name empty? And where do the app.yaml and 
   queue.yaml files go? 
  
   I still get errors because it can't find modules like dev_appengine.py 
   and gaehander.py (which is in my web2py folder) 
  
   On Aug 27, 1:03 pm, Massimo Di Pierro massimo@gmail.com 
   wrote: 
  
This is an old video but perhaps it may help:
 http://vimeo.com/3703345 
  
On Aug 26, 9:51 pm, Jarrod Cugley jcu...@gmail.com wrote: 
  
 Ok, I've done that, but now what am I meant to do with the GAE 
 launcher settings? The documentation in the web2py book makes no 
 sense, I've done what it says but it doesn't work? In GAE launcher 
 what are the following settings meant to be?: 
  
 Application Name = ? 
 Application Directory = ? 
  
 when I set the directory to be web2py it just creates a new folder 
 and 
 then I copy everything from web2py/applications/myapp into web2py/ 
 myapp? 
  
 I'm so confused... 
  
 On Aug 27, 11:41 am, Jonathan Lundell jlun...@pobox.com wrote: 
  
  On Aug 26, 2011, at 6:32 PM, Jarrod Cugley wrote: 
  
   I'm kind of confused because I downloaded web2py on the mac and 
 I have 
   a web2py.app file that has the folder 'Contents' inside it 
 which then 
   has inside it: Frameworks, MacOS, Resources. 
  
   I've been treating Resources as my top-level folder for web2py 
 because 
   it seems to be what works, but it doesn't have the 
 gaehandler.py in 
   it? What do I do? 
  
  Download the source (instead of the Mac package) if you're 
 deploying on GAE. It'll work fine on OS X, too.



[web2py] Re: GAE deployment problem

2011-08-26 Thread Jarrod Cugley
Yeah but I didn't understand it at all really on my first read through
so I'm going to have to go back and read it over of course :)

On Aug 27, 3:26 pm, Anthony abasta...@gmail.com wrote:
 Have you looked at this section of the book 
 yet:http://web2py.com/book/default/chapter/04#URL-Rewrite







 On Saturday, August 27, 2011 1:22:53 AM UTC-4, Jarrod Cugley wrote:

  One more thing, right now my URL is:

     http://1.myapp.appspot.com/myapp/default/index

  How would I make this:

     http://myapp.appspot.com/

  Without breaking everything?

  On Aug 27, 3:15 pm, Jarrod Cugley jcu...@gmail.com wrote:
   Ok after hours of fiddling (yes it somehow took me that long HAHAHA) I
   figured it out, thanks for the assistance Mass and Jon :)

   On Aug 27, 2:08 pm, Jarrod Cugley jcu...@gmail.com wrote:

Massimo, I watched the video, it was very helpful thank you, but I'm
still confused with how to upload my app onto GAE.

My app is inside the following directory: /web2py/applications/myapp

So I set my GAE launcher directory to: /web2py/

So I leave the application name empty? And where do the app.yaml and
queue.yaml files go?

I still get errors because it can't find modules like dev_appengine.py
and gaehander.py (which is in my web2py folder)

On Aug 27, 1:03 pm, Massimo Di Pierro massimo@gmail.com
wrote:

 This is an old video but perhaps it may help:
 http://vimeo.com/3703345

 On Aug 26, 9:51 pm, Jarrod Cugley jcu...@gmail.com wrote:

  Ok, I've done that, but now what am I meant to do with the GAE
  launcher settings? The documentation in the web2py book makes no
  sense, I've done what it says but it doesn't work? In GAE launcher
  what are the following settings meant to be?:

  Application Name = ?
  Application Directory = ?

  when I set the directory to be web2py it just creates a new folder
  and
  then I copy everything from web2py/applications/myapp into web2py/
  myapp?

  I'm so confused...

  On Aug 27, 11:41 am, Jonathan Lundell jlun...@pobox.com wrote:

   On Aug 26, 2011, at 6:32 PM, Jarrod Cugley wrote:

I'm kind of confused because I downloaded web2py on the mac and
  I have
a web2py.app file that has the folder 'Contents' inside it
  which then
has inside it: Frameworks, MacOS, Resources.

I've been treating Resources as my top-level folder for web2py
  because
it seems to be what works, but it doesn't have the
  gaehandler.py in
it? What do I do?

   Download the source (instead of the Mac package) if you're
  deploying on GAE. It'll work fine on OS X, too.


[web2py] Re: GAE deployment problem

2011-08-26 Thread Jarrod Cugley
I can't figure out where my source code install is meant to be placed?
It just says I download the source code and type Python2.7 web2py and
it will work? But I get this error:

/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/
Contents/MacOS/Python: can't open file 'web2py': [Errno 2] No such
file or directory

Where is the source code meant to be placed after downloading?

On Aug 27, 3:26 pm, Anthony abasta...@gmail.com wrote:
 Have you looked at this section of the book 
 yet:http://web2py.com/book/default/chapter/04#URL-Rewrite







 On Saturday, August 27, 2011 1:22:53 AM UTC-4, Jarrod Cugley wrote:

  One more thing, right now my URL is:

     http://1.myapp.appspot.com/myapp/default/index

  How would I make this:

     http://myapp.appspot.com/

  Without breaking everything?

  On Aug 27, 3:15 pm, Jarrod Cugley jcu...@gmail.com wrote:
   Ok after hours of fiddling (yes it somehow took me that long HAHAHA) I
   figured it out, thanks for the assistance Mass and Jon :)

   On Aug 27, 2:08 pm, Jarrod Cugley jcu...@gmail.com wrote:

Massimo, I watched the video, it was very helpful thank you, but I'm
still confused with how to upload my app onto GAE.

My app is inside the following directory: /web2py/applications/myapp

So I set my GAE launcher directory to: /web2py/

So I leave the application name empty? And where do the app.yaml and
queue.yaml files go?

I still get errors because it can't find modules like dev_appengine.py
and gaehander.py (which is in my web2py folder)

On Aug 27, 1:03 pm, Massimo Di Pierro massimo@gmail.com
wrote:

 This is an old video but perhaps it may help:
 http://vimeo.com/3703345

 On Aug 26, 9:51 pm, Jarrod Cugley jcu...@gmail.com wrote:

  Ok, I've done that, but now what am I meant to do with the GAE
  launcher settings? The documentation in the web2py book makes no
  sense, I've done what it says but it doesn't work? In GAE launcher
  what are the following settings meant to be?:

  Application Name = ?
  Application Directory = ?

  when I set the directory to be web2py it just creates a new folder
  and
  then I copy everything from web2py/applications/myapp into web2py/
  myapp?

  I'm so confused...

  On Aug 27, 11:41 am, Jonathan Lundell jlun...@pobox.com wrote:

   On Aug 26, 2011, at 6:32 PM, Jarrod Cugley wrote:

I'm kind of confused because I downloaded web2py on the mac and
  I have
a web2py.app file that has the folder 'Contents' inside it
  which then
has inside it: Frameworks, MacOS, Resources.

I've been treating Resources as my top-level folder for web2py
  because
it seems to be what works, but it doesn't have the
  gaehandler.py in
it? What do I do?

   Download the source (instead of the Mac package) if you're
  deploying on GAE. It'll work fine on OS X, too.


[web2py] Re: GAE deployment problem

2011-08-26 Thread Anthony
Also, look at /web2py/router.example.py and /web2py/routes.example.py (note, 
if you want to use router.example.py, you have to rename it to routes.py, 
not router.py).

Anthony

On Saturday, August 27, 2011 1:32:15 AM UTC-4, Jarrod Cugley wrote:

 Yeah but I didn't understand it at all really on my first read through 
 so I'm going to have to go back and read it over of course :) 

 On Aug 27, 3:26 pm, Anthony abas...@gmail.com wrote: 
  Have you looked at this section of the book yet:
 http://web2py.com/book/default/chapter/04#URL-Rewrite 
  
  
  
  
  
  
  
  On Saturday, August 27, 2011 1:22:53 AM UTC-4, Jarrod Cugley wrote: 
  
   One more thing, right now my URL is: 
  
  http://1.myapp.appspot.com/myapp/default/index 
  
   How would I make this: 
  
  http://myapp.appspot.com/ 
  
   Without breaking everything? 
  
   On Aug 27, 3:15 pm, Jarrod Cugley jcu...@gmail.com wrote: 
Ok after hours of fiddling (yes it somehow took me that long HAHAHA) 
 I 
figured it out, thanks for the assistance Mass and Jon :) 
  
On Aug 27, 2:08 pm, Jarrod Cugley jcu...@gmail.com wrote: 
  
 Massimo, I watched the video, it was very helpful thank you, but 
 I'm 
 still confused with how to upload my app onto GAE. 
  
 My app is inside the following directory: 
 /web2py/applications/myapp 
  
 So I set my GAE launcher directory to: /web2py/ 
  
 So I leave the application name empty? And where do the app.yaml 
 and 
 queue.yaml files go? 
  
 I still get errors because it can't find modules like 
 dev_appengine.py 
 and gaehander.py (which is in my web2py folder) 
  
 On Aug 27, 1:03 pm, Massimo Di Pierro massi...@gmail.com 
 wrote: 
  
  This is an old video but perhaps it may help: 
  http://vimeo.com/3703345 
  
  On Aug 26, 9:51 pm, Jarrod Cugley jcu...@gmail.com wrote: 
  
   Ok, I've done that, but now what am I meant to do with the GAE 
   launcher settings? The documentation in the web2py book makes 
 no 
   sense, I've done what it says but it doesn't work? In GAE 
 launcher 
   what are the following settings meant to be?: 
  
   Application Name = ? 
   Application Directory = ? 
  
   when I set the directory to be web2py it just creates a new 
 folder 
   and 
   then I copy everything from web2py/applications/myapp into 
 web2py/ 
   myapp? 
  
   I'm so confused... 
  
   On Aug 27, 11:41 am, Jonathan Lundell jlu...@pobox.com 
 wrote: 
  
On Aug 26, 2011, at 6:32 PM, Jarrod Cugley wrote: 
  
 I'm kind of confused because I downloaded web2py on the mac 
 and 
   I have 
 a web2py.app file that has the folder 'Contents' inside it 
   which then 
 has inside it: Frameworks, MacOS, Resources. 
  
 I've been treating Resources as my top-level folder for 
 web2py 
   because 
 it seems to be what works, but it doesn't have the 
   gaehandler.py in 
 it? What do I do? 
  
Download the source (instead of the Mac package) if you're 
   deploying on GAE. It'll work fine on OS X, too.



Re: [web2py] Re: GAE deployment problem

2011-08-26 Thread Bruno Rocha
Go to GAE dashboard and manage versions choose the default version.

rename your app to 'init'

Then you have now myapp.appspot.com


[web2py] Re: GAE deployment problem

2011-08-26 Thread Jarrod Cugley
Oh interesting! Both great tips guys thanks Anthony and Bruno :)

On Aug 27, 3:37 pm, Bruno Rocha rochacbr...@gmail.com wrote:
 Go to GAE dashboard and manage versions choose the default version.

 rename your app to 'init'

 Then you have now myapp.appspot.com