[web2py] Integrate PHP project with web2py

2012-01-23 Thread ganesh waghmare
Hi all,

I have devloped a web2py site and I want to include chat application
into it which is implemented in php. How can I include this php in
web2py.

Thanks..


[web2py] Re: web2py with Plesk Control Panel ?

2012-01-23 Thread peter
The problem I found was that Plesk requires python 2.4 and Web2py
requires at least python 2.5. So one has to install python 2.5 or
higher (I use 2.6), and use this in parallel with the python 2.4. I
could get web2py working with the rocket server. I never did get it
working with Apache so I will be interested in your results. I
currently use uwsgi on its own. This means the static directory is
served through web2py but is otherwise fast. A better route would be
nginx and uwsgi, which will work but  on my system there are still
issues to resolve.

Good luck, keep us informed of your progress
Thanks
Peter



On Jan 22, 5:06 am, Bruno Rocha rochacbr...@gmail.com wrote:


Re: [web2py] Re: web2py with Plesk Control Panel ?

2012-01-23 Thread Roberto De Ioris

Il giorno 23/gen/2012, alle ore 10:09, peter ha scritto:

 The problem I found was that Plesk requires python 2.4 and Web2py
 requires at least python 2.5. So one has to install python 2.5 or
 higher (I use 2.6), and use this in parallel with the python 2.4. I
 could get web2py working with the rocket server. I never did get it
 working with Apache so I will be interested in your results. I
 currently use uwsgi on its own. This means the static directory is
 served through web2py but is otherwise fast. A better route would be
 nginx and uwsgi, which will work but  on my system there are still
 issues to resolve.

Recent uWSGI releases (1.0.1) contains highly optimized file serving via the 
options:

--check-static dir
--map-static [mountpoint=]dir

file will be served without passing control to web2py

 
 Good luck, keep us informed of your progress
 Thanks
 Peter
 
 
 
 On Jan 22, 5:06 am, Bruno Rocha rochacbr...@gmail.com wrote:

--
Roberto De Ioris
http://unbit.it
JID: robe...@jabber.unbit.it



[web2py] Re: web2py with Plesk Control Panel ?

2012-01-23 Thread LightDot
I believe this is the OS's requirement, not Plesk's. Plesk itself has no 
python parts and AFAIK uses mod_python to enable python for customer's 
sites.

If you are, ie., using CentOS/RHEL 5.x, than stock python version is 2.4 
and that's hard to upgrade due to some core systems depending on it, such 
as yum. Apache's mod_python is also built for the stock OS version of 
python, although I guess one could rip that out and build against something 
else. In this case, Plesk would use that instead. But it's not a clean 
solution.

Regards

On Monday, January 23, 2012 10:09:31 AM UTC+1, peter wrote:

 The problem I found was that Plesk requires python 2.4 and Web2py 
 requires at least python 2.5. So one has to install python 2.5 or 
 higher (I use 2.6), and use this in parallel with the python 2.4. I 
 could get web2py working with the rocket server. I never did get it 
 working with Apache so I will be interested in your results. I 
 currently use uwsgi on its own. This means the static directory is 
 served through web2py but is otherwise fast. A better route would be 
 nginx and uwsgi, which will work but  on my system there are still 
 issues to resolve. 

 Good luck, keep us informed of your progress 
 Thanks 
 Peter 



[web2py] Re: PSTV [Paradigm Shift Television] Powered by Inclusion

2012-01-23 Thread Rahul
This is a wonderful site. I liked it very much. Thanks.

Rahul

On Jan 21, 10:09 am, Andrew Evans andrew.rusty...@gmail.com wrote:
 Yes was made by me and a partner/friend of mine

 and ty







 On Fri, Jan 20, 2012 at 8:52 PM, Bruno Rocha rochacbr...@gmail.com wrote:
  looks very nice on mobile! congrats!

  On Sat, Jan 21, 2012 at 12:42 AM, Andrew Evans 
  andrew.rusty...@gmail.comwrote:

  Wondering if this site can be included in the powered by web2py

 www.paradigmshift.tv

  *cheers

  Andrew

  --

  Bruno Rocha
  [http://rochacbruno.com.br]


[web2py] Re: Auth.registration_requires_invitation

2012-01-23 Thread tsvim
Hi all,

I'd be happy to collaborate on such a feature if needed, as it is something 
on my roadmap for my app.
Basically, I want to allow 2 users to collaborate on the same data, by 
allowing a user to invite a friend to collaborate.
If you have some code already, please share.

Tsvi


[web2py] Re: Integrate PHP project with web2py

2012-01-23 Thread Alan Etkin
What kind of inclusion are you looking for? I suppose the most obvious
way is to append a php app to a web2py view trough AJAX. For
interaction perhaps it is possible to use web2py's XML and JSON views
and RPC calls between applications. You could also have web2py and php
share a database system like PostgreSQL.

On 23 ene, 05:52, ganesh waghmare ganeshwaghmar...@gmail.com wrote:
 Hi all,

 I have devloped a web2py site and I want to include chat application
 into it which is implemented in php. How can I include this php in
 web2py.

 Thanks..


[web2py] Re: web2py with Plesk Control Panel ?

2012-01-23 Thread Ross Peoples
You can install Python 2.6 on CentOS by using the EPEL yum repository. It 
will leave the system's Python 2.4 installation alone, since you don't want 
to mess that up. The Python 2.6 name will then be python26 instead of 
just python.

[web2py] Re: dig command or something like that

2012-01-23 Thread Niphlod
Never used before, but I just found this http://www.dnspython.org/

it seems better not to reinvent the wheel spawning a process and
parsing the output of a full dig command.

I just love to find this pieces of software around written in python.



On 22 Gen, 23:54, Kenneth Lundström kenneth.t.lundst...@gmail.com
wrote:
 Hello,

 I need to scan a list of domain names to find out the IP-address and
 DNS-server of that domain.

 I thought I'd run the dig command and parse the result.

 Is this possible or is there a better way for this?

 Kenneth


[web2py] Re: accepts KeyError: '_id', latest trunk with postgresql

2012-01-23 Thread Alan Etkin
There are similar error reports in this threads. For my error report,
I started a fix from trunk files, but I think that the developers are
working on this errors already.

http://groups.google.com/group/web2py/browse_thread/thread/691542fa739e67d1
http://www.google.com/url?sa=Dq=http://groups.google.com/group/web2py/browse_thread/thread/280f6b746e2b7201usg=AFQjCNFUX5WrRGPnX-brkO3vuBLOcybmBw

On 22 ene, 21:07, Carlos carlosgali...@gmail.com wrote:
 Hi,

 I'm getting the following error with latest trunk and postgresql,
 especially after changeset # fab104bec898 (web2py-py3k: proof of concept).

   File C:\web2py\gluon\sqlhtml.py, line 1082, in accepts
     hideerror=hideerror,
   File C:\web2py\gluon\html.py, line 1807, in accepts
     status = self._traverse(status,hideerror)
   File C:\web2py\gluon\html.py, line 749, in _traverse
     newstatus = c._traverse(status,hideerror) and newstatus
   File C:\web2py\gluon\html.py, line 749, in _traverse
     newstatus = c._traverse(status,hideerror) and newstatus
   File C:\web2py\gluon\html.py, line 749, in _traverse
     newstatus = c._traverse(status,hideerror) and newstatus
   File C:\web2py\gluon\html.py, line 749, in _traverse
     newstatus = c._traverse(status,hideerror) and newstatus
   File C:\web2py\gluon\html.py, line 756, in _traverse
     newstatus = self._validate()
   File C:\web2py\gluon\html.py, line 1572, in _validate
     (value, errors) = validator(value)
   File C:\web2py\gluon\validators.py, line 549, in __call__
     elif str(rows[0]._id) != str(self.record_id):
   File C:\web2py\gluon\dal.py, line 5003, in __getattr__
     return self[key]
   File C:\web2py\gluon\dal.py, line 4994, in __getitem__
     return dict.__getitem__(self, key)
 KeyError: '_id'

 This error does not occur when reverting to changeset # dafe70b55ae5 (oops,
 some tests were not committed, now they are).

 Is this a bug?.

 Thanks.

    Carlos


