[web2py:29301] Re: Every while and then file upload fails

2009-08-25 Thread mmstud

Didnt happen with Firefox yesterday. I try today with Safari again.

On Aug 24, 8:53 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 It should not be a problem.

 On Aug 24, 12:02 pm,mmstudmms...@gmail.com wrote:



  I've been using Safari. Can try some hours with Firefox. One thing Im
  doing, is to hit enter after giving new name to file and sometimes
  clicking the submit button. Could it submit wrong form with enter?

  -Marko

  On Aug 24, 7:59 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   I use a macbook and never had this problem. Do you get the probelm
   with both the source and binary? Can you reproduce it on different
   browsers? Which ones?

   Massimo

   On Aug 24, 11:48 am,mmstudmms...@gmail.com wrote:

I have seen this happening every 3-5 file upload. Im using admin
panel to upload static files. After 2-4 succesful upload this
happens:

Error traceback
Traceback (most recent call last):
  File /Users/mmstud/Downloads/web2py-read-only/gluon/main.py, line
320, in wsgibase
    int(request.env.content_length))
  File /Users/mmstud/Downloads/web2py-read-only/gluon/fileutils.py,
line 267, in copystream
    data = src.read(size)
  File /Users/mmstud/Downloads/web2py-read-only/gluon/wsgiserver.py,
line 192, in read
    data = self.rfile.read(size)
  File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/socket.py, line 309, in read
    data = self._sock.recv(recv_size)
timeout: timed out

Is it a serious problem? When I re upload same file, it usually works.
Im doing development on my macbook.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29302] Re: ticket events

2009-08-25 Thread Richard

A few questions/comments from my experience implementing this:


tickets2db.py needs an update because of a new interface for
RestrictedError():
40) error.load(filename) - error.load(request, request.app,
filename)


If I want to reuse the admin ticket view in another controller, is
this the proper way?
response.view = '../../admin/views/default/ticket.html'


The code line numbers in my tickets don't match the correct code line
because there is an extra new line inserted between every code line.
So a 3 line function is being rendered like this:
1. def user():
2.
3.   response.view = 'form.html'

  return dict(form=auth())

Richard


On Aug 25, 3:52 pm, Richard richar...@gmail.com wrote:
 just one host.
 hmm, I guess an RSS feed won't be queried often so efficiency is not
 important and I can just read from disk like you suggest.

 Richard

 On Aug 24, 7:31 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  I do not know if you need to load them in db unless you have multiple
  hosts.

  On Aug 24, 12:09 am, Richard richar...@gmail.com wrote:

   hello,

   I would like to create an RSS feed of error tickets generated by my
   app. I was planning to create a CRON job with scripts/tickets2db.py to
   load them into the database, and then generate an RSS feed from the
   database.

   But before I start I want to check if there is a better way, or
   existing code for this.

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



[web2py:29303] Re: fyi

2009-08-25 Thread mdipierro

I hope we never get to find out.

On Aug 24, 6:45 pm, suiato homm...@gmail.com wrote:
 I posted on reddit for the first time :
 frequent updates that don't break code is an important point to be
 made. Linux kernel development is, of course, far larger in scale, but
 the same principle applies. Its statistics show
 - 5.45 patches per hour
 - 10,923 lines of code are added a day
 - 5,547 lines are removed every day on average.
  (http://www.linuxfoundation.org/publications/whowriteslinux.pdf)

 Anyhow, I think it is important to note how well web2py is doing, and
 furthermore to be able to imagine how much farther it can go with the
 current update sytem. Actually I don't really know  what's really
 required to manage a system with 5 patches an hour, 10,000 lines of
 addition and 5,000 lines of removal per day.

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



[web2py:29304] Re: new welcome layout

2009-08-25 Thread mdipierro

That color scheme is based on the color wheel by Itten. It is the same
used here
http://www.web2py.com/layouts.
In fact I have rewritten the algorithm in Python.

The problem is that I lack the software to make button, banners, etc.

Massimo


On Aug 24, 7:00 pm, mr.freeze nat...@freezable.com wrote:
 It may just be me but those colors don't seem to go together.  Have
 you tried using a color scheme tool like this?:http://colorschemedesigner.com/

 On Aug 24, 9:40 am, mdipierro mdipie...@cs.depaul.edu wrote:

  I posted a new layout for the scaffolding app. This is not definitive
  and I could use some feedback. If there is a web designer here who can
  help us make it better it would be great. I'd rather not change
  layout.html but base.css can be improved.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29305] Re: The TAO of Key-Value DBs NoSQL (V. Good List of NoSQL DBs)

2009-08-25 Thread mdipierro

Not that I know but we can help you want to do it.

On Aug 24, 11:39 pm, suiato homm...@gmail.com wrote:
 recently installed Tokyo Cabinet/Tyrant on my test server.
 interested in using it from within web2py thru memcached or RESTful
 http interface...
 any activities along this line of development?

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



[web2py:29306] Re: Googlemap in web2py

2009-08-25 Thread mdipierro

We have this:

http://bazaar.launchpad.net/~mdipierro/web2conf/devel/annotate/head%3A/views/default/maps.html

and we have

from gluon.tools import geocode
(lo,la)=geocode('243 S Wabash Ave, Chicago, IL)

On Aug 24, 11:58 pm, rondevu ranjeev...@gmail.com wrote:
 Is there any examples of implementation of GoogleMap in web2py. I see
 there is one for Django. GeoDjango its called. Anything similar?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29308] Re: ticket events

2009-08-25 Thread mdipierro


On Aug 25, 1:45 am, Richard richar...@gmail.com wrote:
 A few questions/comments from my experience implementing this:

 tickets2db.py needs an update because of a new interface for
 RestrictedError():
 40) error.load(filename) - error.load(request, request.app,
 filename)

will fix it, thanks.

 If I want to reuse the admin ticket view in another controller, is
 this the proper way?
 response.view = '../../admin/views/default/ticket.html'

yes or just copy the ticket.html

 The code line numbers in my tickets don't match the correct code line
 because there is an extra new line inserted between every code line.
 So a 3 line function is being rendered like this:
 1. def user():
 2.
 3.   response.view = 'form.html'

       return dict(form=auth())

 Richard

 On Aug 25, 3:52 pm, Richard richar...@gmail.com wrote:

  just one host.
  hmm, I guess an RSS feed won't be queried often so efficiency is not
  important and I can just read from disk like you suggest.

  Richard

  On Aug 24, 7:31 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   I do not know if you need to load them in db unless you have multiple
   hosts.

   On Aug 24, 12:09 am, Richard richar...@gmail.com wrote:

hello,

I would like to create an RSS feed of error tickets generated by my
app. I was planning to create a CRON job with scripts/tickets2db.py to
load them into the database, and then generate an RSS feed from the
database.

But before I start I want to check if there is a better way, or
existing code for this.

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



[web2py:29309] problem with Enthought Python

2009-08-25 Thread mdipierro

I have been trying to use web2py with Enthought Python. It seems that
cron break something. No error not the web server does not start. I do
not have much time to look into this so any help will be appreciated.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29310] Re: Every while and then file upload fails

2009-08-25 Thread mmstud

Got it captured. Actually upload process fails quite often with Safari
(4.0.3):

http://www.screencast.com/users/mmstud/folders/Jing/media/bc50ae72-c826-4184-af40-4dcad5c95517

On Aug 25, 9:44 am, mmstud mms...@gmail.com wrote:
 Didnt happen with Firefox yesterday. I try today with Safari again.

 On Aug 24, 8:53 pm, mdipierro mdipie...@cs.depaul.edu wrote:



  It should not be a problem.

  On Aug 24, 12:02 pm,mmstudmms...@gmail.com wrote:

   I've been using Safari. Can try some hours with Firefox. One thing Im
   doing, is to hit enter after giving new name to file and sometimes
   clicking the submit button. Could it submit wrong form with enter?

   -Marko

   On Aug 24, 7:59 pm, mdipierro mdipie...@cs.depaul.edu wrote:

I use a macbook and never had this problem. Do you get the probelm
with both the source and binary? Can you reproduce it on different
browsers? Which ones?

Massimo

On Aug 24, 11:48 am,mmstudmms...@gmail.com wrote:

 I have seen this happening every 3-5 file upload. Im using admin
 panel to upload static files. After 2-4 succesful upload this
 happens:

 Error traceback
 Traceback (most recent call last):
   File /Users/mmstud/Downloads/web2py-read-only/gluon/main.py, line
 320, in wsgibase
     int(request.env.content_length))
   File /Users/mmstud/Downloads/web2py-read-only/gluon/fileutils.py,
 line 267, in copystream
     data = src.read(size)
   File /Users/mmstud/Downloads/web2py-read-only/gluon/wsgiserver.py,
 line 192, in read
     data = self.rfile.read(size)
   File /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
 python2.5/socket.py, line 309, in read
     data = self._sock.recv(recv_size)
 timeout: timed out

 Is it a serious problem? When I re upload same file, it usually works.
 Im doing development on my macbook.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29311] Re: appadmin error

2009-08-25 Thread mdipierro

There are two issues here:

1) cgi.FieldStorage behaves differently between 2.5 and 2.6. There is
NO WAY around this problem. For example if the request.get_vars
contain {'x', 'y'} and the request.post_vars contain {'x': ['y','z']}
does it mean that x=y is in the body of the POST or that python is
incorrectly picking it from the GET vars? No way of knowing without
checking the Python version and I do not know for sure which version
have this bug and which don't. The fact is, one should not mix get and
post vars!

2) appadmin works for me. I cannot reproduce ctalley's problem. My
guess is that appadmin was modified to cope with this issue (i vaguely
remember so) and he is using an older appadmin. I suggest he copies
appadmin.py and appadmin.html from a recent web2py welcome app and see
if the problem persists.

Massimo


On Aug 24, 2:44 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Aug 24, 2009, at 12:26 PM, ctalley wrote:



  I'm running 2.6.2.  My decision to go with python 2.6 was based on the
  following from the web2py site...

 http://www.web2py.com/examples/default/index

  Runs on Windows, Mac, Unix/Linux, Google App Engine, Amazon EC2, and
  almost any web hosting via Python 2.4/2.5/2.6, or Java with Jython.

  Perhaps that should be changed.

  I guess I now have to downgrade to 2.5.4.

 There must be some better solution, Massimo. Not being 2.6-compatible  
 just doesn't cut it.



  On Aug 24, 3:12 pm, mdipierro mdipie...@cs.depaul.edu wrote:
  This is an example of an incompatibility between the CGI module in  
  2.5
  and 2.6. That is why we only support 2.5 officially.

  It was discussed previously on this list. Which version of 2.6? 2.6.1
  or 2.6.2?

  Massimo

  On Aug 24, 2:04 pm, ctalley ctal...@caci.com wrote:

  using web2py version 1.66.0 source
  and python 2.6

  from this page...http://127.0.0.1:8000/mydb/appadmin/index

  click a table link such as db.mytable

  lists query = db.mytable.id0, and rows in table -- all is well :-)

  now, still on the same page, click Submit; should just reload the  
  page
  with the same information (right?)

  but instead, this happens...

  Traceback (most recent call last):

  File C:\...\gluon\restricted.py, line 178, in restricted exec  
  ccode
  in environment

  File C:/.../applications/mydb/controllers/appadmin.py, line 281,  
  in
  module

  File C:\...\gluon\globals.py, line 101, in lambda self._caller =
  lambda f: f()

  File C:/.../applications/mydb/controllers/appadmin.py, line 168,  
  in
  select match = regex.match(request.vars.query)

  TypeError: expected string or buffer

  What I was really trying to do was delete some rows; that also  
  doesn't
  work - same error.- Hide quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29312] Re: IS_NULL_OR + IS_IMAGE

2009-08-25 Thread mdipierro

Fixed in trunk! Thanks for reporting the problem.

On Aug 24, 8:16 pm, Jose jjac...@gmail.com wrote:
 Version: 1.66.2
 Rev: 1187 (svn)

 Model:

 db.define_table('unatabla',
     Field('nombre'),
     Field('foto', 'upload')
 )
 db.unatabla.foto.requires = IS_NULL_OR(IS_IMAGE(maxsize=(600, 400)))

 Hi,

 The combination IS_NULL_OR (IS_IMAGE (maxsize=(600, 400))) does not
 work.
 If the field upload is empty a mistake is produced:

 Traceback (most recent call last):
   File /usr/home/jose/web2py/gluon/restricted.py, line 178, in
 restricted
     exec ccode in environment
   File /usr/home/jose/web2py/applications/prueba/controllers/
 appadmin.py, line 255, in module
   File /usr/home/jose/web2py/gluon/globals.py, line 101, in lambda
     self._caller = lambda f: f()
   File /usr/home/jose/web2py/applications/prueba/controllers/
 appadmin.py, line 104, in insert
     if form.accepts(request.vars, session):
   File /usr/home/jose/web2py/gluon/sqlhtml.py, line 817, in accepts
     (source_file, original_filename) = (f.file, f.filename)
 AttributeError: 'NoneType' object has no attribute 'file'

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



[web2py:29314] Re: Every while and then file upload fails

2009-08-25 Thread mdipierro

I have seen this before. I do not know what the problem is. Somebody
needs to do a tcpdump of the conversation and figure out why the
timeout occurs.

Massimo

On Aug 25, 3:09 am, mmstud mms...@gmail.com wrote:
 Got it captured. Actually upload process fails quite often with Safari
 (4.0.3):

 http://www.screencast.com/users/mmstud/folders/Jing/media/bc50ae72-c8...

 On Aug 25, 9:44 am, mmstud mms...@gmail.com wrote:

  Didnt happen with Firefox yesterday. I try today with Safari again.

  On Aug 24, 8:53 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   It should not be a problem.

   On Aug 24, 12:02 pm,mmstudmms...@gmail.com wrote:

I've been using Safari. Can try some hours with Firefox. One thing Im
doing, is to hit enter after giving new name to file and sometimes
clicking the submit button. Could it submit wrong form with enter?

-Marko

On Aug 24, 7:59 pm, mdipierro mdipie...@cs.depaul.edu wrote:

 I use a macbook and never had this problem. Do you get the probelm
 with both the source and binary? Can you reproduce it on different
 browsers? Which ones?

 Massimo

 On Aug 24, 11:48 am,mmstudmms...@gmail.com wrote:

  I have seen this happening every 3-5 file upload. Im using admin
  panel to upload static files. After 2-4 succesful upload this
  happens:

  Error traceback
  Traceback (most recent call last):
    File /Users/mmstud/Downloads/web2py-read-only/gluon/main.py, 
  line
  320, in wsgibase
      int(request.env.content_length))
    File 
  /Users/mmstud/Downloads/web2py-read-only/gluon/fileutils.py,
  line 267, in copystream
      data = src.read(size)
    File 
  /Users/mmstud/Downloads/web2py-read-only/gluon/wsgiserver.py,
  line 192, in read
      data = self.rfile.read(size)
    File 
  /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
  python2.5/socket.py, line 309, in read
      data = self._sock.recv(recv_size)
  timeout: timed out

  Is it a serious problem? When I re upload same file, it usually 
  works.
  Im doing development on my macbook.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29315] ldap authentification AD

2009-08-25 Thread max

I tried to add the following code in the db.py