Re: [web2py] Re: web2py.com is down

2012-01-23 Thread Vasile Ermicioi
http://docs.webfaction.com/user-guide/overview.html
WebFaction performs daily backups of all your data and stores those backups
for ten days. You will be able to contact our support team to recover your
data as soon as you need it.


[web2py] email_auth works on web2py server, but not GAE

2012-01-23 Thread pattu
Hi -

I have found 150 answers to different questions already by googling my
way through this list, but I didn't find anything addressing
email_auth (using an smtp server).  Here is code that works fine
running the web2py server, but seems to fail both on the GAE
development server and also deployed.  I might have missed something,
but I have tried to be exhaustive here:


#Test this out:  Doesn't work on GAE in development or on Appspot... =-
(

#
#
from gluon.contrib.login_methods.email_auth import email_auth

#Try with default - same as auth.settings.login_methods =
[email_auth(server=gmail.com:587, domain=@gmail.com)]

auth.settings.login_methods = [email_auth()]
auth.settings.actions_disabled=['register','change_password','request_reset_password',
'profile']


Has anybody used email_auth on gae?  Or does anyone know why it fails,
and any ideas how to start debugging this?

Patrick


[web2py] Re: DAL IMAPAdapter

2012-01-23 Thread Alan Etkin
And modified limitby to accept a tuple.

set.select(..., limitby=(int:int))


[web2py] Re: email_auth works on web2py server, but not GAE

2012-01-23 Thread Massimo Di Pierro
Did you try it? How does it fail?

On Jan 23, 4:07 am, pattu itapplicationmanagem...@gmail.com wrote:
 Hi -

 I have found 150 answers to different questions already by googling my
 way through this list, but I didn't find anything addressing
 email_auth (using an smtp server).  Here is code that works fine
 running the web2py server, but seems to fail both on the GAE
 development server and also deployed.  I might have missed something,
 but I have tried to be exhaustive here:

 ### 
 #
 #Test this out:  Doesn't work on GAE in development or on Appspot... =-
 (
 ### 
 #
 #
 #
 from gluon.contrib.login_methods.email_auth import email_auth

 #Try with default - same as auth.settings.login_methods =
 [email_auth(server=gmail.com:587, domain=@gmail.com)]

 auth.settings.login_methods = [email_auth()]
 auth.settings.actions_disabled=['register','change_password','request_reset 
 _password',
 'profile']

 Has anybody used email_auth on gae?  Or does anyone know why it fails,
 and any ideas how to start debugging this?

 Patrick


[web2py] google code (mercurial) problem

2012-01-23 Thread Massimo Di Pierro
I messed up something with mercurial and the google code repository
has not been updated since Jan 17. The git repository on github should
be fine. You will find about 10 tickets marked as closed but the
trunk in googlecode will not show the fix.

Hopefully this will be fixed today.

Apologies.

Massimo


[web2py] Re: passing navigational links in the header and ajax woes

2012-01-23 Thread web-dev-m
Massimo,

Thank you very much for your reply.  I have made the changes to my
code, but it still didn't solve my problem with the AJAX call not
working.  Any suggestions?

On Jan 21, 11:40 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 In your code you have many calls to this:

    db(db.mydb.id==request.args(0)).select().first()

 which could be simplified into the equivalent expression

    db.mydb(request.args(0))

 You also have this:

     records=db(db.mydb.id==request.args(0)).select()
     ...
     counter=len(records)

 but id is unique so counter is always only 1 or 0.

 You also have:

         check=db(db.mydb.id==request.args(0)).select().first()
         if check !=None:
             
         else:
             row = db(db.mydb.id==request.args(0)).select().first()

 so row is exactly like check and therefore always None.

 Basically you code is equivalent to this:

 def my_func():
     if request.args:
         row = db.mydb(request.args(0))
         counter = 1 if row else 0
         if not row: # should be if row?
             my_id=row.id # always fails!
             (filename, stream)
 = db.mydb.myfield.retrieve(row.resourcefield)
             myfunc(id,filename,stream)
     else:
         redirect(URL('mycontroller','this_function'))
     records = [row] if row else []
     return(counter=counter, records=recods, row=row)

 On Jan 21, 5:54 am, web-dev-m mgrave...@gmail.com wrote:







  Dear Massimo,

  Thank you in advance for your time just looking.  If I can write a
  functional web application, you must be brilliant to have created this
  software.

  I am essentially trying to write a google docs clone with the ability
  to add notes.

  My users upload documents which a python function uses, modifies, and
  then stores the text in the database.  The view displays the text from
  the page in a set of divs.  I then use AJAX to create a note on the
  side via a form.

  The text from the document and the document title/file are in
  different tables.  Also, there is not guaranteed to be file text yet,
  as not every user that uploads a file will need to see the text, so I
  upload the file and get the text in two separate functions.

  My workflow is:

  1.) check to see if file exists in database
  2.) IF it doesnt, make it, and store the text in a table, then get the
  text fields.
  3.) IF it does, get the text fields from one table and the filename
  from another
  4.) Display file text in the view

  I then use AJAX to add a form which allows the user to add a note next
  to the text.