from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods = [ldap_auth(mode='ad',
server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]

but it gives the failure.
gluon.contrib.login_methods.ldap_auth import ldap_auth  File /srv/www/
web2py/gluon/contrib/login_methods/ldap_auth.py, line 1, in
moduleimport ldapImportError: No module named ldap

But if i insert the code in the controller the import shows no
failures.
does anybody have any idea?

On 7 Aug., 15:32, max dulip.withan...@gmail.com wrote:
 thanks, fran

 On 7 Aug., 14:10, Fran francisb...@googlemail.com wrote:

  On Aug 7, 8:19 am, max dulip.withan...@gmail.com wrote:

   How can i configure the Active directory authentification using CAS?
   should i have to uncomment and edit the
   
   auth.settings.login_methods.append(ldap_auth
   (mode='ad',server='my.domain.controller',base_dn=ou=Users,dc=domain,dc=com,bind_dn=cn=Administrator,ou=Users,d
   c=domain,dc=com,bind_pass=password))
   
   or is there anyway to configure it application based?

  You can use AD without CAS...just for a single application...this is
  the usual usage.
  I don't have experience of using it with CAS...I just downloaded the
  CAS appliance  it doesn't seem to use Auth, so would need converting
  to use Auth before it could be made to work with ldap_auth.

  The best docs for LDAP authentication are currently within the source
  (the new book also has some, but the source is fine):
  gluon/contrib/login_methods/ldap_auth.py

  So to use AD, you need to have 2 lines in your model (on top of the
  usual Auth lines):
  from gluon.contrib.login_methods.ldap_auth import ldap_auth
  auth.settings.login_methods.append(ldap_auth(mode='ad',
  server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com'))

  This mode means that password is cached in DB  so you can access
  using last password known to the app in case AD is down.
  To not have this method, make the 2nd line instead:
  auth.settings.login_methods = [ldap_auth(mode='ad',
  server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]

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



[web2py:29316] Re: ldap authentification AD

2009-08-25 Thread mdipierro

Do you have python ldap API installed? It does not come with web2py.

On Aug 25, 4:41 am, max dulip.withan...@gmail.com wrote:
 I tried to add the following code in the db.py

 from gluon.contrib.login_methods.ldap_auth import ldap_auth
 auth.settings.login_methods = [ldap_auth(mode='ad',
 server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]

 but it gives the failure.
 gluon.contrib.login_methods.ldap_auth import ldap_auth  File /srv/www/
 web2py/gluon/contrib/login_methods/ldap_auth.py, line 1, in
 module    import ldapImportError: No module named ldap

 But if i insert the code in the controller the import shows no
 failures.
 does anybody have any idea?

 On 7 Aug., 15:32, max dulip.withan...@gmail.com wrote:

  thanks, fran

  On 7 Aug., 14:10, Fran francisb...@googlemail.com wrote:

   On Aug 7, 8:19 am, max dulip.withan...@gmail.com wrote:

How can i configure the Active directory authentification using CAS?
should i have to uncomment and edit the

auth.settings.login_methods.append(ldap_auth
(mode='ad',server='my.domain.controller',base_dn=ou=Users,dc=domain,dc=com,bind_dn=cn=Administrator,ou=Users,d
c=domain,dc=com,bind_pass=password))

or is there anyway to configure it application based?

   You can use AD without CAS...just for a single application...this is
   the usual usage.
   I don't have experience of using it with CAS...I just downloaded the
   CAS appliance  it doesn't seem to use Auth, so would need converting
   to use Auth before it could be made to work with ldap_auth.

   The best docs for LDAP authentication are currently within the source
   (the new book also has some, but the source is fine):
   gluon/contrib/login_methods/ldap_auth.py

   So to use AD, you need to have 2 lines in your model (on top of the
   usual Auth lines):
   from gluon.contrib.login_methods.ldap_auth import ldap_auth
   auth.settings.login_methods.append(ldap_auth(mode='ad',
   server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com'))

   This mode means that password is cached in DB  so you can access
   using last password known to the app in case AD is down.
   To not have this method, make the 2nd line instead:
   auth.settings.login_methods = [ldap_auth(mode='ad',
   server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]

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



[web2py:29317] Re: OpenShare :: OpenSource Ad Service built in web2py!

2009-08-25 Thread Jon Romero

yeap, I am uploading it now!

On Aug 24, 11:29 pm, Joe Barnhart joe.barnh...@gmail.com wrote:
 That's a good idea and a nicely done site.  In light of Massimo's plea for
 more visibility, do you think you could put a created using web2py message
 somewhere on the page?

 On Mon, Aug 24, 2009 at 8:53 AM, Jon Romero darks...@gmail.com wrote:

  Hello, I've built OpenShare (http://openshare.emotionull.com) using
  web2py and is running in Google App Engine and I would like to know
  what you think about it.

  I am planning to release the source (github or bitbucket) as soon as I
  fix some issues.

  If you want to help with the design/coding/whatever, please send an
  email :)
  And of course, please add your opensource project :D

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



[web2py:29318] Re: OpenShare :: OpenSource Ad Service built in web2py!

2009-08-25 Thread Jon Romero

it's ready :)
I would be very glad if web2py.com was using the service and of course
other opensource developers.

On Aug 25, 12:53 pm, Jon Romero darks...@gmail.com wrote:
 yeap, I am uploading it now!

 On Aug 24, 11:29 pm, Joe Barnhart joe.barnh...@gmail.com wrote:

  That's a good idea and a nicely done site.  In light of Massimo's plea for
  more visibility, do you think you could put a created using web2py message
  somewhere on the page?

  On Mon, Aug 24, 2009 at 8:53 AM, Jon Romero darks...@gmail.com wrote:

   Hello, I've built OpenShare (http://openshare.emotionull.com) using
   web2py and is running in Google App Engine and I would like to know
   what you think about it.

   I am planning to release the source (github or bitbucket) as soon as I
   fix some issues.

   If you want to help with the design/coding/whatever, please send an
   email :)
   And of course, please add your opensource project :D

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



[web2py:29319] Re: OpenShare :: OpenSource Ad Service built in web2py!

2009-08-25 Thread ProfessionalIT

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



[web2py:29320] Solved: ldap authentification AD

2009-08-25 Thread max


thanks. now i installed it.
On 25 Aug., 11:52, mdipierro mdipie...@cs.depaul.edu wrote:
 Do you have python ldap API installed? It does not come with web2py.

 On Aug 25, 4:41 am, max dulip.withan...@gmail.com wrote:

  I tried to add the following code in the db.py

  from gluon.contrib.login_methods.ldap_auth import ldap_auth
  auth.settings.login_methods = [ldap_auth(mode='ad',
  server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]

  but it gives the failure.
  gluon.contrib.login_methods.ldap_auth import ldap_auth  File /srv/www/
  web2py/gluon/contrib/login_methods/ldap_auth.py, line 1, in
  moduleimport ldapImportError: No module named ldap

  But if i insert the code in the controller the import shows no
  failures.
  does anybody have any idea?

  On 7 Aug., 15:32, max dulip.withan...@gmail.com wrote:

   thanks, fran

   On 7 Aug., 14:10, Fran francisb...@googlemail.com wrote:

On Aug 7, 8:19 am, max dulip.withan...@gmail.com wrote:

 How can i configure the Active directory authentification using CAS?
 should i have to uncomment and edit the
 
 auth.settings.login_methods.append(ldap_auth
 (mode='ad',server='my.domain.controller',base_dn=ou=Users,dc=domain,dc=com,bind_dn=cn=Administrator,ou=Users,d
 c=domain,dc=com,bind_pass=password))
 
 or is there anyway to configure it application based?

You can use AD without CAS...just for a single application...this is
the usual usage.
I don't have experience of using it with CAS...I just downloaded the
CAS appliance  it doesn't seem to use Auth, so would need converting
to use Auth before it could be made to work with ldap_auth.

The best docs for LDAP authentication are currently within the source
(the new book also has some, but the source is fine):
gluon/contrib/login_methods/ldap_auth.py

So to use AD, you need to have 2 lines in your model (on top of the
usual Auth lines):
from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods.append(ldap_auth(mode='ad',
server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com'))

This mode means that password is cached in DB  so you can access
using last password known to the app in case AD is down.
To not have this method, make the 2nd line instead:
auth.settings.login_methods = [ldap_auth(mode='ad',
server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]

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



[web2py:29323] Re: Solved: ldap authentification AD

2009-08-25 Thread max

i installed python-ldap and now i can load it.  Then i tried it with
cas by  changing the cas_auth by editting it like this.
But it still it works only for the local database.
What i need is that  the web2py user (ad user name )identifies against
the active directory  password after first registration (with or
without password).


auth=Auth(globals(),db)  # authentication/
authorization
auth.settings.login_methods=[ldap_auth
(mode='ad',server='ad.mydomain.com',
base_dn='ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com')]

auth.settings.table_user =db.define_table(cas_user,
  db.Field(name,length=128,default=),
  db.Field(email, length=128,default=),
  db.Field(password,'password',readable=False,
label=Password),
  db.Field('verification',default=''),
  db.Field('last_attempt_time','integer',default=0),
  db.Field('failed_attempts','integer',default=0))#, readable=False,
default=)

t = auth.settings.table_user
t.name.requires = IS_NOT_EMPTY()
t.email.requires = IS_NOT_EMPTY()
t.password.requires = CRYPT()
t.email.requires = [IS_EMAIL(), IS_NOT_IN_DB(db, db.cas_user.email)]
auth.define_tables()

crud=Crud(globals(),db)
crud.settings.auth=auth  # enforces authorization
on crud


db.define_table('ticket',
SQLField('ctime','integer',default=now),
SQLField('url'),
SQLField('code'),
SQLField('cas_user',db.cas_user))

db.cas_user.name.requires=IS_NOT_EMPTY()
db.cas_user.email.requires=[IS_EMAIL(),IS_NOT_IN_DB
(db,'cas_user.email')]








On 25 Aug., 13:22, max dulip.withan...@gmail.com wrote:
 thanks. now i installed it.
 On 25 Aug., 11:52, mdipierro mdipie...@cs.depaul.edu wrote:

  Do you have python ldap API installed? It does not come with web2py.

  On Aug 25, 4:41 am, max dulip.withan...@gmail.com wrote:

   I tried to add the following code in the db.py

   from gluon.contrib.login_methods.ldap_auth import ldap_auth
   auth.settings.login_methods = [ldap_auth(mode='ad',
   server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]

   but it gives the failure.
   gluon.contrib.login_methods.ldap_auth import ldap_auth  File /srv/www/
   web2py/gluon/contrib/login_methods/ldap_auth.py, line 1, in
   moduleimport ldapImportError: No module named ldap

   But if i insert the code in the controller the import shows no
   failures.
   does anybody have any idea?

   On 7 Aug., 15:32, max dulip.withan...@gmail.com wrote:

thanks, fran

On 7 Aug., 14:10, Fran francisb...@googlemail.com wrote:

 On Aug 7, 8:19 am, max dulip.withan...@gmail.com wrote:

  How can i configure the Active directory authentification using CAS?
  should i have to uncomment and edit the
  
  auth.settings.login_methods.append(ldap_auth
  (mode='ad',server='my.domain.controller',base_dn=ou=Users,dc=domain,dc=com,bind_dn=cn=Administrator,ou=Users,d
  c=domain,dc=com,bind_pass=password))
  
  or is there anyway to configure it application based?

 You can use AD without CAS...just for a single application...this is
 the usual usage.
 I don't have experience of using it with CAS...I just downloaded the
 CAS appliance  it doesn't seem to use Auth, so would need converting
 to use Auth before it could be made to work with ldap_auth.

 The best docs for LDAP authentication are currently within the source
 (the new book also has some, but the source is fine):
 gluon/contrib/login_methods/ldap_auth.py

 So to use AD, you need to have 2 lines in your model (on top of the
 usual Auth lines):
 from gluon.contrib.login_methods.ldap_auth import ldap_auth
 auth.settings.login_methods.append(ldap_auth(mode='ad',
 server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com'))

 This mode means that password is cached in DB  so you can access
 using last password known to the app in case AD is down.
 To not have this method, make the 2nd line instead:
 auth.settings.login_methods = [ldap_auth(mode='ad',
 server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]

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



[web2py:29324] Re: run python code from onclick event

2009-08-25 Thread mdipierro

1) you changed the check() action from my example. I do not understand
what it does anymore. I thought it would remove or add a single part
but now it has a loop. why?
2) did you try calling the check/[prod_id]/[part_id] action without
ajax? That will give you a ticket that helps debugging.
3) You my div with a input checkbox. Input does not have a /input.
4) The code

{{if db((db.prodj_refs.prodj_id==request.args
(0))(db.prodj_refs.part_id==part.id)).count():}}selected{{else:}}not
selected{{pass}}

does not belong there anymore (becase input has no content). I guess
you want

input type=checkbox id=selector{{=part.id}}
  onchange={{=URL(r=request,f='check',args=
[prodj.id,part.id])}}
{{if db((db.prodj_refs.prodj_id==request.args
(0))(db.prodj_refs.part_id==part.id)).count():}}
checked=checked{{else:}}not
selected{{pass}} /

7) When you change 6) you wil also need to change the jquery commands
returned by the check() action.




On Aug 25, 7:17 am, murray3 ch...@murraypost.net wrote:
 Guy's thanks for your help yesterday.
 Massimo, I am developing for app engine so the  selects do not work
 and I had to modify '=' to '==' in a couple of places to get the view
 to load without GAE errors.
 It is still not quite working, I nested 'if's' for GAE selects perhaps
 you will see what needs amending?
 thanks chrism

 in contoller I have:

 def check():
     part_id=request.args(1)
     prodj_parts_list=db(db.prodj_refs.prodj_id==request.args(0)).select
 ()
     for p in prodj_parts_list:
         if not db(db.prodj_parts.id==p.part_id).delete():
           return 'jQuery('#selector%i' % part_id).html('not selected')
     else:
         db.prodj_refs.insert(prodj_id=request.args(0),part_id=part_id)
     return 'jQuery('#selector%i' % part_id).html('selected')

 and in view:
 table width=100% cellpadding=1 cellspacing=0 border=0
 class=display id=example
                         thead
                         tr
                         thPart 
 Name/ththContent/ththNumber/ththCreated On/
 th
                         /tr
                         /thead
                         tfoot
                         tr
                         thPart 
 Name/ththContent/ththNumber/ththCreated On/
 th
                         /tr
                         /tfoot
                         tbody
                         {{for part in parts:}}
                         tr
                         td{{=part.part_name}}/td
                         td{{=part.part_content}}/td
                         td{{=part.part_number}}/td
                         td{{=part.timestamp.year}}/td
                         tdinput type=checkbox id=selector{{=part.id}}
                           onclick={{=URL(r=request,f='check',args=
 [prodj.id,part.id])}}
                         {{if db((db.prodj_refs.prodj_id==request.args
 (0))(db.prodj_refs.part_id==part.id)).count():}}selected{{else:}}not
 selected{{pass}}
                         /input /td
                         /tr
                         {{pass}}
                         /tbody
                         /table
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29325] ldap authentification AD cas

2009-08-25 Thread max

i installed python-ldap and now i can load it.  Then i tried it with
cas by  changing the cas_auth by editting it like this.
But it still it works only for the local database.
What i need is that  the web2py user (ad user name )identifies against
the active directory  password after first registration (with or
without password).

auth=Auth(globals(),db)  # authentication/
authorization
auth.settings.login_methods=[ldap_auth
(mode='ad',server='ad.mydomain.com',
base_dn='ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com')]

auth.settings.table_user =db.define_table(cas_user,
  db.Field(name,length=128,default=),
  db.Field(email, length=128,default=),
  db.Field(password,'password',readable=False,
label=Password),
  db.Field('verification',default=''),
  db.Field('last_attempt_time','integer',default=0),
  db.Field('failed_attempts','integer',default=0))#, readable=False,
default=)

t = auth.settings.table_user
t.name.requires = IS_NOT_EMPTY()
t.email.requires = IS_NOT_EMPTY()
t.password.requires = CRYPT()
t.email.requires = [IS_EMAIL(), IS_NOT_IN_DB(db, db.cas_user.email)]
auth.define_tables()

crud=Crud(globals(),db)
crud.settings.auth=auth  # enforces authorization
on crud

db.define_table('ticket',
SQLField('ctime','integer',default=now),
SQLField('url'),
SQLField('code'),
SQLField('cas_user',db.cas_user))

db.cas_user.name.requires=IS_NOT_EMPTY()
db.cas_user.email.requires=[IS_EMAIL(),IS_NOT_IN_DB
(db,'cas_user.email')]

On 25 Aug., 14:20, max dulip.withan...@gmail.com wrote:
 i installed python-ldap and now i can load it.  Then i tried it with
 cas by  changing the cas_auth by editting it like this.
 But it still it works only for the local database.
 What i need is that  the web2py user (ad user name )identifies against
 the active directory  password after first registration (with or
 without password).

 auth=Auth(globals(),db)  # authentication/
 authorization
 auth.settings.login_methods=[ldap_auth
 (mode='ad',server='ad.mydomain.com',
 base_dn='ou=users,ou=kjc,ou=institute,dc=ad,dc=mydomain,dc=com')]

 auth.settings.table_user =db.define_table(cas_user,
   db.Field(name,length=128,default=),
   db.Field(email, length=128,default=),
   db.Field(password,'password',readable=False,
 label=Password),
   db.Field('verification',default=''),
   db.Field('last_attempt_time','integer',default=0),
   db.Field('failed_attempts','integer',default=0))#, readable=False,
 default=)

 t = auth.settings.table_user
 t.name.requires = IS_NOT_EMPTY()
 t.email.requires = IS_NOT_EMPTY()
 t.password.requires = CRYPT()
 t.email.requires = [IS_EMAIL(), IS_NOT_IN_DB(db, db.cas_user.email)]
 auth.define_tables()

 crud=Crud(globals(),db)
 crud.settings.auth=auth  # enforces authorization
 on crud

 db.define_table('ticket',
 SQLField('ctime','integer',default=now),
 SQLField('url'),
 SQLField('code'),
 SQLField('cas_user',db.cas_user))

 db.cas_user.name.requires=IS_NOT_EMPTY()
 db.cas_user.email.requires=[IS_EMAIL(),IS_NOT_IN_DB
 (db,'cas_user.email')]

 On 25 Aug., 13:22, max dulip.withan...@gmail.com wrote:

  thanks. now i installed it.
  On 25 Aug., 11:52, mdipierro mdipie...@cs.depaul.edu wrote:

   Do you have python ldap API installed? It does not come with web2py.

   On Aug 25, 4:41 am, max dulip.withan...@gmail.com wrote:

I tried to add the following code in the db.py

from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods = [ldap_auth(mode='ad',
server='my.domain.controller', base_dn='ou=Users,dc=domain,dc=com')]

but it gives the failure.
gluon.contrib.login_methods.ldap_auth import ldap_auth  File /srv/www/
web2py/gluon/contrib/login_methods/ldap_auth.py, line 1, in
moduleimport ldapImportError: No module named ldap

But if i insert the code in the controller the import shows no
failures.
does anybody have any idea?

On 7 Aug., 15:32, max dulip.withan...@gmail.com wrote:

 thanks, fran

 On 7 Aug., 14:10, Fran francisb...@googlemail.com wrote:

  On Aug 7, 8:19 am, max dulip.withan...@gmail.com wrote:

   How can i configure the Active directory authentification using 
   CAS?
   should i have to uncomment and edit the
   
   auth.settings.login_methods.append(ldap_auth
   (mode='ad',server='my.domain.controller',base_dn=ou=Users,dc=domain,dc=com,bind_dn=cn=Administrator,ou=Users,d
   c=domain,dc=com,bind_pass=password))
   
   or is there anyway to configure it application based?

  You can use AD without CAS...just for a single application...this is
  the usual usage.
  I don't have experience of using it with CAS...I just downloaded the
  CAS appliance  it doesn't seem to use Auth, so would need 
  converting
  to use Auth before it could 

[web2py:29321] Re: OpenShare :: OpenSource Ad Service built in web2py!

2009-08-25 Thread mdipierro

excellent work!

On Aug 25, 5:55 am, ProfessionalIT lsever...@gmail.com wrote:
 Congratulations !!! Jon.
 Very good !.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29322] Re: run python code from onclick event

2009-08-25 Thread murray3

Guy's thanks for your help yesterday.
Massimo, I am developing for app engine so the  selects do not work
and I had to modify '=' to '==' in a couple of places to get the view
to load without GAE errors.
It is still not quite working, I nested 'if's' for GAE selects perhaps
you will see what needs amending?
thanks chrism

in contoller I have:

def check():
part_id=request.args(1)
prodj_parts_list=db(db.prodj_refs.prodj_id==request.args(0)).select
()
for p in prodj_parts_list:
if not db(db.prodj_parts.id==p.part_id).delete():
  return 'jQuery('#selector%i' % part_id).html('not selected')
else:
db.prodj_refs.insert(prodj_id=request.args(0),part_id=part_id)
return 'jQuery('#selector%i' % part_id).html('selected')



and in view:
table width=100% cellpadding=1 cellspacing=0 border=0
class=display id=example
thead
tr
thPart 
Name/ththContent/ththNumber/ththCreated On/
th
/tr
/thead
tfoot
tr
thPart 
Name/ththContent/ththNumber/ththCreated On/
th
/tr
/tfoot
tbody
{{for part in parts:}}
tr
td{{=part.part_name}}/td
td{{=part.part_content}}/td
td{{=part.part_number}}/td
td{{=part.timestamp.year}}/td
tdinput type=checkbox id=selector{{=part.id}}
  onclick={{=URL(r=request,f='check',args=
[prodj.id,part.id])}}
{{if db((db.prodj_refs.prodj_id==request.args
(0))(db.prodj_refs.part_id==part.id)).count():}}selected{{else:}}not
selected{{pass}}
/input /td
/tr
{{pass}}
/tbody
/table
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29327] Re: SSH and access.py

2009-08-25 Thread DenesL


On Aug 24, 11:45 pm, Álvaro Justen [Turicas] alvarojus...@gmail.com
wrote:
 Paste the SSH command you created that tunnel - I think the error is in that.

In Putty it would be something like
L8000   we2py-ip:8000

if you are thinking
L8000   127.0.0.1:8000

that does not work, in Firefox you would get:
The connection to the server was reset while the page was loading.

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



[web2py:29326] Re: findby name and link to event records

2009-08-25 Thread jayvandal

I downloade ipython and it installed it in python26\lib\site packages
\ipython as per the installer..(I am running Windows Vista)
I ran ipython and typed  in
records=db(db.person.last_name==request.vars.last_name)\
   .select(orderby=db.person.last_name)
-
It didn't like db.
I dont see it relating to the database in sqlite in web2py
Thanks
Jim


On Aug 24, 10:14 pm, Yarko Tymciurak yark...@gmail.com wrote:
 On Mon, Aug 24, 2009 at 11:02 PM, jayvandaljayvan...@gmail.com wrote:

  I tried to get the person_id when I got a last name found, but I could
  not find a way to get the person_id with this code,

 ..

   HI,
   I tried this code
   =
   records=db(db.person.last_name==request.vars.last_name)\
             .select(orderby=db.person.last_name)
   ===
   i see that this will find by last name or partial last name.

 You should really get familiar with running commands in a shell, and
 be sure to install iPython (it will give you TAB completion)-

 then you could try this line, and inspect the results -

 python web2py.py -S myapp -M
 [1] records=db(db.person.last_name==request.vars.last_name)\
             .select(orderby=db.person.last_name)

 [2] len(records)
 [3] records[0]
 [4] records[0].[TAB]

 ([TAB] I meant just hit the TAB key) - Try it, let us konw what you see...

 Regards,
 - Yarko





   I tried to get the person_id and use it to find all the events for
   that person and then display the event records.

   Can I do this or should I  do this??
   Thanks
   Jim- Hide quoted text -

  - Show quoted text -- Hide quoted text -

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



[web2py:29329] Re: run python code from onclick event

2009-08-25 Thread murray3

Hi,
I was trying to get it to work without the syntax errors, I changed
back to your controller code and get the following error:
INFO 2009-08-25 13:31:35,296 dev_appserver.py] GET /fab3/default/
m230/8?keepThi
 500 -
INFO 2009-08-25 13:32:09,000 dev_appserver.py] GET /fab3/default/
g/action-close
00 -
ERROR2009-08-25 13:32:09,250 restricted.py] In FILE: Framework

Traceback (most recent call last):
  File c:\apps\web2py\gluon\main.py, line 381, in wsgibase
serve_controller(request, response, session)
  File c:\apps\web2py\gluon\main.py, line 157, in serve_controller
run_controller_in(request.controller, request.function,
environment)
  File c:\apps\web2py\gluon\compileapp.py, line 277, in
run_controller_in
code = getcfs(layer, filename, lambda : \
  File c:\apps\web2py\gluon\compileapp.py, line 104, in getcfs
data = filter()
  File c:\apps\web2py\gluon\compileapp.py, line 279, in lambda
'exec'))
  File c:\apps\web2py\applications\fab3/controllers/default.py:m230,
line 218
(db.prodj_refs.part_id==part_id)).delete()

^
SyntaxError: invalid syntax

chrism

On Aug 25, 1:25 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 1) you changed the check() action from my example. I do not understand
 what it does anymore. I thought it would remove or add a single part
 but now it has a loop. why?
 2) did you try calling the check/[prod_id]/[part_id] action without
 ajax? That will give you a ticket that helps debugging.
 3) You my div with a input checkbox. Input does not have a /input.
 4) The code

 {{if db((db.prodj_refs.prodj_id==request.args
 (0))(db.prodj_refs.part_id==part.id)).count():}}selected{{else:}}not
 selected{{pass}}

 does not belong there anymore (becase input has no content). I guess
 you want

 input type=checkbox id=selector{{=part.id}}
                           onchange={{=URL(r=request,f='check',args=
 [prodj.id,part.id])}}
                         {{if db((db.prodj_refs.prodj_id==request.args
 (0))(db.prodj_refs.part_id==part.id)).count():}}
 checked=checked{{else:}}not
 selected{{pass}} /

 7) When you change 6) you wil also need to change the jquery commands
 returned by the check() action.

 On Aug 25, 7:17 am, murray3 ch...@murraypost.net wrote:

  Guy's thanks for your help yesterday.
  Massimo, I am developing for app engine so the  selects do not work
  and I had to modify '=' to '==' in a couple of places to get the view
  to load without GAE errors.
  It is still not quite working, I nested 'if's' for GAE selects perhaps
  you will see what needs amending?
  thanks chrism

  in contoller I have:

  def check():
      part_id=request.args(1)
      prodj_parts_list=db(db.prodj_refs.prodj_id==request.args(0)).select
  ()
      for p in prodj_parts_list:
          if not db(db.prodj_parts.id==p.part_id).delete():
            return 'jQuery('#selector%i' % part_id).html('not selected')
      else:
          db.prodj_refs.insert(prodj_id=request.args(0),part_id=part_id)
      return 'jQuery('#selector%i' % part_id).html('selected')

  and in view:
  table width=100% cellpadding=1 cellspacing=0 border=0
  class=display id=example
                          thead
                          tr
                          thPart 
  Name/ththContent/ththNumber/ththCreated On/
  th
                          /tr
                          /thead
                          tfoot
                          tr
                          thPart 
  Name/ththContent/ththNumber/ththCreated On/
  th
                          /tr
                          /tfoot
                          tbody
                          {{for part in parts:}}
                          tr
                          td{{=part.part_name}}/td
                          td{{=part.part_content}}/td
                          td{{=part.part_number}}/td
                          td{{=part.timestamp.year}}/td
                          tdinput type=checkbox id=selector{{=part.id}}
                            onclick={{=URL(r=request,f='check',args=
  [prodj.id,part.id])}}
                          {{if db((db.prodj_refs.prodj_id==request.args
  (0))(db.prodj_refs.part_id==part.id)).count():}}selected{{else:}}not
  selected{{pass}}
                          /input /td
                          /tr
                          {{pass}}
                          /tbody
                          /table


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



[web2py:29328] Re: OpenShare :: OpenSource Ad Service built in web2py!

2009-08-25 Thread Benigno

Hello Jon,

Nice app, and great idea. Is there a way to restrict by the kind
of ads one would add to his website?. I mean, mantaining a profesional
website, I wouldnt mind linking to other profesional sites, but it
doesnt make sense to link to say a retail store or gaming site or
whatever.

I'd very much like to see the code if its available.

Cheers,
Benigno.

On Aug 25, 2:14 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 excellent work!

 On Aug 25, 5:55 am, ProfessionalIT lsever...@gmail.com wrote:

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



[web2py:29330] Re: findby name and link to event records

2009-08-25 Thread mr.freeze

As Yarko mentioned, you need to start web2py in shell mode by typing:
python web2py.py -S yourapp -M
This will create all of the variables you need in the shell such as
db.

I highly recommend going through the book from start to end.  It will
save you many hours of frustration and only costs $12.
http://www.lulu.com/content/4968879

Good luck!

On Aug 25, 8:09 am, jayvandal jayvan...@gmail.com wrote:
 I downloade ipython and it installed it in python26\lib\site packages
 \ipython as per the installer..(I am running Windows Vista)
 I ran ipython and typed  in
 records=db(db.person.last_name==request.vars.last_name)\
            .select(orderby=db.person.last_name)
 -
 It didn't like db.
 I dont see it relating to the database in sqlite in web2py
 Thanks
 Jim

 On Aug 24, 10:14 pm, Yarko Tymciurak yark...@gmail.com wrote:



  On Mon, Aug 24, 2009 at 11:02 PM, jayvandaljayvan...@gmail.com wrote:

   I tried to get the person_id when I got a last name found, but I could
   not find a way to get the person_id with this code,

  ..

HI,
I tried this code
=
records=db(db.person.last_name==request.vars.last_name)\
          .select(orderby=db.person.last_name)
===
i see that this will find by last name or partial last name.

  You should really get familiar with running commands in a shell, and
  be sure to install iPython (it will give you TAB completion)-

  then you could try this line, and inspect the results -

  python web2py.py -S myapp -M
  [1] records=db(db.person.last_name==request.vars.last_name)\
              .select(orderby=db.person.last_name)

  [2] len(records)
  [3] records[0]
  [4] records[0].[TAB]

  ([TAB] I meant just hit the TAB key) - Try it, let us konw what you see...

  Regards,
  - Yarko

I tried to get the person_id and use it to find all the events for
that person and then display the event records.

Can I do this or should I  do this??
Thanks
Jim- Hide quoted text -

   - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

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



[web2py:29331] Re: appadmin error

2009-08-25 Thread Jonathan Lundell

On Aug 25, 2009, at 1:45 AM, mdipierro wrote:


 There are two issues here:

 1) cgi.FieldStorage behaves differently between 2.5 and 2.6. There is
 NO WAY around this problem. For example if the request.get_vars
 contain {'x', 'y'} and the request.post_vars contain {'x': ['y','z']}
 does it mean that x=y is in the body of the POST or that python is
 incorrectly picking it from the GET vars? No way of knowing without
 checking the Python version and I do not know for sure which version
 have this bug and which don't. The fact is, one should not mix get and
 post vars!

 2) appadmin works for me. I cannot reproduce ctalley's problem. My
 guess is that appadmin was modified to cope with this issue (i vaguely
 remember so) and he is using an older appadmin. I suggest he copies
 appadmin.py and appadmin.html from a recent web2py welcome app and see
 if the problem persists.

Thanks for the clarification. I agree that avoiding mixing get/post  
vars is a reasonable workaround (who does that, anyway?), and if  
appadmin is fixed, good.


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



[web2py:29332] Re: run python code from onclick event

2009-08-25 Thread mdipierro

def check():
part_id=request.args(1)
if not db((db.prodj_refs.prodj_id==request.args(0)) \
  (db.prodj_refs.part_id==part_id)).delete()
  return 'jQuery('#selector%i' % part_id).html('not
selected')
else:
  db.prodj_refs.insert(prodj_id=request.args
(0),part_id=part_id)
  return 'jQuery('#selector%i' % part_id).html('selected')

On Aug 25, 8:43 am, murray3 ch...@murraypost.net wrote:
 Hi,
 I was trying to get it to work without the syntax errors, I changed
 back to your controller code and get the following error:
 INFO     2009-08-25 13:31:35,296 dev_appserver.py] GET /fab3/default/
 m230/8?keepThi
  500 -
 INFO     2009-08-25 13:32:09,000 dev_appserver.py] GET /fab3/default/
 g/action-close
 00 -
 ERROR    2009-08-25 13:32:09,250 restricted.py] In FILE: Framework

 Traceback (most recent call last):
   File c:\apps\web2py\gluon\main.py, line 381, in wsgibase
     serve_controller(request, response, session)
   File c:\apps\web2py\gluon\main.py, line 157, in serve_controller
     run_controller_in(request.controller, request.function,
 environment)
   File c:\apps\web2py\gluon\compileapp.py, line 277, in
 run_controller_in
     code = getcfs(layer, filename, lambda : \
   File c:\apps\web2py\gluon\compileapp.py, line 104, in getcfs
     data = filter()
   File c:\apps\web2py\gluon\compileapp.py, line 279, in lambda
     'exec'))
   File c:\apps\web2py\applications\fab3/controllers/default.py:m230,
 line 218
     (db.prodj_refs.part_id==part_id)).delete()

 ^
 SyntaxError: invalid syntax

 chrism

 On Aug 25, 1:25 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  1) you changed the check() action from my example. I do not understand
  what it does anymore. I thought it would remove or add a single part
  but now it has a loop. why?
  2) did you try calling the check/[prod_id]/[part_id] action without
  ajax? That will give you a ticket that helps debugging.
  3) You my div with a input checkbox. Input does not have a /input.
  4) The code

  {{if db((db.prodj_refs.prodj_id==request.args
  (0))(db.prodj_refs.part_id==part.id)).count():}}selected{{else:}}not
  selected{{pass}}

  does not belong there anymore (becase input has no content). I guess
  you want

  input type=checkbox id=selector{{=part.id}}
                            onchange={{=URL(r=request,f='check',args=
  [prodj.id,part.id])}}
                          {{if db((db.prodj_refs.prodj_id==request.args
  (0))(db.prodj_refs.part_id==part.id)).count():}}
  checked=checked{{else:}}not
  selected{{pass}} /

  7) When you change 6) you wil also need to change the jquery commands
  returned by the check() action.

  On Aug 25, 7:17 am, murray3 ch...@murraypost.net wrote:

   Guy's thanks for your help yesterday.
   Massimo, I am developing for app engine so the  selects do not work
   and I had to modify '=' to '==' in a couple of places to get the view
   to load without GAE errors.
   It is still not quite working, I nested 'if's' for GAE selects perhaps
   you will see what needs amending?
   thanks chrism

   in contoller I have:

   def check():
       part_id=request.args(1)
       prodj_parts_list=db(db.prodj_refs.prodj_id==request.args(0)).select
   ()
       for p in prodj_parts_list:
           if not db(db.prodj_parts.id==p.part_id).delete():
             return 'jQuery('#selector%i' % part_id).html('not selected')
       else:
           db.prodj_refs.insert(prodj_id=request.args(0),part_id=part_id)
       return 'jQuery('#selector%i' % part_id).html('selected')

   and in view:
   table width=100% cellpadding=1 cellspacing=0 border=0
   class=display id=example
                           thead
                           tr
                           thPart 
   Name/ththContent/ththNumber/ththCreated On/
   th
                           /tr
                           /thead
                           tfoot
                           tr
                           thPart 
   Name/ththContent/ththNumber/ththCreated On/
   th
                           /tr
                           /tfoot
                           tbody
                           {{for part in parts:}}
                           tr
                           td{{=part.part_name}}/td
                           td{{=part.part_content}}/td
                           td{{=part.part_number}}/td
                           td{{=part.timestamp.year}}/td
                           tdinput type=checkbox 
   id=selector{{=part.id}}
                             onclick={{=URL(r=request,f='check',args=
   [prodj.id,part.id])}}
                           {{if db((db.prodj_refs.prodj_id==request.args
   (0))(db.prodj_refs.part_id==part.id)).count():}}selected{{else:}}not
   selected{{pass}}
                           /input /td
                           /tr
                           {{pass}}
                           /tbody
                           /table
--~--~-~--~~~---~--~~
You received 

[web2py:29333] Re: When does form.accepts fail?

2009-08-25 Thread Joe Barnhart
OK, here's the deal.  There is something timing-related about having a large
amount of markup to process and whether the controller is called once or
twice.  On small amounts of text, the controller is called once for each
press of the show or save buttons.  On large text blocks, where there is
about 1/2 sec. or longer taken to process the text in the controller, it is
called twice for each button press.

To eliminate the dependency, I thought I would use Ajax to call the text
processing asynchronously.  That's not going too well yet -- the text
conversion method gets called but the data never appears in the page at the
div id=target tag.  Not sure why yet.

-- Joe

On Mon, Aug 24, 2009 at 2:48 PM, Joe Barnhart joe.barnh...@gmail.comwrote:

 H...  You are right sir.  Every time I press the show or save
 button, the controller gets called twice.  This requires further study!  I
 get to learn more about when things get called in web2py, which is something
 I wanted to have a better feel for anyway.

 -- Joe



 On Mon, Aug 24, 2009 at 11:36 AM, mdipierro mdipie...@cs.depaul.eduwrote:


 removing session from accepts(...,session,...) will remove the symptom
 but not the problem. The problem is that something is making an extra
 call to the action that generates the form thus resetting the
 _formkey.



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



[web2py:29334] Re: upgrading to 1.66.1 chokes on sqlite database

2009-08-25 Thread Carl

I've just downloaded 1.66.2 and am getting further.

I'm getting this ticket...

Traceback (most recent call last):
  File G:\My Documents\Carl\projects\TestOrbit\web2py\gluon\main.py,
line 412, in wsgibase
session._try_store_on_disk(request, response)
  File G:\My Documents\Carl\projects\TestOrbit\web2py\gluon
\globals.py, line 366, in _try_store_on_disk
self._unlock(response)
  File G:\My Documents\Carl\projects\TestOrbit\web2py\gluon
\globals.py, line 374, in _unlock
response.session_file.close()
IOError: [Errno 13] Permission denied

I think 1.65.5 kicked out a warning to console; 1.66.2 shouts louder.

With this short post do you have any initial ideas? (I'm using XP,
Sqlite)



On Aug 21, 8:51 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I will look into this today.

 On Aug 20, 4:24 am, Carl carl.ro...@gmail.com wrote:



  hi,

  I upgraded from 1.65.5 to 1.66.1 this morning but had the following
  issue.

  I'm using WinXP with sqlite.

  recent call stack (most recent call at bottom)...

  gluon/main.py line 470 inwsgibase session._unlock(response)

  gluon/globals.py line 369 in _unlock portalocker.unlock
  (response.session_file)

  gluon/portalocker.py line 74 unlock
  hfile = win32file._get_ofshandle(file.fileno())
  ValueError: I/O operation on closed file

  I didn't try to deploy to gae (my production environment) but a return
  to 1.65.5 worked just fine.

  Before I give more details, is this a known issue with the 1.66.1
  release?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29335] Re: upgrading to 1.66.1 chokes on sqlite database