[web2py] Setting up Eclipse Indigo for a Web2py-based project

2012-01-23 Thread Carl
I'm moving to eclipse indigo but am missing some set-up sets.

I get 4 attempts like this one...
DEBUG: connect attempt 4, connection error:
Traceback (most recent call last):
  File E:\projects\ws\9birthdays\web2py\gluon\dal.py, line 4736, in 
__init__
self._adapter = ADAPTERS[self._dbname](*args)
  File E:\projects\ws\9birthdays\web2py\gluon\dal.py, line 1634, in 
__init__
raise RuntimeError, Unable to import driver
RuntimeError: Unable to import driver

Clearly, it's a simple bit of Eclipse config I'm missing but I can't find 
it! :)


Re: [web2py] Re: web2py.com is down

2012-01-23 Thread Bruce Wade
Oh you work for WebFaction? That explains why you like them ;) lol

On Mon, Jan 23, 2012 at 5:31 AM, Vasile Ermicioi elff...@gmail.com wrote:

 http://docs.webfaction.com/user-guide/overview.html
 WebFaction performs daily backups of all your data and stores those
 backups for ten days. You will be able to contact our support team to
 recover your data as soon as you need it.






-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


[web2py] Re: email_auth works on web2py server, but not GAE

2012-01-23 Thread pattu
Hi -

Fairly silently.  In the case of running the dev_appserver.py -
submitting a correct email and password to login form just shows a
very quick response of invalid login (flash message).  Compared to
running the web2py built in web server the response is too fast to let
me believe that my computer talked to the smtp server I am validating
against.. i.e. the request just failed as a failed login.  But I am
testing against my organization's smtp and against the gmail smtp,
which work fine with the web2py built in server.

I am not an experienced python debugger, and my attempts to try and
step through the smtplib code fail with the GAE - funny errors like
non-ascii characters in the source files, which make me think that
debugger I tried (winpdb) didn't like the GAE environment.

The deployed application also shares the same problem.

Somehow debugging whether GAE is letting a TLS request go through
correctly seems puzzling.  I was fairly interested in using the GAE
because it came with an easy https access option, (I don't mind the
appspot subdomain).  I have a short term app that I wanted security
for.  Googling I've seen some mentions that sockets are not
implemented fully on GAE, but I don't know if that is currently the
case.  I would be delighted to get an error message or exception - let
me know how to turn that on if it exists in inside the smtplib, for
example.

There could be some silly mistake I am making - I have made a few
hundred so far, but because the implementation in this case seems so
simple, I think that GAE might be at fault.  Is there a workaround do
you think?  In anycase this development process has really been fun -
web2py is a nice environment to work in.