2009-08-25 Thread mdipierro

Yes. That issues was fixed in 1.66.2

On Aug 20, 4:24 am, Carl carl.ro...@gmail.com wrote:
 hi,

 I upgraded from 1.65.5 to 1.66.1 this morning but had the following
 issue.

 I'm using WinXP with sqlite.

 recent call stack (most recent call at bottom)...

 gluon/main.py line 470 inwsgibase session._unlock(response)

 gluon/globals.py line 369 in _unlock portalocker.unlock
 (response.session_file)

 gluon/portalocker.py line 74 unlock
 hfile = win32file._get_ofshandle(file.fileno())
 ValueError: I/O operation on closed file

 I didn't try to deploy to gae (my production environment) but a return
 to 1.65.5 worked just fine.

 Before I give more details, is this a known issue with the 1.66.1
 release?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29336] radical proposal

2009-08-25 Thread mdipierro

I have a radical proposal of changing the default length of string,
upload, password fields to 512. This will cause a migration in all
existing apps.

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



[web2py:29337] SQLFORM with individual HTML customization

2009-08-25 Thread whs

Hi,

I want to program our intranet site with web2py (because it is really
the best framework I found).
Because this is sort of an ERP application I need a lot of
customizations of the SQLFORMs in HTML, e.g. group the address or
communication fields in a special way.
I learned from the manual that I can create a form in HTML with a
hidden field _formname and use this name in form.accepts. This works
fine for new records. But I also have to update data with this form. I
did not find a solution for showing data in this form automatically.
Of course I can get the record and fill all the fields in the form
manually by assigning the data directly in the INPUT tag in the view,
but this is very fault-prone and hard to maintain. Is there an easier
way to achieve this?

Wolfgang


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



[web2py:29338] EARN MONEY $1000-25000 PER MONTH

2009-08-25 Thread gurudon s

EARN MONEY $1000-25000 PER MONTH
TAKE SIMPLE ONLINE SURVEYS
CREATE FREE ACCOUNT OTHER DETAILS LOG ON TO
*
http://www.AWSurveys.com/HomeMain.cfm?RefID=sangeethap77
*
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29339] Re: radical proposal

2009-08-25 Thread Iceberg

On Aug26, 12:53am, mdipierro mdipie...@cs.depaul.edu wrote:
 I have a radical proposal of changing the default length of string,
 upload, password fields to 512. This will cause a migration in all
 existing apps.

What is the default length of string currently?

If I modified my old apps to define an explicit length according to
the old default length XX, like this:
db.Field('fullname', 'string', length=XX)
do I still need to migrate my db?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29340] Re: new welcome layout

2009-08-25 Thread mr.freeze

IMHO the welcome app, web2py.com and the admin interface should have
the same color scheme and styles to give them a unified look and
feel.

On Aug 25, 2:47 am, mdipierro mdipie...@cs.depaul.edu wrote:
 That color scheme is based on the color wheel by Itten. It is the same
 used herehttp://www.web2py.com/layouts.
 In fact I have rewritten the algorithm in Python.

 The problem is that I lack the software to make button, banners, etc.

 Massimo

 On Aug 24, 7:00 pm, mr.freeze nat...@freezable.com wrote:



  It may just be me but those colors don't seem to go together.  Have
  you tried using a color scheme tool like 
  this?:http://colorschemedesigner.com/

  On Aug 24, 9:40 am, mdipierro mdipie...@cs.depaul.edu wrote:

   I posted a new layout for the scaffolding app. This is not definitive
   and I could use some feedback. If there is a web designer here who can
   help us make it better it would be great. I'd rather not change
   layout.html but base.css can be improved.- Hide quoted text -

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



[web2py:29341] Re: SQLFORM with individual HTML customization

2009-08-25 Thread Iceberg

On Aug25, 9:57pm, whs w...@everymail.net wrote:
 Hi,

 I want to program our intranet site with web2py (because it is really
 the best framework I found).
 Because this is sort of an ERP application I need a lot of
 customizations of the SQLFORMs in HTML, e.g. group the address or
 communication fields in a special way.
 I learned from the manual that I can create a form in HTML with a
 hidden field _formname and use this name in form.accepts. This works
 fine for new records. But I also have to update data with this form. I
 did not find a solution for showing data in this form automatically.
 Of course I can get the record and fill all the fields in the form
 manually by assigning the data directly in the INPUT tag in the view,
 but this is very fault-prone and hard to maintain. Is there an easier
 way to achieve this?

 Wolfgang

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



[web2py:29342] Re: upgrading to 1.66.1 chokes on sqlite database

2009-08-25 Thread Carl
thanks!

On 25/08/2009, mdipierro mdipie...@cs.depaul.edu wrote:


 Yes. That issues was fixed in 1.66.2

 On Aug 20, 4:24 am, Carl carl.ro...@gmail.com wrote:
  hi,
 
  I upgraded from 1.65.5 to 1.66.1 this morning but had the following
  issue.
 
  I'm using WinXP with sqlite.
 
  recent call stack (most recent call at bottom)...
 
  gluon/main.py line 470 inwsgibase session._unlock(response)
 
  gluon/globals.py line 369 in _unlock portalocker.unlock
  (response.session_file)
 
  gluon/portalocker.py line 74 unlock
  hfile = win32file._get_ofshandle(file.fileno())
  ValueError: I/O operation on closed file
 
  I didn't try to deploy to gae (my production environment) but a return
  to 1.65.5 worked just fine.
 
  Before I give more details, is this a known issue with the 1.66.1
  release?
 


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



[web2py:29343] Re: Every while and then file upload fails

2009-08-25 Thread Yarko Tymciurak

I would not be surprised if this is the same / closely related issue
we've seen w/ download.

If my memory serves,  webkit based browsers send a things in a little
different order.  If it's what I suspect, a tcpdump will not show it,
as it is a timing / recovery issue within cherrypy.

Just a thought - take a dump anyway, but don't be deterred if it
doesn't show anything other than a sudden lack of response from the
server.

- Yarko

On Tue, Aug 25, 2009 at 4:36 AM, mdipierromdipie...@cs.depaul.edu wrote:

 I have seen this before. I do not know what the problem is. Somebody
 needs to do a tcpdump of the conversation and figure out why the
 timeout occurs.

 Massimo

 On Aug 25, 3:09 am, mmstud mms...@gmail.com wrote:
 Got it captured. Actually upload process fails quite often with Safari
 (4.0.3):

 http://www.screencast.com/users/mmstud/folders/Jing/media/bc50ae72-c8...

 On Aug 25, 9:44 am, mmstud mms...@gmail.com wrote:

  Didnt happen with Firefox yesterday. I try today with Safari again.

  On Aug 24, 8:53 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   It should not be a problem.

   On Aug 24, 12:02 pm,mmstudmms...@gmail.com wrote:

I've been using Safari. Can try some hours with Firefox. One thing Im
doing, is to hit enter after giving new name to file and sometimes
clicking the submit button. Could it submit wrong form with enter?

-Marko

On Aug 24, 7:59 pm, mdipierro mdipie...@cs.depaul.edu wrote:

 I use a macbook and never had this problem. Do you get the probelm
 with both the source and binary? Can you reproduce it on different
 browsers? Which ones?

 Massimo

 On Aug 24, 11:48 am,mmstudmms...@gmail.com wrote:

  I have seen this happening every 3-5 file upload. Im using admin
  panel to upload static files. After 2-4 succesful upload this
  happens:

  Error traceback
  Traceback (most recent call last):
    File /Users/mmstud/Downloads/web2py-read-only/gluon/main.py, 
  line
  320, in wsgibase
      int(request.env.content_length))
    File 
  /Users/mmstud/Downloads/web2py-read-only/gluon/fileutils.py,
  line 267, in copystream
      data = src.read(size)
    File 
  /Users/mmstud/Downloads/web2py-read-only/gluon/wsgiserver.py,
  line 192, in read
      data = self.rfile.read(size)
    File 
  /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
  python2.5/socket.py, line 309, in read
      data = self._sock.recv(recv_size)
  timeout: timed out

  Is it a serious problem? When I re upload same file, it usually 
  works.
  Im doing development on my macbook.
 


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



[web2py:29344] Re: findby name and link to event records

2009-08-25 Thread Yarko Tymciurak

I suggested you have ipython installed, because web2py shell will use
ipython if it's available (and you then get completion facilities).

Sorry for any confusion.

On Tue, Aug 25, 2009 at 8:52 AM, mr.freezenat...@freezable.com wrote:

 As Yarko mentioned, you need to start web2py in shell mode by typing:
python web2py.py -S yourapp -M
 This will create all of the variables you need in the shell such as
 db.

 I highly recommend going through the book from start to end.  It will
 save you many hours of frustration and only costs $12.
 http://www.lulu.com/content/4968879

 Good luck!

 On Aug 25, 8:09 am, jayvandal jayvan...@gmail.com wrote:
 I downloade ipython and it installed it in python26\lib\site packages
 \ipython as per the installer..(I am running Windows Vista)
 I ran ipython and typed  in
 records=db(db.person.last_name==request.vars.last_name)\
            .select(orderby=db.person.last_name)
 -
 It didn't like db.
 I dont see it relating to the database in sqlite in web2py
 Thanks
 Jim

 On Aug 24, 10:14 pm, Yarko Tymciurak yark...@gmail.com wrote:



  On Mon, Aug 24, 2009 at 11:02 PM, jayvandaljayvan...@gmail.com wrote:

   I tried to get the person_id when I got a last name found, but I could
   not find a way to get the person_id with this code,

  ..

HI,
I tried this code
=
records=db(db.person.last_name==request.vars.last_name)\
          .select(orderby=db.person.last_name)
===
i see that this will find by last name or partial last name.

  You should really get familiar with running commands in a shell, and
  be sure to install iPython (it will give you TAB completion)-

  then you could try this line, and inspect the results -

  python web2py.py -S myapp -M
  [1] records=db(db.person.last_name==request.vars.last_name)\
              .select(orderby=db.person.last_name)

  [2] len(records)
  [3] records[0]
  [4] records[0].[TAB]

  ([TAB] I meant just hit the TAB key) - Try it, let us konw what you 
  see...

  Regards,
  - Yarko

I tried to get the person_id and use it to find all the events for
that person and then display the event records.

Can I do this or should I  do this??
Thanks
Jim- Hide quoted text -

   - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -
 


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



[web2py:29346] Re: Every while and then file upload fails

2009-08-25 Thread Yarko Tymciurak

btw - webkit browsers are Safari and Google Chrome

On Tue, Aug 25, 2009 at 1:18 PM, Yarko Tymciurakyark...@gmail.com wrote:
 I would not be surprised if this is the same / closely related issue
 we've seen w/ download.

 If my memory serves,  webkit based browsers send a things in a little
 different order.  If it's what I suspect, a tcpdump will not show it,
 as it is a timing / recovery issue within cherrypy.

 Just a thought - take a dump anyway, but don't be deterred if it
 doesn't show anything other than a sudden lack of response from the
 server.

 - Yarko

 On Tue, Aug 25, 2009 at 4:36 AM, mdipierromdipie...@cs.depaul.edu wrote:

 I have seen this before. I do not know what the problem is. Somebody
 needs to do a tcpdump of the conversation and figure out why the
 timeout occurs.

 Massimo

 On Aug 25, 3:09 am, mmstud mms...@gmail.com wrote:
 Got it captured. Actually upload process fails quite often with Safari
 (4.0.3):

 http://www.screencast.com/users/mmstud/folders/Jing/media/bc50ae72-c8...

 On Aug 25, 9:44 am, mmstud mms...@gmail.com wrote:

  Didnt happen with Firefox yesterday. I try today with Safari again.

  On Aug 24, 8:53 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   It should not be a problem.

   On Aug 24, 12:02 pm,mmstudmms...@gmail.com wrote:

I've been using Safari. Can try some hours with Firefox. One thing Im
doing, is to hit enter after giving new name to file and sometimes
clicking the submit button. Could it submit wrong form with enter?

-Marko

On Aug 24, 7:59 pm, mdipierro mdipie...@cs.depaul.edu wrote:

 I use a macbook and never had this problem. Do you get the probelm
 with both the source and binary? Can you reproduce it on different
 browsers? Which ones?

 Massimo

 On Aug 24, 11:48 am,mmstudmms...@gmail.com wrote:

  I have seen this happening every 3-5 file upload. Im using admin
  panel to upload static files. After 2-4 succesful upload this
  happens:

  Error traceback
  Traceback (most recent call last):
    File /Users/mmstud/Downloads/web2py-read-only/gluon/main.py, 
  line
  320, in wsgibase
      int(request.env.content_length))
    File 
  /Users/mmstud/Downloads/web2py-read-only/gluon/fileutils.py,
  line 267, in copystream
      data = src.read(size)
    File 
  /Users/mmstud/Downloads/web2py-read-only/gluon/wsgiserver.py,
  line 192, in read
      data = self.rfile.read(size)
    File 
  /System/Library/Frameworks/Python.framework/Versions/2.5/lib/
  python2.5/socket.py, line 309, in read
      data = self._sock.recv(recv_size)
  timeout: timed out

  Is it a serious problem? When I re upload same file, it usually 
  works.
  Im doing development on my macbook.
 



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



[web2py:29347] Re: radical proposal

2009-08-25 Thread mdipierro



On Aug 25, 12:21 pm, Iceberg iceb...@21cn.com wrote:
 On Aug26, 12:53am, mdipierro mdipie...@cs.depaul.edu wrote:

  I have a radical proposal of changing the default length of string,
  upload, password fields to 512. This will cause a migration in all
  existing apps.

 What is the default length of string currently?

32 for strings, 128 for upload (that may cause truntaction of original
filename), 32 for password (should be 128 for hmac+sha512).


 If I modified my old apps to define an explicit length according to
 the old default length XX, like this:
     db.Field('fullname', 'string', length=XX)
 do I still need to migrate my db?

No. But by the time a user figured out that was needed it has migrated
already.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29348] Re: new welcome layout

2009-08-25 Thread mdipierro

I was working under the opposite assumption so that new users do now
get confused on what is what.

On Aug 25, 12:22 pm, mr.freeze nat...@freezable.com wrote:
 IMHO the welcome app, web2py.com and the admin interface should have
 the same color scheme and styles to give them a unified look and
 feel.

 On Aug 25, 2:47 am, mdipierro mdipie...@cs.depaul.edu wrote:

  That color scheme is based on the color wheel by Itten. It is the same
  used herehttp://www.web2py.com/layouts.
  In fact I have rewritten the algorithm in Python.

  The problem is that I lack the software to make button, banners, etc.

  Massimo

  On Aug 24, 7:00 pm, mr.freeze nat...@freezable.com wrote:

   It may just be me but those colors don't seem to go together.  Have
   you tried using a color scheme tool like 
   this?:http://colorschemedesigner.com/

   On Aug 24, 9:40 am, mdipierro mdipie...@cs.depaul.edu wrote:

I posted a new layout for the scaffolding app. This is not definitive
and I could use some feedback. If there is a web designer here who can
help us make it better it would be great. I'd rather not change
layout.html but base.css can be improved.- Hide quoted text -

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



[web2py:29345] Re: new welcome layout

2009-08-25 Thread Yarko Tymciurak

the old default was 32 I think;   you do not need to migrate if you
have explicitly defined lengths.
If you used default in apps, and did not set migrate=False then
WARNING this change will change (migrate) your db.

That's what Massimo was getting at I think.

On Tue, Aug 25, 2009 at 12:22 PM, mr.freezenat...@freezable.com wrote:

 IMHO the welcome app, web2py.com and the admin interface should have
 the same color scheme and styles to give them a unified look and
 feel.

 On Aug 25, 2:47 am, mdipierro mdipie...@cs.depaul.edu wrote:
 That color scheme is based on the color wheel by Itten. It is the same
 used herehttp://www.web2py.com/layouts.
 In fact I have rewritten the algorithm in Python.

 The problem is that I lack the software to make button, banners, etc.

 Massimo

 On Aug 24, 7:00 pm, mr.freeze nat...@freezable.com wrote:



  It may just be me but those colors don't seem to go together.  Have
  you tried using a color scheme tool like 
  this?:http://colorschemedesigner.com/

  On Aug 24, 9:40 am, mdipierro mdipie...@cs.depaul.edu wrote:

   I posted a new layout for the scaffolding app. This is not definitive
   and I could use some feedback. If there is a web designer here who can
   help us make it better it would be great. I'd rather not change
   layout.html but base.css can be improved.- Hide quoted text -

 - Show quoted text -
 


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



[web2py:29349] Re: new welcome layout

2009-08-25 Thread Yarko Tymciurak

(oops! - accidentally posted this in the wrong place - should have
gone to the radical ... thread)

On Tue, Aug 25, 2009 at 1:31 PM, Yarko Tymciurakyark...@gmail.com wrote:
 the old default was 32 I think;   you do not need to migrate if you
 have explicitly defined lengths.
 If you used default in apps, and did not set migrate=False then
 WARNING this change will change (migrate) your db.

 That's what Massimo was getting at I think.

 On Tue, Aug 25, 2009 at 12:22 PM, mr.freezenat...@freezable.com wrote:

 IMHO the welcome app, web2py.com and the admin interface should have
 the same color scheme and styles to give them a unified look and
 feel.

 On Aug 25, 2:47 am, mdipierro mdipie...@cs.depaul.edu wrote:
 That color scheme is based on the color wheel by Itten. It is the same
 used herehttp://www.web2py.com/layouts.
 In fact I have rewritten the algorithm in Python.

 The problem is that I lack the software to make button, banners, etc.

 Massimo

 On Aug 24, 7:00 pm, mr.freeze nat...@freezable.com wrote:



  It may just be me but those colors don't seem to go together.  Have
  you tried using a color scheme tool like 
  this?:http://colorschemedesigner.com/

  On Aug 24, 9:40 am, mdipierro mdipie...@cs.depaul.edu wrote:

   I posted a new layout for the scaffolding app. This is not definitive
   and I could use some feedback. If there is a web designer here who can
   help us make it better it would be great. I'd rather not change
   layout.html but base.css can be improved.- Hide quoted text -

 - Show quoted text -
 



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



[web2py:29350] Re: radical proposal

2009-08-25 Thread Jonathan Lundell

On Aug 25, 2009, at 9:53 AM, mdipierro wrote:

 I have a radical proposal of changing the default length of string,
 upload, password fields to 512. This will cause a migration in all
 existing apps.