On Jan 23, 7:21 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 Did you try it? How does it fail?

 On Jan 23, 4:07 am, pattu itapplicationmanagem...@gmail.com wrote:

  Hi -

  I have found 150 answers to different questions already by googling my
  way through this list, but I didn't find anything addressing
  email_auth (using an smtp server).  Here is code that works fine
  running the web2py server, but seems to fail both on the GAE
  development server and also deployed.  I might have missed something,
  but I have tried to be exhaustive here:

  ### 
  #
  #Test this out:  Doesn't work on GAE in development or on Appspot... =-
  (
  ### 
  #
  #
  #
  from gluon.contrib.login_methods.email_auth import email_auth

  #Try with default - same as auth.settings.login_methods =
  [email_auth(server=gmail.com:587, domain=@gmail.com)]

  auth.settings.login_methods = [email_auth()]
  auth.settings.actions_disabled=['register','change_password','request_reset 
  _password',
  'profile']

  Has anybody used email_auth on gae?  Or does anyone know why it fails,
  and any ideas how to start debugging this?

  Patrick




[web2py] Redirect Auth based on Membership

2012-01-23 Thread Andrew Evans
I want to redirect the admin user if they login as admin vs logging in as a
regular user

if auth.requires_membership('admin'):
 auth.settings.login_next = URL('control_panel', 'index')
 auth.settings.logout_next = URL('control_panel', 'index')

that is in my model atm but does not seem to do anything

Any ideas how I can accomplish this

*cheers


[web2py] Output web2py Errors to stdout/shell/commandline

2012-01-23 Thread Iwan Gabovitch
Hello,

I run web2py locally, to develop a website. Whenever there is an error, I 
see a website that looks like this:

*Internal errorTicket issued:
 *vpp2py/127.0.0.1.2012-01-23.17-14-03.ef3e7489-1e25-4aaf-e143-9b27004c4a2chttp://example.com/


I would prefer to see the traceback in the shell.

Is there a way to make web2py pass error messages to std output or a file 
(with human-readable formatting)?

I can output the application/appname/error/* files (Thanks to the nice 
people of #bash at irc.freenode/net !):

inotifywait . -m -e CLOSE_WRITE --format '%f' | while IFS= read -r f; do 
cat $f | sed -e 's/[^\]\\n/\n/g'; done

but I have a bad feeling about this, especially because of strings like 
'\r' turning into '\\r' and '\n' being used in the file instead of 
proper(?) newlines. Here's an example of what the 3-rd last line of a log 
file looks like:

S'Traceback (most recent call last):\n  File 
/home/qubodup/web/web2py/gluon/restricted.py, line 191, in restricted\n
ccode = compile2(code,layer)\n  File 
/home/qubodup/web/web2py/gluon/restricted.py, line 178, in compile2\n
return compile(code.rstrip().replace(\'\\r\\n\',\'\\n\')+\'\\n\', layer, 
\'exec\')\n  File /home/qubodup/web/web2py/applications/vpp2py/models/db.py, 
line 38\nplugins = PluginManager()x  # for configuring 
plugins\n ^\nSyntaxError: invalid syntax\n'


Thanks for reading. If nobody knows a better solution, hopefully the 
inotifywait line will come in handy to somebody else. :)



[web2py] Re: passing navigational links in the header and ajax woes

2012-01-23 Thread Massimo Di Pierro
I'd recommend you use the LOAD helper instead of ajax. If you repost
your more current code I will try help.

On Jan 23, 9:10 am, web-dev-m mgrave...@gmail.com wrote:
 Massimo,

 Thank you very much for your reply.  I have made the changes to my
 code, but it still didn't solve my problem with the AJAX call not
 working.  Any suggestions?

 On Jan 21, 11:40 pm, Massimo Di Pierro massimo.dipie...@gmail.com
 wrote:







  In your code you have many calls to this:

     db(db.mydb.id==request.args(0)).select().first()

  which could be simplified into the equivalent expression

     db.mydb(request.args(0))

  You also have this:

      records=db(db.mydb.id==request.args(0)).select()
      ...
      counter=len(records)

  but id is unique so counter is always only 1 or 0.

  You also have:

          check=db(db.mydb.id==request.args(0)).select().first()
          if check !=None:
              
          else:
              row = db(db.mydb.id==request.args(0)).select().first()

  so row is exactly like check and therefore always None.

  Basically you code is equivalent to this:

  def my_func():
      if request.args:
          row = db.mydb(request.args(0))
          counter = 1 if row else 0
          if not row: # should be if row?
              my_id=row.id # always fails!
              (filename, stream)
  = db.mydb.myfield.retrieve(row.resourcefield)
              myfunc(id,filename,stream)
      else:
          redirect(URL('mycontroller','this_function'))
      records = [row] if row else []
      return(counter=counter, records=recods, row=row)

  On Jan 21, 5:54 am, web-dev-m mgrave...@gmail.com wrote:

   Dear Massimo,

   Thank you in advance for your time just looking.  If I can write a
   functional web application, you must be brilliant to have created this
   software.

   I am essentially trying to write a google docs clone with the ability
   to add notes.

   My users upload documents which a python function uses, modifies, and
   then stores the text in the database.  The view displays the text from
   the page in a set of divs.  I then use AJAX to create a note on the
   side via a form.

   The text from the document and the document title/file are in
   different tables.  Also, there is not guaranteed to be file text yet,
   as not every user that uploads a file will need to see the text, so I
   upload the file and get the text in two separate functions.

   My workflow is:

   1.) check to see if file exists in database
   2.) IF it doesnt, make it, and store the text in a table, then get the
   text fields.
   3.) IF it does, get the text fields from one table and the filename
   from another
   4.) Display file text in the view

   I then use AJAX to add a form which allows the user to add a note next
   to the text.


[web2py] Re: Setting up Eclipse Indigo for a Web2py-based project

2012-01-23 Thread Carl
I've followed  
http://pierreth.blogspot.com/2010/10/web2py-eclipse-pydev-recipe.html  but 
without success.
Is there an up to date page of instructions for using Eclipse with Web2py?


[web2py] Re: Redirect Auth based on Membership

2012-01-23 Thread Andrew Evans
Nevermind got everything sorted my logic was a bit off

*cheers :D


On Mon, Jan 23, 2012 at 9:20 AM, Andrew Evans andrew.rusty...@gmail.comwrote:

 I want to redirect the admin user if they login as admin vs logging in as
 a regular user

 if auth.requires_membership('admin'):
  auth.settings.login_next = URL('control_panel', 'index')
  auth.settings.logout_next = URL('control_panel', 'index')

 that is in my model atm but does not seem to do anything

 Any ideas how I can accomplish this

 *cheers



[web2py] Re: google code (mercurial) problem

2012-01-23 Thread apple
Worked fine for me yesterday and today via mercurial. 13 revisions in
last 3 days.

On Jan 23, 2:35 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 I messed up something with mercurial and the google code repository
 has not been updated since Jan 17. The git repository on github should
 be fine. You will find about 10 tickets marked as closed but the
 trunk in googlecode will not show the fix.

 Hopefully this will be fixed today.

 Apologies.

 Massimo


Re: [web2py] google code (mercurial) problem

2012-01-23 Thread Bruno Rocha
in google repository just change the branch to pg8000 and you will see last
updates.

On Mon, Jan 23, 2012 at 12:35 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 I messed up something with mercurial and the google code repository
 has not been updated since Jan 17. The git repository on github should
 be fine. You will find about 10 tickets marked as closed but the
 trunk in googlecode will not show the fix.

 Hopefully this will be fixed today.

 Apologies.

 Massimo




-- 

Bruno Rocha
[http://rochacbruno.com.br]


Re: [web2py] Re: web2py.com is down

2012-01-23 Thread qasimak...@gmail.com
In last 2 years i have tried many VPS companies and trust me found linode
the best, service as well as customer support.

You guys can trust me because i dont work for them :).

On Mon, Jan 23, 2012 at 9:39 PM, Bruce Wade bruce.w...@gmail.com wrote:

 Oh you work for WebFaction? That explains why you like them ;) lol


 On Mon, Jan 23, 2012 at 5:31 AM, Vasile Ermicioi elff...@gmail.comwrote:

 http://docs.webfaction.com/user-guide/overview.html
 WebFaction performs daily backups of all your data and stores those
 backups for ten days. You will be able to contact our support team to
 recover your data as soon as you need it.






 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com



Re: [web2py] Re: web2py.com is down

2012-01-23 Thread Bruce Wade
Yeah I second Linode, I have tried webfaction for ethicaldeal.com however I
wasn't very happy considering they hike their prices fast always saying you
are consuming more memory and need to upgrade. You don't have that problem
with Linode which we are using for youadworld.com.

On Mon, Jan 23, 2012 at 11:52 AM, qasimak...@gmail.com qasimak...@gmail.com
 wrote:

 In last 2 years i have tried many VPS companies and trust me found linode
 the best, service as well as customer support.

 You guys can trust me because i dont work for them :).


 On Mon, Jan 23, 2012 at 9:39 PM, Bruce Wade bruce.w...@gmail.com wrote:

 Oh you work for WebFaction? That explains why you like them ;) lol


 On Mon, Jan 23, 2012 at 5:31 AM, Vasile Ermicioi elff...@gmail.comwrote:

 http://docs.webfaction.com/user-guide/overview.html
 WebFaction performs daily backups of all your data and stores those
 backups for ten days. You will be able to contact our support team to
 recover your data as soon as you need it.






 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com





-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com


Re: [web2py] Re: web2py.com is down

2012-01-23 Thread Alvaro Lizama Molina
linode is a good options :) +1

2012/1/23 Bruce Wade bruce.w...@gmail.com

 Yeah I second Linode, I have tried webfaction for ethicaldeal.com however
 I wasn't very happy considering they hike their prices fast always saying
 you are consuming more memory and need to upgrade. You don't have that
 problem with Linode which we are using for youadworld.com.


 On Mon, Jan 23, 2012 at 11:52 AM, qasimak...@gmail.com 
 qasimak...@gmail.com wrote:

 In last 2 years i have tried many VPS companies and trust me found linode
 the best, service as well as customer support.

 You guys can trust me because i dont work for them :).


 On Mon, Jan 23, 2012 at 9:39 PM, Bruce Wade bruce.w...@gmail.com wrote:

 Oh you work for WebFaction? That explains why you like them ;) lol


 On Mon, Jan 23, 2012 at 5:31 AM, Vasile Ermicioi elff...@gmail.comwrote:

 http://docs.webfaction.com/user-guide/overview.html
 WebFaction performs daily backups of all your data and stores those
 backups for ten days. You will be able to contact our support team to
 recover your data as soon as you need it.






 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com





 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com




-- 
Alvaro Lizama Molina  - http://alvarolizama.net


Re: [web2py] Re: web2py.com is down

2012-01-23 Thread qasimak...@gmail.com
BTW when every you buy linode just open a ticket to them and they will
convert your 50Mb port speed to 100Mb for free :)

On Tue, Jan 24, 2012 at 2:54 AM, Alvaro Lizama Molina nek...@gmail.comwrote:

 linode is a good options :) +1


 2012/1/23 Bruce Wade bruce.w...@gmail.com

 Yeah I second Linode, I have tried webfaction for ethicaldeal.comhowever I 
 wasn't very happy considering they hike their prices fast always
 saying you are consuming more memory and need to upgrade. You don't have
 that problem with Linode which we are using for youadworld.com.


 On Mon, Jan 23, 2012 at 11:52 AM, qasimak...@gmail.com 
 qasimak...@gmail.com wrote:

 In last 2 years i have tried many VPS companies and trust me found
 linode the best, service as well as customer support.

 You guys can trust me because i dont work for them :).


 On Mon, Jan 23, 2012 at 9:39 PM, Bruce Wade bruce.w...@gmail.comwrote:

 Oh you work for WebFaction? That explains why you like them ;) lol


 On Mon, Jan 23, 2012 at 5:31 AM, Vasile Ermicioi elff...@gmail.comwrote:

 http://docs.webfaction.com/user-guide/overview.html
 WebFaction performs daily backups of all your data and stores those
 backups for ten days. You will be able to contact our support team to
 recover your data as soon as you need it.






 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com





 --
 --
 Regards,
 Bruce Wade
 http://ca.linkedin.com/in/brucelwade
 http://www.wadecybertech.com
 http://www.warplydesigned.com
 http://www.fitnessfriendsfinder.com




 --
 Alvaro Lizama Molina  - http://alvarolizama.net



[web2py] Re: (OT) Choosing a javascript mvc framework

2012-01-23 Thread Chris May
This might be too late for your application, but I just saw this review of 
12 MVC frameworks.

http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/ 

Quoted from the page:

 Specifically, the following four features are very important to me:
 UI Bindings - I’m not just talking about templates, I’m talking about a 
 declarative approach to automatically updating the view layer when the 
 underlying model changes. Once you have used a framework (such as Flex) 
 that supports UI bindings, you can never go back.
 Composed Views - Like all software developers, I enjoy creating modular 
 reusable code. For this reason, when programming UI, I would like to be 
 able to compose views (preferably at the template layer). This should also 
 entail the potential for a rich view component hierarchy. An example of 
 this would be a reusable pagination widget.
 Web Presentation Layer - We are programming for the web here people, the 
 last thing I want are native-style widgets. There is also no reason for a 
 web framework to create it’s own layout manager. HTML and CSS are already 
 the richest way to do style and layout in existence, and should be used as 
 such. The framework should be centered around this concept.
 Plays Nicely With Others - Let’s face it, jQuery is pretty amazing. I 
 don’t want a framework which comes bundled with a sub-par jQuery clone, I 
 want a framework which recommends using jQuery itself.



[web2py] How to modify the look and text of: Remember me (for 30 days)?

2012-01-23 Thread thstart
I need to modify the look and text of: Remember me (for 30 days)

How to do that?


[web2py] Re: How to modify the look and text of: Remember me (for 30 days)?

2012-01-23 Thread thstart
Actually I need just to change Remember me (for 30 days) 

to 

Remember mebr(for 30 days) 


[web2py] Component reshows validation messages.

2012-01-23 Thread Jim Karsten
If a page has a component, the validation error messages may display a 
second time. In web2py_ajax.html the function web2py_ajax_init() gets 
called twice, first when the main page loads called by 
*jQuery(document).ready(function() 
{});* and second when the component loads, called by function *
web2py_ajax_page()*. If the component loads quickly, the second display may 
not be visible. I am working with a component that has a minor delay as it 
loads data and the validation errors on the main page form display, then 
hide and display again.

I made this change to function web2py_ajax_init()
was:  
  jQuery('.error').hide().slideDown('slow');
now: 
  jQuery('.error').each( function () 
{   


if (! jQuery(this).data('_error_shown')) 
{  
  jQuery(this).hide().slideDown('slow').data('_error_shown', 
1);

}   
  });  

Each error message displays only once now.


[web2py] Re: How to modify the look and text of: Remember me (for 30 days)?

2012-01-23 Thread Anthony
auth.messages.label_remember_me = CAT('Remember me', BR(), '(for 30 days)')

or

auth.messages.label_remember_me = XML('Remember mebr(for 30 days)')

should do it.

If you need special CSS styling, you could put the label inside a span with 
a specific class.

Anthony

On Monday, January 23, 2012 5:59:25 PM UTC-5, thstart wrote:

 Actually I need just to change Remember me (for 30 days) 

 to 

 Remember mebr(for 30 days) 



[web2py] Re: How to modify the look and text of: Remember me (for 30 days)?

2012-01-23 Thread thstart
Thank you  Anthony, will try it!

[web2py] Re: Component reshows validation messages.

2012-01-23 Thread Anthony
Do you have an old version of web2py.js? In the current version, it is:

jQuery('.error', target).hide().slideDown('slow');

Note that the jQuery selector now includes target, which limits it to 
just the component div when the component is loaded. I think that should 
prevent the double display -- when the component loads, it won't affect 
anything in the outer page.

Anthony

On Monday, January 23, 2012 6:13:21 PM UTC-5, Jim Karsten wrote:

 If a page has a component, the validation error messages may display a 
 second time. In web2py_ajax.html the function web2py_ajax_init() gets 
 called twice, first when the main page loads called by 
 *jQuery(document).ready(function() 
 {});* and second when the component loads, called by function *
 web2py_ajax_page()*. If the component loads quickly, the second display 
 may not be visible. I am working with a component that has a minor delay as 
 it loads data and the validation errors on the main page form display, then 
 hide and display again.

 I made this change to function web2py_ajax_init()
 was:  
   jQuery('.error').hide().slideDown('slow');
 now: 
   jQuery('.error').each( function () 
 { 
   

 if (! jQuery(this).data('_error_shown')) 
 {  
   jQuery(this).hide().slideDown('slow').data('_error_shown', 
 1);
 
 }   
   });  

 Each error message displays only once now.



[web2py] Re: How to modify the look and text of: Remember me (for 30 days)?

2012-01-23 Thread thstart
It worked. Now I want to change  *formstyle* and default labels:
1) E-mail to Email
2) The message in red below Email: Invalid email to Please enter a valid 
email address.
3) The message in red below password: too short to Please enter a valid 
password.
too short is actually misleading because I am hitting Sign Up with all 
fields empty.


auth.settings.login_onvalidation = login_email_lower
current.app.auth =  auth
form=current.app.auth.login(next=login_next)

form.custom.submit['_data-theme'] = 'e'
form.custom.submit_button = 'Sign In'

like in:

form_add_email_address = SQLFORM.factory(
Field('email_address', 
requires=[IS_NOT_EMPTY(), IS_EMAIL(error_message='invalid email!')]),
submit_button = 'Add',
*formstyle *= 'table2cols' 
   
  )



[web2py] Re: How to modify the look and text of: Remember me (for 30 days)?

2012-01-23 Thread Anthony
There should be settings for all that stuff 
here: http://web2py.com/books/default/chapter/29/9#Settings-and-messages -- 
mostly in auth.messages.

Anthony

On Monday, January 23, 2012 7:39:45 PM UTC-5, thstart wrote:

 It worked. Now I want to change  *formstyle* and default labels:
 1) E-mail to Email
 2) The message in red below Email: Invalid email to Please enter a valid 
 email address.
 3) The message in red below password: too short to Please enter a valid 
 password.
 too short is actually misleading because I am hitting Sign Up with all 
 fields empty.


 auth.settings.login_onvalidation = login_email_lower
 current.app.auth =  auth
 form=current.app.auth.login(next=login_next)
 
 form.custom.submit['_data-theme'] = 'e'
 form.custom.submit_button = 'Sign In'

 like in:

 form_add_email_address = SQLFORM.factory(
 Field('email_address', 
 requires=[IS_NOT_EMPTY(), IS_EMAIL(error_message='invalid email!')]),
 submit_button = 'Add',
 *formstyle *= 'table2cols'   
  
   )



[web2py] Re: How to modify the look and text of: Remember me (for 30 days)?

2012-01-23 Thread thstart
This is working:
auth.settings.formstyle ='divs'

This is not working (it remains E-mail):
auth.messages.label_email = 'Email'

Remember me (for 30 days works) - but there is a space above it up to 
password - how to remove it?





[web2py] Re: How to modify the look and text of: Remember me (for 30 days)?

2012-01-23 Thread thstart
Also on Sign Up form I got a message 'too short' below the Password field - 
in the book link there is not correspondent function to change it.

Additionally, tried to change 
auth.messages.invalid_email = 'Please enter a valid email address'

But it still shows 'Invalid email'





[web2py] Re: Component reshows validation messages.

2012-01-23 Thread Jim Karsten
Yeah, my version is a bit dated. I'll have a look at the newer stuff. 
Thanks Anthony.


Re: [web2py] Re: web2py.com is down

2012-01-23 Thread Vasile Ermicioi

 Oh you work for WebFaction? That explains why you like them ;) lol


I am not working for webfaction, I just cited from the link I gave you

Yeah I second Linode, I have tried webfaction for ethicaldeal.com however I
 wasn't very happy considering they hike their prices fast always saying you
 are consuming more memory and need to upgrade. You don't have that problem
 with Linode which we are using for youadworld.com.


1) High memory usage
High memory usage was a problem with apache, and 2 solutions that makes it
a no problem
- uwsgi: I successfully run a bunch of sites even on 80Mb RAM, and Roberto
optimized it even more for low resource systems
- they recently increased memory to 256Mb, and this is memory consumed by
your processes, not by server or mysql database

2) Why I like them
In 2 years my websites were never down. I tried linode too. What made me
chose webfaction is the fact that they offer more per buck.

so a comparison to linode (RAM, storage,  bandwidth, price)

Note:
I consider webfaction default memory to be equal to 512MB of linode,
because 256MB are used by system: e.g ubuntu, mysql database, etc

Linode512: 512MB, 20GB,  200GB,  $19.95
Webfaction: 256MB, 100GB, 600GB,  $9.50 ,

Linode768:  768MB, 30GB,  300GB,   $29.95
Webfaction: 256MB + 256MB, 100GB, 600GB, $ $9.50+$7=$17 (256MB additional
memory)

Linode: pay month-to-month, even if you contact
Webfaction: 1 year payment - price is $8.50/month, , 5 years payment
- $5.50/month

If you need additional resources

Linode:
transfer $0.10/GB,
if you need additional space only method that I found was to upgrade to
next plan,
that means + $10 for 256MB/10GB/100GB

Webfaction:
disk +$5/month per 50GB ,
bandwidth +$5/month per 300GB
memory +$7/month per 256MB (up to 768MB)

interesting: webfaction traffic is equivalent to $0.017/GB vs Linode
$0.10/GB

Note:
when I reviewed tens of hosting solutions  and tried a few ones and lost
some money on them,
I wanted to chose a trusted/recommended one. And both of them are great and
deserve their reputation.
My opinion is just that webfaction is cheaper and have all of features that
I need for my hosting needs

Interesting:
You can scale as much as you need by load balancing your
plans(webfaction)/Linodes.


3) backup

 Unfortunately this is not good enough for me. I want the daily, weakly
 and monthly backups and I want to be able to restore them through the
 web interface. What happens if I am traveling and I discover an
 intrusion 2 weeks after the facts?


Linode offers this service at additional price.
Why not asking webfaction support team about that?


[web2py] Problem with plugin_PowerFormWizard and Internetexplorer

2012-01-23 Thread Oli
I use the plugin_PowerFormWizard for a registration and all works fine with 
firefox and chrome. But if I use the Internetexplorer 6,7,8,9 nothing 
happens, no error but also no registration. Is there anybody who could help 
me?

OF.

Code 

def index():
# Ausgewaehlte Veranstaltung
Veranstaltungsausgewaehlt = 
db(db.veranstaltung.auswahl==True).select(db.veranstaltung.name)[0]['name']

# Erklaerung zur Meldung
Erklaerung = Durch die Teilnahme am internationalen Fellbacher 
6/12-Stundenlauf wird der in der Ausschreibung veröffentlichte 
Haftungsausschluss anerkannt. Mit der Anmeldung wird bestätigt, dass für 
den Lauf ausreichend trainiert wurde und für die Teilnahme keine ärztlichen 
Bedenken vorliegen. Es besteht Einverständnis, dass die persönlichen Daten 
im Rahmen der organisatorischen Durchführung der Veranstaltung genutzt 
werden dürfen. Es werden keine Vergütungsansprüche für Fotos, Filmaufnahmen 
usw., die im Rahmen der Veranstaltung gemacht werden, erhoben. Mit der 
Durchführung der Anmeldung wird versichert, dass die Daten in der Meldung 
richtig sind und die Ausschreibung anerkannt wird.

# STEPS: A dict with fields for each step
# title and legend will be descriptions
mysteps = [dict(title='ich akzeptiere', legend='ich akzeptieren den 
obigen Inhalt des Textes', fields=['akzeptiert']),
   dict(title='Disziplin', legend='gewünschten Lauf auswählen', 
fields=['lauf']),
   dict(title='Person',legend='persönliche Daten 
eingeben',fields=['nachname','vorname','nationalitaet','geburtsdatum','geschlecht','email']),
   dict(title='Adressse', legend='Adressdaten eingeben', 
fields=['strasse','ort']),
   dict(title='Verein / Staffel', legend='Vereinsname oder 
Staffelname und die Namen (Nach-, Vorname) der Staffelteilnehmer eingeben', 
fields=['vereinstaffel','staffelteilnehmer']),
   dict(title='Bank', legend='Bankverbindung eingeben', 
fields=['kontoinhaber','geldinstitut','blz','kontonr'])]
   
   # ,
   # dict(title='eigenes Zelt?', legend='Wird ein eigenes Zelt 
mitgebracht?', fields=['eigeneszelt']),
   # dict(title='Unterkunft', legend='Unterkunft im Jugendraum 
von Freitag auf Samstag gewünscht ?', fields=['unterkunft',])]

# IMPORT: Import the module
from plugin_PowerFormWizard import PowerFormWizard

# CUSTOMIZE: Set some options
# Client side validation
# Show legends, hide descriptions
options = {'description':True, 'legend':False, 'validate':True}

# CREATE: Create the form object just like the SQLFORM - PASS the 
options
form = PowerFormWizard(db.meldungen, steps=mysteps, options=options) 

# VALIDATE: web2py form validation
if form.accepts(request.vars, session):
# Preis aus dem Eintrag des Laufs entnehmen und in Betrag speichern
from gluon.tools import Mail
import string
mail=Mail()
mail.settings.server='smtp.gmail.com:587'
mail.settings.login='em...@googlemail.com:PASSWORD'
mail.settings.sender='em...@googlemail.com'
sendtoemail = form.vars.email

# Laufbezeichnung aus den Formulardaten ermitteln
laufbezeichnung = 
db(db.lauf.id==form.vars.lauf).select(db.lauf.bezeichnung)[0]['bezeichnung']

# Betrag aus den Formulardaten des Feldes - Lauf - ermitteln
betrag = 
string.split(string.split(db(db.lauf.id==form.vars.lauf).select(db.lauf.bezeichnung)[0]['bezeichnung'],
 
 - )[1],.)[0]

# Betrag in den Datensatz schreiben.
db(db.meldungen.id==form.vars.id).update(betrag=betrag)

#send the message
mail.send(to=[sendtoemail], subject='Anmeldebestätigung - TSV 
Schmiden Leichtatletik - %s' % Veranstaltungsausgewaehlt, message='Hallo %s 
%s,\n\ndie Anmeldung: %s ist eingegangen. \n\nVielen Dank\nTSV Schmiden 
Leichtathletik' %(form.vars.vorname, form.vars.nachname, laufbezeichnung))

response.flash = Vielen Dank für Ihre Meldung - TSV Schmiden 
Leichtathletik.

elif form.errors: 
form.step_validation() # VERY IMPORTANT FOR VALIDATION
response.flash = Bei der Eingabe Ihrer Anmeldung ist ein Fehler 
aufgetreten.

# Enjoy!
return dict(Erklaerung=Erklaerung , 
Veranstaltungsausgewaehlt=Veranstaltungsausgewaehlt, form=form)



Re: [web2py] Problem with plugin_PowerFormWizard and Internetexplorer

2012-01-23 Thread Bruno Rocha
Seems to be JavaScript problem, can you see any JS message in Firebug or
Chrome console?

I dont know if I.E has something like Firebug to track JS errors.

I just tested the examples in http://labs.blouweb.com/powerformwizard in
I.E 8 and worked very well, By the way the plugin uses two Jquery libs


   - http://www.wbotelhos.com/stepy/ - there is a new version in github
   - jquery validate - I dont if it has a new version


I will try to reproduce your form here for tests



2012/1/23 Oli oliver.fr...@gmx.net

 I use the plugin_PowerFormWizard for a registration and all works fine
 with firefox and chrome. But if I use the Internetexplorer 6,7,8,9 nothing
 happens, no error but also no registration. Is there anybody who could help
 me?

 OF.

 Code

 def index():
 # Ausgewaehlte Veranstaltung
 Veranstaltungsausgewaehlt = db(db.veranstaltung.auswahl==True).select(
 db.veranstaltung.name)[0]['name']

 # Erklaerung zur Meldung
 Erklaerung = Durch die Teilnahme am internationalen Fellbacher
 6/12-Stundenlauf wird der in der Ausschreibung veröffentlichte
 Haftungsausschluss anerkannt. Mit der Anmeldung wird bestätigt, dass für
 den Lauf ausreichend trainiert wurde und für die Teilnahme keine ärztlichen
 Bedenken vorliegen. Es besteht Einverständnis, dass die persönlichen Daten
 im Rahmen der organisatorischen Durchführung der Veranstaltung genutzt
 werden dürfen. Es werden keine Vergütungsansprüche für Fotos, Filmaufnahmen
 usw., die im Rahmen der Veranstaltung gemacht werden, erhoben. Mit der
 Durchführung der Anmeldung wird versichert, dass die Daten in der Meldung
 richtig sind und die Ausschreibung anerkannt wird.

 # STEPS: A dict with fields for each step
 # title and legend will be descriptions
 mysteps = [dict(title='ich akzeptiere', legend='ich akzeptieren den
 obigen Inhalt des Textes', fields=['akzeptiert']),
dict(title='Disziplin', legend='gewünschten Lauf
 auswählen', fields=['lauf']),
dict(title='Person',legend='persönliche Daten
 eingeben',fields=['nachname','vorname','nationalitaet','geburtsdatum','geschlecht','email']),
dict(title='Adressse', legend='Adressdaten eingeben',
 fields=['strasse','ort']),
dict(title='Verein / Staffel', legend='Vereinsname oder
 Staffelname und die Namen (Nach-, Vorname) der Staffelteilnehmer eingeben',
 fields=['vereinstaffel','staffelteilnehmer']),
dict(title='Bank', legend='Bankverbindung eingeben',
 fields=['kontoinhaber','geldinstitut','blz','kontonr'])]

# ,
# dict(title='eigenes Zelt?', legend='Wird ein eigenes Zelt
 mitgebracht?', fields=['eigeneszelt']),
# dict(title='Unterkunft', legend='Unterkunft im Jugendraum
 von Freitag auf Samstag gewünscht ?', fields=['unterkunft',])]

 # IMPORT: Import the module
 from plugin_PowerFormWizard import PowerFormWizard

 # CUSTOMIZE: Set some options
 # Client side validation
 # Show legends, hide descriptions
 options = {'description':True, 'legend':False, 'validate':True}

 # CREATE: Create the form object just like the SQLFORM - PASS the
 options
 form = PowerFormWizard(db.meldungen, steps=mysteps, options=options)

 # VALIDATE: web2py form validation
 if form.accepts(request.vars, session):
 # Preis aus dem Eintrag des Laufs entnehmen und in Betrag speichern
 from gluon.tools import Mail
 import string
 mail=Mail()
 mail.settings.server='smtp.gmail.com:587'
 mail.settings.login='em...@googlemail.com:PASSWORD'
 mail.settings.sender='em...@googlemail.com'
 sendtoemail = form.vars.email

 # Laufbezeichnung aus den Formulardaten ermitteln
 laufbezeichnung = db(db.lauf.id
 ==form.vars.lauf).select(db.lauf.bezeichnung)[0]['bezeichnung']

 # Betrag aus den Formulardaten des Feldes - Lauf - ermitteln
 betrag = 
 string.split(string.split(db(db.lauf.id==form.vars.lauf).select(db.lauf.bezeichnung)[0]['bezeichnung'],
  - )[1],.)[0]

 # Betrag in den Datensatz schreiben.
 db(db.meldungen.id==form.vars.id).update(betrag=betrag)

 #send the message
 mail.send(to=[sendtoemail], subject='Anmeldebestätigung - TSV
 Schmiden Leichtatletik - %s' % Veranstaltungsausgewaehlt, message='Hallo %s
 %s,\n\ndie Anmeldung: %s ist eingegangen. \n\nVielen Dank\nTSV Schmiden
 Leichtathletik' %(form.vars.vorname, form.vars.nachname, laufbezeichnung))

 response.flash = Vielen Dank für Ihre Meldung - TSV Schmiden
 Leichtathletik.

 elif form.errors:
 form.step_validation() # VERY IMPORTANT FOR VALIDATION
 response.flash = Bei der Eingabe Ihrer Anmeldung ist ein Fehler
 aufgetreten.

 # Enjoy!
 return dict(Erklaerung=Erklaerung ,
 Veranstaltungsausgewaehlt=Veranstaltungsausgewaehlt, form=form)




-- 

Bruno Rocha
[http://rochacbruno.com.br]


[web2py] Some database related changes to web2py core

2012-01-23 Thread Ben Goosman


I'm not sure if these are actual bug fixes or simply misinformed hacks 
(please let me know), but I think they might be useful to the community. My 
notes are for version 1.99.2 so the line numbers may be a little off. Most 
of the changes are the result of trying to get Oracle and multiple key 
tables to work.

I added values for 'reference FK' and 'reference 'TFK' in dal.py for the 
Oracle adapter.
'reference FK': ', CONSTRAINT FK_%(constraint_name)s FOREIGN KEY 
(%(field_name)s) REFERENCES %(foreign_key)s ON DELETE %(on_delete_action)s',
'reference TFK': ' CONSTRAINT FK_%(foreign_table)s_PK FOREIGN KEY 
(%(field_name)s) REFERENCES %(foreign_table)s (%(foreign_key)s) ON DELETE 
%(on_delete_action)s',
 
I changed line 1046 in sqlhtml.py per http://tinyurl.com/7wn8sjv which 
seems to allow the crud update page to display.
# Before
record_id = dict((k, request_vars[k]) for k in self.table._primarykey)
# After
record_id = dict((k, request_vars.get(k,None)) for k in 
self.table._primarykey)

I changed line 761 in sqlhtml.py
# Before
self.record_id = dict([(k,record[k]) for k in table._primarykey])
# After
self.record_id = dict([(k,str(record[k])) for k in table._primarykey])
which allows the crud update form to be submitted. The problem lied in the 
update form for dataSource. Since dataSource is keyed by source_id, SQLFORM 
uses source_id as the record_id for any record you edit. Web2py performs a 
security check on the value of the record_id before and after the form was 
submitted. If the record_id changes, web2py complains. Since source_id is 
an integer, web2py saved it as an integer into the record_id. Since 
source_id appears on the update form, it is converted to a string. Since 
num != 'num', a security error occurred. The temporary(?) solution is to 
convert every value in the record_id to a string before form submission.

Changed line 3071 in tools.py
# Before
if not (isinstance(table, self.db.Table) or table in self.db.tables) \
or not str(record_id).isdigit():
raise HTTP(404)
# After
if not (isinstance(table, self.db.Table) or table in self.db.tables):
raise HTTP(404)
This change should allow crud delete to work with keyed databases, since 
line 3090 can accept a dictionary of key assignments. Thus, for the 
dataSource table we can pass in dict(source_id=the_source_id) to 
crud.delete().


[web2py] to the new user who posted a suggestions...

2012-01-23 Thread Massimo Di Pierro
I just approved a message from a new user but something went wrong and
your pending messages (three of them) disappeared. Not sure why.
Please post again.

massimo


[web2py] Re: to the new user who posted a suggestions...

2012-01-23 Thread Ben Goosman
Thanks Massimo, I didn't realize there was an approval stage. (hence
the 3 submissions :))

On Jan 24, 1:33 am, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
 I just approved a message from a new user but something went wrong and
 your pending messages (three of them) disappeared. Not sure why.
 Please post again.

 massimo