This might be a good opportunity to make an explicit contract on  
default fields with respect to migration and backward compatibility,  
namely that default fields are subject to change, so if it's important  
that a field not be subject to change, the developer must make it  
explicit, and not assume that the default is forever. A second  
condition might be that any change will be safely migratable (for  
example, a field's default length will never be shortented).

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



[web2py:29352] Re: radical proposal

2009-08-25 Thread mdipierro

I agree

On Aug 25, 2:08 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Aug 25, 2009, at 9:53 AM, mdipierro wrote:

  I have a radical proposal of changing the default length of string,
  upload, password fields to 512. This will cause a migration in all
  existing apps.

 This might be a good opportunity to make an explicit contract on  
 default fields with respect to migration and backward compatibility,  
 namely that default fields are subject to change, so if it's important  
 that a field not be subject to change, the developer must make it  
 explicit, and not assume that the default is forever. A second  
 condition might be that any change will be safely migratable (for  
 example, a field's default length will never be shortented).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29353] Re: ldap-auth issue

2009-08-25 Thread Don

I am also trying to authenticate against a LDAP server (not working).
I cannot get the ldapwhoami command to work, but ldap search does work
for me.  I do not think the server can respond to the command.
ldapsearch does work:

ldapsearch -b 'ou=yp,o=company.com' -H ldaps://yp.company.com -x
'mail=testu...@us.company.com'

I tried the ldap module directly, and that worked as well.
=
 import ldap
 dap = ldap.initialize('ldap://yp.company.com')
 dn=
 pw=
 dap.simple_bind_s(dn, pw)
(97, [])
 dap.search_s('ou=yp,o=company.com', 
 ldap.SCOPE_SUBTREE,'(mail=testu...@us.company.com)',['emailaddress','cn'])
[('uid=testUser,c=us,ou=yp,o=company.com', {'emailaddress':
['testu...@us.company.com'], 'cn': ['Test User']})]


==

my auth congids are as follows:

==
authDB = SQLDB('sqlite://auth_database.sqlite')

from gluon.tools import Auth, Mail
from gluon.contrib.login_methods.ldap_auth import ldap_auth

mail=Mail()
mail.settings.server='localhost:25'
mail.settings.sender='testu...@us.company.com'


auth=Auth(globals(),authDB)
auth.settings.login_methods.append(ldap_auth(mode='mail',
server='yp.company.com',
base_dn='ou=yp,o=company.com'
))
auth.define_tables()
auth.settings.mailer = mail


I have PostgreSQL authenticating via pam_ldap using the same settings
that i have applied to the auth module.  What am I missing?  Is there
some other option that i need to pass to ldap_auth to get it to use
simple binding?




On Aug 4, 5:25 am, Johann Spies johann.sp...@gmail.com wrote:
 Apologies. I was testing from two different computers. On the one
 (where the web2py server was running) it was working and I did not see
 that the one from which I pasted the entries was failing. The
 following worked (same string with a 'TLS_REQCERT allow'  added to
 /etc/ldap/ldap.conf):

 $ ldapwhoami -H ldaps://stbldap01.sun.ac.za  -D
 'cn=jspies,ou=users,O=SU' -x -v -W -n
 EnterLDAPPassword:
 ldap_initialize( ldaps://stbldap01.sun.ac.za:636/??base )
 Result: Success (0)

 Regards
 Johann
 2009/8/4 Fran francisb...@googlemail.com:



  We need a working string in order to know how to code that within
  Web2Py.
  All of these have failed...

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



[web2py:29354] Re: new welcome layout

2009-08-25 Thread Jonathan Lundell

On Aug 25, 2009, at 11:42 AM, mdipierro wrote:


 I was working under the opposite assumption so that new users do now
 get confused on what is what.

I think that's a good move.


 On Aug 25, 12:22 pm, mr.freeze nat...@freezable.com wrote:
 IMHO the welcome app, web2py.com and the admin interface should have
 the same color scheme and styles to give them a unified look and
 feel.

 On Aug 25, 2:47 am, mdipierro mdipie...@cs.depaul.edu wrote:

 That color scheme is based on the color wheel by Itten. It is the  
 same
 used herehttp://www.web2py.com/layouts.
 In fact I have rewritten the algorithm in Python.

 The problem is that I lack the software to make button, banners,  
 etc.

 Massimo

 On Aug 24, 7:00 pm, mr.freeze nat...@freezable.com wrote:

 It may just be me but those colors don't seem to go together.  Have
 you tried using a color scheme tool like 
 this?:http://colorschemedesigner.com/

 On Aug 24, 9:40 am, mdipierro mdipie...@cs.depaul.edu wrote:

 I posted a new layout for the scaffolding app. This is not  
 definitive
 and I could use some feedback. If there is a web designer here  
 who can
 help us make it better it would be great. I'd rather not change
 layout.html but base.css can be improved.- Hide quoted text -

 - Show quoted text -
 



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



[web2py:29355] Re: @reboot CRON patch

2009-08-25 Thread mdipierro

In trunk! thanks.

On Aug 25, 2:14 pm, Kacper Krupa pageno...@gmail.com wrote:
 Hello,

 Lately i've to use web2py's cron, and @reboot function but it didn't
 work, so I checked it and created patch. Use it if you want.

 http://paste.pagenoare.net/default/show/136

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



[web2py:29356] Re: radical proposal

2009-08-25 Thread mdipierro

In trunk. Give this is a try. please.

On Aug 25, 2:20 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I agree

 On Aug 25, 2:08 pm, Jonathan Lundell jlund...@pobox.com wrote:

  On Aug 25, 2009, at 9:53 AM, mdipierro wrote:

   I have a radical proposal of changing the default length of string,
   upload, password fields to 512. This will cause a migration in all
   existing apps.

  This might be a good opportunity to make an explicit contract on  
  default fields with respect to migration and backward compatibility,  
  namely that default fields are subject to change, so if it's important  
  that a field not be subject to change, the developer must make it  
  explicit, and not assume that the default is forever. A second  
  condition might be that any change will be safely migratable (for  
  example, a field's default length will never be shortented).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:29357] Re: ldap-auth issue

2009-08-25 Thread Don

I took a look at the source code and I see that the mode option has
a specific set of accepted values.  our user names are based on the
mail field in the ldap record.  not uid.  So this would not work at
all. unless I change the source.

On Aug 25, 3:24 pm, Don sam...@gmail.com wrote:
 I am also trying to authenticate against a LDAP server (not working).
 I cannot get the ldapwhoami command to work, but ldap search does work
 for me.  I do not think the server can respond to the command.
 ldapsearch does work:

 ldapsearch -b 'ou=yp,o=company.com' -H ldaps://yp.company.com -x
 'mail=testu...@us.company.com'

 I tried the ldap module directly, and that worked as well.
 = import ldap
  dap = ldap.initialize('ldap://yp.company.com')
  dn=
  pw=
  dap.simple_bind_s(dn, pw)
 (97, [])
  dap.search_s('ou=yp,o=company.com', 
  ldap.SCOPE_SUBTREE,'(mail=testu...@us.company.com)',['emailaddress','cn'])

 [('uid=testUser,c=us,ou=yp,o=company.com', {'emailaddress':
 ['testu...@us.company.com'], 'cn': ['Test User']})]



 ==

 my auth congids are as follows:

 ==
 authDB = SQLDB('sqlite://auth_database.sqlite')

 from gluon.tools import Auth, Mail
 from gluon.contrib.login_methods.ldap_auth import ldap_auth

 mail=Mail()
 mail.settings.server='localhost:25'
 mail.settings.sender='testu...@us.company.com'

 auth=Auth(globals(),authDB)
 auth.settings.login_methods.append(ldap_auth(mode='mail',
     server='yp.company.com',
     base_dn='ou=yp,o=company.com'
     ))
 auth.define_tables()
 auth.settings.mailer = mail
 

 I have PostgreSQL authenticating via pam_ldap using the same settings
 that i have applied to the auth module.  What am I missing?  Is there
 some other option that i need to pass to ldap_auth to get it to use
 simple binding?

 On Aug 4, 5:25 am, Johann Spies johann.sp...@gmail.com wrote:

  Apologies. I was testing from two different computers. On the one
  (where the web2py server was running) it was working and I did not see
  that the one from which I pasted the entries was failing. The
  following worked (same string with a 'TLS_REQCERT allow'  added to
  /etc/ldap/ldap.conf):

  $ ldapwhoami -H ldaps://stbldap01.sun.ac.za  -D
  'cn=jspies,ou=users,O=SU' -x -v -W -n
  EnterLDAPPassword:
  ldap_initialize( ldaps://stbldap01.sun.ac.za:636/??base )
  Result: Success (0)

  Regards
  Johann
  2009/8/4 Fran francisb...@googlemail.com:

   We need a working string in order to know how to code that within
   Web2Py.
   All of these have failed...

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



[web2py:29359] Re: Googlemap in web2py

2009-08-25 Thread Tim Michelsen

mdipierro schrieb:
 We have this:
 
 http://bazaar.launchpad.net/~mdipierro/web2conf/devel/annotate/head%3A/views/default/maps.html
 
 and we have
 
 from gluon.tools import geocode
 (lo,la)=geocode('243 S Wabash Ave, Chicago, IL)

I succeded in using OpenLayers.
Quite easy with web2py.

But the relevant java code in a file called mymap.html

then modify the view:

{{extend 'layout.html'}}
{{extend 'mymap.html'}}

{{try:}}{{=H2(message)}}{{except:}}{{=BEAUTIFY(response._vars)}}{{pass}}br 
/

a href='/admin'{{=T(click here for the administrative interface)}}br /
a href='/examples'{{=T(click here for online examples)}}br /
a href='/welcome_modif/default/show_doc'{{=T(click here for the Show 
Doc Test)}}/a

= the map is now reusable.

= you still need to write the java code yourself.
But you can just start with the simple examples at:
http://openlayers.org/dev/examples/

I don't know what interaction with web2py or database you need.
Also search the list archives for geo.


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



[web2py:29362] Re: Every while and then file upload fails

2009-08-25 Thread Wes James

On Tue, Aug 25, 2009 at 2:24 PM, sherdimsher...@gmail.com wrote:

 I agree that the problem exists.

 In my app a manager regularly complains on this error when uploading
 photos.

 attempts to increase timeout in the class HttpServer didn't help
 error can emerge through a couple of seconds

 His system: Windows Vista, IE7

 Server: Windows Server 2003, web2py in source

What database?  I always had this problem with sqlite, but when I
moved to postgresl, I didn't see this anymore.

-wes

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



[web2py:29363] Re: EARN MONEY $1000-25000 PER MONTH

2009-08-25 Thread Yarko Tymciurak

This user is banned;  this mail must have accidentally been let thru
(we moderate all new users, and then filter spam vs. actual web2py
mail - sometimes, on a very busy night of spam, it is easy to click
the wrong box, and accidentally let one mail through.  Thankfully,
this happens very rarely).

On Tue, Aug 25, 2009 at 3:20 PM, Álvaro Justen
[Turicas]alvarojus...@gmail.com wrote:

 Anyone can ban this user?

 On Tue, Aug 25, 2009 at 14:14, gurudon ssdguru1...@gmail.com wrote:

 EARN MONEY $1000-25000 PER MONTH
 TAKE SIMPLE ONLINE SURVEYS
 CREATE FREE ACCOUNT OTHER DETAILS LOG ON TO
 *
 http://www.AWSurveys.com/HomeMain.cfm?RefID=sangeethap77
 *
 




 --
  Álvaro Justen
  Peta5 - Telecomunicações e Software Livre
  21 3021-6001 / 9898-0141
  http://www.peta5.com.br/

 


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



[web2py:29364] Re: Every while and then file upload fails

2009-08-25 Thread Yarko Tymciurak

what web server are you using?

Have you configured for Windows IIS-6?  windows apache + wsgi?
web2py's included cherrypy?  (etc.)?

On Tue, Aug 25, 2009 at 3:24 PM, sherdimsher...@gmail.com wrote:

 I agree that the problem exists.

 In my app a manager regularly complains on this error when uploading
 photos.

 attempts to increase timeout in the class HttpServer didn't help
 error can emerge through a couple of seconds

 His system: Windows Vista, IE7

 Server: Windows Server 2003, web2py in source
 


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



[web2py:29365] Re: ldap-auth issue

2009-08-25 Thread Don

I made a mistake.  ldapsearch does in fact return a uid.  I do not
manage the ldap server, so I did not know how it was setup.  I think
when we authenticate against postgress, it takes our e-mai addresses,
finds the uid/dn (which in our case is a cryptic serial number) and
then attempts to authenticate against the ldap server.  I do not think
web2py needs to be patched.  I just need to somehow, when the user
registers with their e-mail address, find their their uid and store
that as the user name.  While still allowing them to login with their
e-mail address.  I will think about it and see what I can do.  Thanks
for the help.

On Aug 25, 3:57 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 Please send me a patch to allow this.

 Massimo

 On Aug 25, 2:47 pm, Don sam...@gmail.com wrote:

  I took a look at the source code and I see that the mode option has
  a specific set of accepted values.  our user names are based on the
  mail field in the ldap record.  not uid.  So this would not work at
  all. unless I change the source.

  On Aug 25, 3:24 pm, Don sam...@gmail.com wrote:

   I am also trying to authenticate against a LDAP server (not working).
   I cannot get the ldapwhoami command to work, but ldap search does work
   for me.  I do not think the server can respond to the command.
   ldapsearch does work:

   ldapsearch -b 'ou=yp,o=company.com' -H ldaps://yp.company.com -x
   'mail=testu...@us.company.com'

   I tried the ldap module directly, and that worked as well.
   = import ldap
dap = ldap.initialize('ldap://yp.company.com')
dn=
pw=
dap.simple_bind_s(dn, pw)
   (97, [])
dap.search_s('ou=yp,o=company.com', 
ldap.SCOPE_SUBTREE,'(mail=testu...@us.company.com)',['emailaddress','cn'])

   [('uid=testUser,c=us,ou=yp,o=company.com', {'emailaddress':
   ['testu...@us.company.com'], 'cn': ['Test User']})]

   ==

   my auth congids are as follows:

   ==
   authDB = SQLDB('sqlite://auth_database.sqlite')

   from gluon.tools import Auth, Mail
   from gluon.contrib.login_methods.ldap_auth import ldap_auth

   mail=Mail()
   mail.settings.server='localhost:25'
   mail.settings.sender='testu...@us.company.com'

   auth=Auth(globals(),authDB)
   auth.settings.login_methods.append(ldap_auth(mode='mail',
       server='yp.company.com',
       base_dn='ou=yp,o=company.com'
       ))
   auth.define_tables()
   auth.settings.mailer = mail
   

   I have PostgreSQL authenticating via pam_ldap using the same settings
   that i have applied to the auth module.  What am I missing?  Is there
   some other option that i need to pass to ldap_auth to get it to use
   simple binding?

   On Aug 4, 5:25 am, Johann Spies johann.sp...@gmail.com wrote:

Apologies. I was testing from two different computers. On the one
(where the web2py server was running) it was working and I did not see
that the one from which I pasted the entries was failing. The
following worked (same string with a 'TLS_REQCERT allow'  added to
/etc/ldap/ldap.conf):

$ ldapwhoami -H ldaps://stbldap01.sun.ac.za  -D
'cn=jspies,ou=users,O=SU' -x -v -W -n
EnterLDAPPassword:
ldap_initialize( ldaps://stbldap01.sun.ac.za:636/??base )
Result: Success (0)

Regards
Johann
2009/8/4 Fran francisb...@googlemail.com:

 We need a working string in order to know how to code that within
 Web2Py.
 All of these have failed...

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



[web2py:29360] Re: EARN MONEY $1000-25000 PER MONTH

2009-08-25 Thread Álvaro Justen [Turicas]

Anyone can ban this user?

On Tue, Aug 25, 2009 at 14:14, gurudon ssdguru1...@gmail.com wrote:

 EARN MONEY $1000-25000 PER MONTH
 TAKE SIMPLE ONLINE SURVEYS
 CREATE FREE ACCOUNT OTHER DETAILS LOG ON TO
 *
 http://www.AWSurveys.com/HomeMain.cfm?RefID=sangeethap77
 *
 




-- 
 Álvaro Justen
 Peta5 - Telecomunicações e Software Livre
 21 3021-6001 / 9898-0141
 http://www.peta5.com.br/

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



[web2py:29361] Re: Every while and then file upload fails

2009-08-25 Thread sherdim

I agree that the problem exists.

In my app a manager regularly complains on this error when uploading
photos.

attempts to increase timeout in the class HttpServer didn't help
error can emerge through a couple of seconds

His system: Windows Vista, IE7

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



[web2py:29366] Re: ldap-auth issue

2009-08-25 Thread Don Lee
I thought the following code would work, but I am not getting any response.

===
if mode == 'company':
# search company ldap database via the e-mail address to figure out the
dn
con.simple_bind_s(, )
filter = '(mail='+username+')'
attrs = ['uid']
company_search_result=con.search_s(ldap_basedn, ldap.SCOPE_SUBTREE,
filter, attrs)
dn=company_search_result[0][0]
===

I added the code before:

gluon/contrib/login_methods/ldap_auth.py
===
elif mode == 'uid':
===

then I changed the model to read:

===
auth.settings.login_methods.append(ldap_auth(mode='company',
server='yp.company.com',
base_dn='ou=bluepages,o=ibm.com'))
===

It didn't work.

On Tue, Aug 25, 2009 at 5:02 PM, Don sam...@gmail.com wrote:


 I made a mistake.  ldapsearch does in fact return a uid.  I do not
 manage the ldap server, so I did not know how it was setup.  I think
 when we authenticate against postgress, it takes our e-mai addresses,
 finds the uid/dn (which in our case is a cryptic serial number) and
 then attempts to authenticate against the ldap server.  I do not think
 web2py needs to be patched.  I just need to somehow, when the user
 registers with their e-mail address, find their their uid and store
 that as the user name.  While still allowing them to login with their
 e-mail address.  I will think about it and see what I can do.  Thanks
 for the help.

 On Aug 25, 3:57 pm, mdipierro mdipie...@cs.depaul.edu wrote:
  Please send me a patch to allow this.
 
  Massimo
 
  On Aug 25, 2:47 pm, Don sam...@gmail.com wrote:
 
   I took a look at the source code and I see that the mode option has
   a specific set of accepted values.  our user names are based on the
   mail field in the ldap record.  not uid.  So this would not work at
   all. unless I change the source.
 
   On Aug 25, 3:24 pm, Don sam...@gmail.com wrote:
 
I am also trying to authenticate against a LDAP server (not working).
I cannot get the ldapwhoami command to work, but ldap search does
 work
for me.  I do not think the server can respond to the command.
ldapsearch does work:
 
ldapsearch -b 'ou=yp,o=company.com' -H ldaps://yp.company.com -x
'mail=testu...@us.company.com'
 
I tried the ldap module directly, and that worked as well.
= import ldap
 dap = ldap.initialize('ldap://yp.company.com')
 dn=
 pw=
 dap.simple_bind_s(dn, pw)
(97, [])
 dap.search_s('ou=yp,o=company.com', ldap.SCOPE_SUBTREE,'(mail=
 testu...@us.company.com)',['emailaddress','cn'])
 
[('uid=testUser,c=us,ou=yp,o=company.com', {'emailaddress':
['testu...@us.company.com'], 'cn': ['Test User']})]
 
==
 
my auth congids are as follows:
 
==
authDB = SQLDB('sqlite://auth_database.sqlite')
 
from gluon.tools import Auth, Mail
from gluon.contrib.login_methods.ldap_auth import ldap_auth
 
mail=Mail()
mail.settings.server='localhost:25'
mail.settings.sender='testu...@us.company.com'
 
auth=Auth(globals(),authDB)
auth.settings.login_methods.append(ldap_auth(mode='mail',
server='yp.company.com',
base_dn='ou=yp,o=company.com'
))
auth.define_tables()
auth.settings.mailer = mail

 
I have PostgreSQL authenticating via pam_ldap using the same settings
that i have applied to the auth module.  What am I missing?  Is there
some other option that i need to pass to ldap_auth to get it to use
simple binding?
 
On Aug 4, 5:25 am, Johann Spies johann.sp...@gmail.com wrote:
 
 Apologies. I was testing from two different computers. On the one
 (where the web2py server was running) it was working and I did not
 see
 that the one from which I pasted the entries was failing. The
 following worked (same string with a 'TLS_REQCERT allow'  added to
 /etc/ldap/ldap.conf):
 
 $ ldapwhoami -H ldaps://stbldap01.sun.ac.za  -D
 'cn=jspies,ou=users,O=SU' -x -v -W -n
 EnterLDAPPassword:
 ldap_initialize( ldaps://stbldap01.sun.ac.za:636/??base )
 Result: Success (0)
 
 Regards
 Johann
 2009/8/4 Fran francisb...@googlemail.com:
 
  We need a working string in order to know how to code that within
  Web2Py.
  All of these have failed...
 
  F
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more 

[web2py:29367] Re: OpenShare :: OpenSource Ad Service built in web2py!

2009-08-25 Thread Jon Romero

     Nice app, and great idea. Is there a way to restrict by the kind
 of ads one would add to his website?.

By choosing the category of your site, your banner is displayed only
to sites from the same category (and you are getting relevant banners
for your site).
This feature for now is disabled until all categories have a decent
amount of sites.
In the next version, you would be able to multi-select categories.

 I mean, mantaining a profesional
 website, I wouldn't mind linking to other profesional sites, but it
 doesn't make sense to link to say a retail store or gaming site or
 whatever.

I understand, that's why I am using multi-select categories. But even
now, I think that
display sites from the same category would product relevant ad
content.


     I'd very much like to see the code if its available.


There are some clean-ups left and then it's for all the world to
see :D

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



[web2py:29368] Re: run python code from onclick event

2009-08-25 Thread murray3

Ok I have a better understanding (i read a jquery ajax tutorial) of
what you where trying to do in your first reply. I have amended = to
== and added : in the if not statement which where missing and
caused syntax errors.
The problem is that in the view: onclick={{=URL
(r=request,f='check',args= [prodj.id,part.id])}}
does not do anything? the GAE command line does not show output when I
click the buttons so the action is not working.
I am running this code through jpolite v1 not sure if that is causing
the problem? although this particular view is loaded through thickbox
so should be outside jpolite.
chrism

On Aug 25, 4:10 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 def check():
     part_id=request.args(1)
     if not db((db.prodj_refs.prodj_id==request.args(0)) \
                   (db.prodj_refs.part_id==part_id)).delete()
                   return 'jQuery('#selector%i' % part_id).html('not
 selected')
     else:
           db.prodj_refs.insert(prodj_id=request.args
 (0),part_id=part_id)
           return 'jQuery('#selector%i' % part_id).html('selected')

 On Aug 25, 8:43 am, murray3 ch...@murraypost.net wrote:

  Hi,
  I was trying to get it to work without the syntax errors, I changed
  back to your controller code and get the following error:
  INFO     2009-08-25 13:31:35,296 dev_appserver.py] GET /fab3/default/
  m230/8?keepThi
   500 -
  INFO     2009-08-25 13:32:09,000 dev_appserver.py] GET /fab3/default/
  g/action-close
  00 -
  ERROR    2009-08-25 13:32:09,250 restricted.py] In FILE: Framework

  Traceback (most recent call last):
    File c:\apps\web2py\gluon\main.py, line 381, in wsgibase
      serve_controller(request, response, session)
    File c:\apps\web2py\gluon\main.py, line 157, in serve_controller
      run_controller_in(request.controller, request.function,
  environment)
    File c:\apps\web2py\gluon\compileapp.py, line 277, in
  run_controller_in
      code = getcfs(layer, filename, lambda : \
    File c:\apps\web2py\gluon\compileapp.py, line 104, in getcfs
      data = filter()
    File c:\apps\web2py\gluon\compileapp.py, line 279, in lambda
      'exec'))
    File c:\apps\web2py\applications\fab3/controllers/default.py:m230,
  line 218
      (db.prodj_refs.part_id==part_id)).delete()

  ^
  SyntaxError: invalid syntax

  chrism

  On Aug 25, 1:25 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   1) you changed the check() action from my example. I do not understand
   what it does anymore. I thought it would remove or add a single part
   but now it has a loop. why?
   2) did you try calling the check/[prod_id]/[part_id] action without
   ajax? That will give you a ticket that helps debugging.
   3) You my div with a input checkbox. Input does not have a /input.
   4) The code

   {{if db((db.prodj_refs.prodj_id==request.args
   (0))(db.prodj_refs.part_id==part.id)).count():}}selected{{else:}}not
   selected{{pass}}

   does not belong there anymore (becase input has no content). I guess
   you want

   input type=checkbox id=selector{{=part.id}}
                             onchange={{=URL(r=request,f='check',args=
   [prodj.id,part.id])}}
                           {{if db((db.prodj_refs.prodj_id==request.args
   (0))(db.prodj_refs.part_id==part.id)).count():}}
   checked=checked{{else:}}not
   selected{{pass}} /

   7) When you change 6) you wil also need to change the jquery commands
   returned by the check() action.

   On Aug 25, 7:17 am, murray3 ch...@murraypost.net wrote:

Guy's thanks for your help yesterday.
Massimo, I am developing for app engine so the  selects do not work
and I had to modify '=' to '==' in a couple of places to get the view
to load without GAE errors.
It is still not quite working, I nested 'if's' for GAE selects perhaps
you will see what needs amending?
thanks chrism

in contoller I have:

def check():
    part_id=request.args(1)
    prodj_parts_list=db(db.prodj_refs.prodj_id==request.args(0)).select
()
    for p in prodj_parts_list:
        if not db(db.prodj_parts.id==p.part_id).delete():
          return 'jQuery('#selector%i' % part_id).html('not selected')
    else:
        db.prodj_refs.insert(prodj_id=request.args(0),part_id=part_id)
    return 'jQuery('#selector%i' % part_id).html('selected')

and in view:
table width=100% cellpadding=1 cellspacing=0 border=0
class=display id=example
                        thead
                        tr
                        thPart 
Name/ththContent/ththNumber/ththCreated On/
th
                        /tr
                        /thead
                        tfoot
                        tr
                        thPart 
Name/ththContent/ththNumber/ththCreated On/
th
                        /tr
                        /tfoot
                        tbody
                        {{for part in parts:}}
                        tr
               

[web2py:29369] Re: findby name and link to event records

2009-08-25 Thread jayvandal

Thanks I have the book. I downloaded the book and then printed it . I
don't remember any ipython. i have the web2py windows  installed and
python 26 installed. I have downloaded ipython installed in python
folder in script , but I don't have a web2py.py file. Do I need a
ppython file of web2py to run in ipython?
Jim

On Aug 25, 7:52 am, mr.freeze nat...@freezable.com wrote:
 As Yarko mentioned, you need to start web2py in shell mode by typing:python 
 web2py.py -S yourapp -M

 This will create all of the variables you need in the shell such as
 db.

 I highly recommend going through the book from start to end.  It will
 save you many hours of frustration and only costs 
 $12.http://www.lulu.com/content/4968879

 Good luck!

 On Aug 25, 8:09 am, jayvandal jayvan...@gmail.com wrote:



  I downloadeipythonand it installed it in python26\lib\site packages
  \ipythonas per the installer..(I am running Windows Vista)
  I ranipythonand typed  in
  records=db(db.person.last_name==request.vars.last_name)\
             .select(orderby=db.person.last_name)
  -
  It didn't like db.
  I dont see it relating to the database in sqlite in web2py
  Thanks
  Jim

  On Aug 24, 10:14 pm, Yarko Tymciurak yark...@gmail.com wrote:

   On Mon, Aug 24, 2009 at 11:02 PM, jayvandaljayvan...@gmail.com wrote:

I tried to get the person_id when I got a last name found, but I could
not find a way to get the person_id with this code,

   ..

 HI,
 I tried this code
 =
 records=db(db.person.last_name==request.vars.last_name)\
           .select(orderby=db.person.last_name)
 ===
 i see that this will find by last name or partial last name.

   You should really get familiar with running commands in a shell, and
   be sure to installiPython(it will give you TAB completion)-

   then you could try this line, and inspect the results -

   python web2py.py -S myapp -M
   [1] records=db(db.person.last_name==request.vars.last_name)\
               .select(orderby=db.person.last_name)

   [2] len(records)
   [3] records[0]
   [4] records[0].[TAB]

   ([TAB] I meant just hit the TAB key) - Try it, let us konw what you 
   see...

   Regards,
   - Yarko

 I tried to get the person_id and use it to find all the events for
 that person and then display the event records.

 Can I do this or should I  do this??
 Thanks
 Jim- Hide quoted text -

- Show quoted text -- Hide quoted text -

   - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

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



[web2py:29370] Re: findby name and link to event records

2009-08-25 Thread mr.freeze

Yes, you'll need the source code.  You can get it here...:
http://www.web2py.com/examples/static/web2py_src.zip

...then extract it to the folder of your choice (c:\web2py for me)

Now open a command prompt, cd into that folder and type:
python web2py.py -S yourapp -M

The -S switch is for shell mode and the -M switch is to auto-import
your models from the specified app.

If it gives you grief about not being able to find python then just
add it to the path:
path %PATH%;C:\Python25

If iPython is installed, then it will start up instead of the regular
python shell.  From there you can try database queries to get a feel
for things:
dir(db)
q = db(db.person.id==1).select()
dir(q)
q.colnames
etc...


On Aug 25, 7:47 pm, jayvandal jayvan...@gmail.com wrote:
 Thanks I have the book. I downloaded the book and then printed it . I
 don't remember any ipython. i have the web2py windows  installed and
 python 26 installed. I have downloaded ipython installed in python
 folder in script , but I don't have a web2py.py file. Do I need a
 ppython file of web2py to run in ipython?
 Jim

 On Aug 25, 7:52 am, mr.freeze nat...@freezable.com wrote:



  As Yarko mentioned, you need to start web2py in shell mode by 
  typing:python web2py.py -S yourapp -M

  This will create all of the variables you need in the shell such as
  db.

  I highly recommend going through the book from start to end.  It will
  save you many hours of frustration and only costs 
  $12.http://www.lulu.com/content/4968879

  Good luck!

  On Aug 25, 8:09 am, jayvandal jayvan...@gmail.com wrote:

   I downloadeipythonand it installed it in python26\lib\site packages
   \ipythonas per the installer..(I am running Windows Vista)
   I ranipythonand typed  in
   records=db(db.person.last_name==request.vars.last_name)\
              .select(orderby=db.person.last_name)
   -
   It didn't like db.
   I dont see it relating to the database in sqlite in web2py
   Thanks
   Jim

   On Aug 24, 10:14 pm, Yarko Tymciurak yark...@gmail.com wrote:

On Mon, Aug 24, 2009 at 11:02 PM, jayvandaljayvan...@gmail.com wrote:

 I tried to get the person_id when I got a last name found, but I could
 not find a way to get the person_id with this code,

..

  HI,
  I tried this code
  =
  records=db(db.person.last_name==request.vars.last_name)\
            .select(orderby=db.person.last_name)
  ===
  i see that this will find by last name or partial last name.

You should really get familiar with running commands in a shell, and
be sure to installiPython(it will give you TAB completion)-

then you could try this line, and inspect the results -

python web2py.py -S myapp -M
[1] records=db(db.person.last_name==request.vars.last_name)\
            .select(orderby=db.person.last_name)

[2] len(records)
[3] records[0]
[4] records[0].[TAB]

([TAB] I meant just hit the TAB key) - Try it, let us konw what you 
see...

Regards,
- Yarko

  I tried to get the person_id and use it to find all the events for
  that person and then display the event records.

  Can I do this or should I  do this??
  Thanks
  Jim- Hide quoted text -

 - Show quoted text -- Hide quoted text -

- Show quoted text -- Hide quoted text -

   - Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

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



[web2py:29371] Re: ldap-auth issue

2009-08-25 Thread Don Lee
I finally have this working!!  I just had to read a lot of code and the
manual as well.  For my companies special LDAP server setup, I had to modify
ldap_auth.py and add the following section of code:


==
if ldap_mode == 'company':
# no DNs or password needed to search directory
dn=
pw=

# bind anonymously
con.simple_bind_s(dn, pw)
# search by e-mail address
filter = '(mail='+username+')'
# find the uid
attrs = ['uid']

# perform the actual search
company_search_result=con.search_s(ldap_basedn,
ldap.SCOPE_SUBTREE, filter, attrs)
dn=company_search_result[0][0]

# perform the real authentication test
con.simple_bind_s(dn, password)
==

I put the code before:

==
if ldap_mode == 'uid_r':
==

I then changed my model so that instead of appending a new authentication
method, I replaced the local method

==
auth.settings.login_methods=[ldap_auth(mode='company',
server='yp.company.com',
base_dn='ou=yp,o=company.com')]
==

** I will add a try to catch eventual errors and set it up so that the admin
will have to approve the users.









On Tue, Aug 25, 2009 at 6:54 PM, Don Lee sam...@gmail.com wrote:

 I thought the following code would work, but I am not getting any response.

 ===
 if mode == 'company':
 # search company ldap database via the e-mail address to figure out the
 dn
 con.simple_bind_s(, )
 filter = '(mail='+username+')'
 attrs = ['uid']
 company_search_result=con.search_s(ldap_basedn, ldap.SCOPE_SUBTREE,
 filter, attrs)
 dn=company_search_result[0][0]
 ===

 I added the code before:

 gluon/contrib/login_methods/ldap_auth.py
 ===
 elif mode == 'uid':
 ===

 then I changed the model to read:

 ===
 auth.settings.login_methods.append(ldap_auth(mode='company',
 server='yp.company.com',
 base_dn='ou=bluepages,o=ibm.com'))
 ===

 It didn't work.


 On Tue, Aug 25, 2009 at 5:02 PM, Don sam...@gmail.com wrote:


 I made a mistake.  ldapsearch does in fact return a uid.  I do not
 manage the ldap server, so I did not know how it was setup.  I think
 when we authenticate against postgress, it takes our e-mai addresses,
 finds the uid/dn (which in our case is a cryptic serial number) and
 then attempts to authenticate against the ldap server.  I do not think
 web2py needs to be patched.  I just need to somehow, when the user
 registers with their e-mail address, find their their uid and store
 that as the user name.  While still allowing them to login with their
 e-mail address.  I will think about it and see what I can do.  Thanks
 for the help.

 On Aug 25, 3:57 pm, mdipierro mdipie...@cs.depaul.edu wrote:
  Please send me a patch to allow this.
 
  Massimo
 
  On Aug 25, 2:47 pm, Don sam...@gmail.com wrote:
 
   I took a look at the source code and I see that the mode option has
   a specific set of accepted values.  our user names are based on the
   mail field in the ldap record.  not uid.  So this would not work at
   all. unless I change the source.
 
   On Aug 25, 3:24 pm, Don sam...@gmail.com wrote:
 
I am also trying to authenticate against a LDAP server (not
 working).
I cannot get the ldapwhoami command to work, but ldap search does
 work
for me.  I do not think the server can respond to the command.
ldapsearch does work:
 
ldapsearch -b 'ou=yp,o=company.com' -H ldaps://yp.company.com -x
'mail=testu...@us.company.com'
 
I tried the ldap module directly, and that worked as well.
= import ldap
 dap = ldap.initialize('ldap://yp.company.com')
 dn=
 pw=
 dap.simple_bind_s(dn, pw)
(97, [])
 dap.search_s('ou=yp,o=company.com', ldap.SCOPE_SUBTREE,'(mail=
 testu...@us.company.com)',['emailaddress','cn'])
 
[('uid=testUser,c=us,ou=yp,o=company.com', {'emailaddress':
['testu...@us.company.com'], 'cn': ['Test User']})]
 
==
 
my auth congids are as follows:
 
==
authDB =