[web2py] Re: change in trunk needs testing

2010-11-26 Thread dederocks
I tried the last version in trunk, and the admin application generates
a ticket... and looking at the ticket generates another ticket! (which
is the reason why I cannot provide a traceback).
But the other applications appear to work fine.

On 25 nov, 17:20, mdipierro  wrote:
> Perfect! Thanks Mr Freeze.
>
> On Nov 25, 10:18 am, "mr.freeze"  wrote:
>
> > It seems to be working. I open one in IE and another in Firefox about
> > 2 seconds later. After the IE page loads, the Firefox page loads about
> > 2 seconds later. Is that what you're looking for?
>
> > On Nov 25, 10:09 am, mdipierro  wrote:
>
> > > At least we know it is being executed. :-)
> > > I think I fixed this one. Please try again.
>
> > > Massimo
>
> > > On Nov 25, 9:53 am, "mr.freeze"  wrote:
>
> > > > Traceback (most recent call last):
> > > >   File "C:\eclipse\plugins
> > > > \org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 1145,
> > > > in 
> > > >     debugger.run(setup['file'], None, None)
> > > >   File "C:\eclipse\plugins
> > > > \org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 916,
> > > > in run
> > > >     execfile(file, globals, locals) #execute the script
> > > >   File "C:\web2py\web2py.py", line 23, in 
> > > >     gluon.widget.start(cron=True)
> > > >   File "C:\web2py\gluon\widget.py", line 785, in start
> > > >     newcron.hardcron(options.folder).start()
> > > >   File "C:\web2py\gluon\newcron.py", line 50, in __init__
> > > >     crondance(self.path, 'hard', startup=True)
> > > >   File "C:\web2py\gluon\newcron.py", line 234, in crondance
> > > >     cronmaster = token.acquire(startup=startup)
> > > >   File "C:\web2py\gluon\newcron.py", line 118, in acquire
> > > >     portalocker.unlock(self.master)
> > > >   File "C:\web2py\gluon\portalocker.py", line 78, in unlock
> > > >     msvcrt.locking(file.fileno(), mode,
> > > > os.path.getsize(file.filename))
> > > > AttributeError: 'file' object has no attribute 'filename'
>
> > > > On Nov 25, 9:31 am, mdipierro  wrote:
>
> > > > > can you please try again.
>
> > > > > On Nov 24, 11:04 pm, Anthony  wrote:
>
> > > > > > Is the test supposed to be done without the win32 extensions 
> > > > > > installed
> > > > > > (I have them installed)?
>
> > > > > > Anyway, I tried the test. Before updating trunk, it behaves as you 
> > > > > > say
> > > > > > -- I opened two windows in quick succession -- the first took 10
> > > > > > seconds to load, and then the second took an additional 10 seconds 
> > > > > > to
> > > > > > load after the first one finished.
>
> > > > > > I then updated trunk, and now can't start web2py -- getting the
> > > > > > following traceback:
>
> > > > > >   Traceback (most recent call last):
> > > > > >   File "web2py.py", line 23, in  
> > > > > > gluon.widget.start(cron=True)
> > > > > >   File "C:\Users\Anthony\Programming\temp\gluon\widget.py", line 
> > > > > > 785,
> > > > > > in start newcron.hardcron(options.folder).start()
> > > > > >   File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 
> > > > > > 50,
> > > > > > in __init__ crondance(self.path, 'hard', startup=True)
> > > > > >   File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 
> > > > > > 234,
> > > > > > in crondance cronmaster = token.acquire(startup=startup)
> > > > > >   File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 
> > > > > > 118,
> > > > > > in acquire portalocker.unlock(self.master)
> > > > > >   File "C:\Users\Anthony\Programming\temp\gluon\portalocker.py", 
> > > > > > line
> > > > > > 76, in unlock file.fseek(0)
> > > > > >   AttributeError: 'file' object has no attribute 'fseek'
>
> > > > > > Anthony
>
> > > > > > On Nov 24, 11:26 pm, mdipierro  wrote:
>
> > > > > > > I made a change that on windows will provide locking without need 
> > > > > > > for
> > > > > > > MH win32 extensions.
>
> > > > > > > Can you help me test it.
>
> > > > > > > Make a log action like
>
> > > > > > > def index():
> > > > > > >       import time
> > > > > > >       time.sleep(10)
> > > > > > >       return dict()
>
> > > > > > > call it twice (on windows) from different browser windows. Will 
> > > > > > > the
> > > > > > > second window lock until the former is done? should be locked 
> > > > > > > because
> > > > > > > session is locked with file-locking.
>
> > > > > > > test before upgrade to trunk and after.
>
> > > > > > > Massimo
>
>


Re: [web2py] Re: change in trunk needs testing

2010-11-26 Thread Kenneth Lundström
If you have access to the file system you can find the error ticket in 
the folder /applications/admin/errors



Kenneth


I tried the last version in trunk, and the admin application generates
a ticket... and looking at the ticket generates another ticket! (which
is the reason why I cannot provide a traceback).
But the other applications appear to work fine.

On 25 nov, 17:20, mdipierro  wrote:

Perfect! Thanks Mr Freeze.

On Nov 25, 10:18 am, "mr.freeze"  wrote:


It seems to be working. I open one in IE and another in Firefox about
2 seconds later. After the IE page loads, the Firefox page loads about
2 seconds later. Is that what you're looking for?
On Nov 25, 10:09 am, mdipierro  wrote:

At least we know it is being executed. :-)
I think I fixed this one. Please try again.
Massimo
On Nov 25, 9:53 am, "mr.freeze"  wrote:

Traceback (most recent call last):
   File "C:\eclipse\plugins
\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 1145,
in
 debugger.run(setup['file'], None, None)
   File "C:\eclipse\plugins
\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 916,
in run
 execfile(file, globals, locals) #execute the script
   File "C:\web2py\web2py.py", line 23, in
 gluon.widget.start(cron=True)
   File "C:\web2py\gluon\widget.py", line 785, in start
 newcron.hardcron(options.folder).start()
   File "C:\web2py\gluon\newcron.py", line 50, in __init__
 crondance(self.path, 'hard', startup=True)
   File "C:\web2py\gluon\newcron.py", line 234, in crondance
 cronmaster = token.acquire(startup=startup)
   File "C:\web2py\gluon\newcron.py", line 118, in acquire
 portalocker.unlock(self.master)
   File "C:\web2py\gluon\portalocker.py", line 78, in unlock
 msvcrt.locking(file.fileno(), mode,
os.path.getsize(file.filename))
AttributeError: 'file' object has no attribute 'filename'
On Nov 25, 9:31 am, mdipierro  wrote:

can you please try again.
On Nov 24, 11:04 pm, Anthony  wrote:

Is the test supposed to be done without the win32 extensions installed
(I have them installed)?
Anyway, I tried the test. Before updating trunk, it behaves as you say
-- I opened two windows in quick succession -- the first took 10
seconds to load, and then the second took an additional 10 seconds to
load after the first one finished.
I then updated trunk, and now can't start web2py -- getting the
following traceback:
   Traceback (most recent call last):
   File "web2py.py", line 23, in  gluon.widget.start(cron=True)
   File "C:\Users\Anthony\Programming\temp\gluon\widget.py", line 785,
in start newcron.hardcron(options.folder).start()
   File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 50,
in __init__ crondance(self.path, 'hard', startup=True)
   File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 234,
in crondance cronmaster = token.acquire(startup=startup)
   File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 118,
in acquire portalocker.unlock(self.master)
   File "C:\Users\Anthony\Programming\temp\gluon\portalocker.py", line
76, in unlock file.fseek(0)
   AttributeError: 'file' object has no attribute 'fseek'
Anthony
On Nov 24, 11:26 pm, mdipierro  wrote:

I made a change that on windows will provide locking without need for
MH win32 extensions.
Can you help me test it.
Make a log action like
def index():
   import time
   time.sleep(10)
   return dict()
call it twice (on windows) from different browser windows. Will the
second window lock until the former is done? should be locked because
session is locked with file-locking.
test before upgrade to trunk and after.
Massimo






[web2py] Re: change in trunk needs testing

2010-11-26 Thread dederocks
Thank you Kenneth!

I must admit the file is difficult to analyze manually -- I'm happy to
send it as an attachement if useful.

On 26 nov, 09:21, Kenneth Lundström 
wrote:
> If you have access to the file system you can find the error ticket in
> the folder /applications/admin/errors
>
> Kenneth
>
> > I tried the last version in trunk, and the admin application generates
> > a ticket... and looking at the ticket generates another ticket! (which
> > is the reason why I cannot provide a traceback).
> > But the other applications appear to work fine.
>
> > On 25 nov, 17:20, mdipierro  wrote:
> >> Perfect! Thanks Mr Freeze.
>
> >> On Nov 25, 10:18 am, "mr.freeze"  wrote:
>
> >>> It seems to be working. I open one in IE and another in Firefox about
> >>> 2 seconds later. After the IE page loads, the Firefox page loads about
> >>> 2 seconds later. Is that what you're looking for?
> >>> On Nov 25, 10:09 am, mdipierro  wrote:
>  At least we know it is being executed. :-)
>  I think I fixed this one. Please try again.
>  Massimo
>  On Nov 25, 9:53 am, "mr.freeze"  wrote:
> > Traceback (most recent call last):
> >    File "C:\eclipse\plugins
> > \org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 1145,
> > in
> >      debugger.run(setup['file'], None, None)
> >    File "C:\eclipse\plugins
> > \org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 916,
> > in run
> >      execfile(file, globals, locals) #execute the script
> >    File "C:\web2py\web2py.py", line 23, in
> >      gluon.widget.start(cron=True)
> >    File "C:\web2py\gluon\widget.py", line 785, in start
> >      newcron.hardcron(options.folder).start()
> >    File "C:\web2py\gluon\newcron.py", line 50, in __init__
> >      crondance(self.path, 'hard', startup=True)
> >    File "C:\web2py\gluon\newcron.py", line 234, in crondance
> >      cronmaster = token.acquire(startup=startup)
> >    File "C:\web2py\gluon\newcron.py", line 118, in acquire
> >      portalocker.unlock(self.master)
> >    File "C:\web2py\gluon\portalocker.py", line 78, in unlock
> >      msvcrt.locking(file.fileno(), mode,
> > os.path.getsize(file.filename))
> > AttributeError: 'file' object has no attribute 'filename'
> > On Nov 25, 9:31 am, mdipierro  wrote:
> >> can you please try again.
> >> On Nov 24, 11:04 pm, Anthony  wrote:
> >>> Is the test supposed to be done without the win32 extensions installed
> >>> (I have them installed)?
> >>> Anyway, I tried the test. Before updating trunk, it behaves as you say
> >>> -- I opened two windows in quick succession -- the first took 10
> >>> seconds to load, and then the second took an additional 10 seconds to
> >>> load after the first one finished.
> >>> I then updated trunk, and now can't start web2py -- getting the
> >>> following traceback:
> >>>    Traceback (most recent call last):
> >>>    File "web2py.py", line 23, in  
> >>> gluon.widget.start(cron=True)
> >>>    File "C:\Users\Anthony\Programming\temp\gluon\widget.py", line 785,
> >>> in start newcron.hardcron(options.folder).start()
> >>>    File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 50,
> >>> in __init__ crondance(self.path, 'hard', startup=True)
> >>>    File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 
> >>> 234,
> >>> in crondance cronmaster = token.acquire(startup=startup)
> >>>    File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 
> >>> 118,
> >>> in acquire portalocker.unlock(self.master)
> >>>    File "C:\Users\Anthony\Programming\temp\gluon\portalocker.py", line
> >>> 76, in unlock file.fseek(0)
> >>>    AttributeError: 'file' object has no attribute 'fseek'
> >>> Anthony
> >>> On Nov 24, 11:26 pm, mdipierro  wrote:
>  I made a change that on windows will provide locking without need for
>  MH win32 extensions.
>  Can you help me test it.
>  Make a log action like
>  def index():
>         import time
>         time.sleep(10)
>         return dict()
>  call it twice (on windows) from different browser windows. Will the
>  second window lock until the former is done? should be locked because
>  session is locked with file-locking.
>  test before upgrade to trunk and after.
>  Massimo
>
>


Re: [web2py] Re: change in trunk needs testing

2010-11-26 Thread Kenneth Lundström

Please send it, it´s the only way to find out what the problem is.


Kenneth



Thank you Kenneth!

I must admit the file is difficult to analyze manually -- I'm happy to
send it as an attachement if useful.

On 26 nov, 09:21, Kenneth Lundström
wrote:

If you have access to the file system you can find the error ticket in
the folder /applications/admin/errors

Kenneth


I tried the last version in trunk, and the admin application generates
a ticket... and looking at the ticket generates another ticket! (which
is the reason why I cannot provide a traceback).
But the other applications appear to work fine.
On 25 nov, 17:20, mdipierrowrote:

Perfect! Thanks Mr Freeze.
On Nov 25, 10:18 am, "mr.freeze"wrote:

It seems to be working. I open one in IE and another in Firefox about
2 seconds later. After the IE page loads, the Firefox page loads about
2 seconds later. Is that what you're looking for?
On Nov 25, 10:09 am, mdipierrowrote:

At least we know it is being executed. :-)
I think I fixed this one. Please try again.
Massimo
On Nov 25, 9:53 am, "mr.freeze"wrote:

Traceback (most recent call last):
File "C:\eclipse\plugins
\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 1145,
in
  debugger.run(setup['file'], None, None)
File "C:\eclipse\plugins
\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 916,
in run
  execfile(file, globals, locals) #execute the script
File "C:\web2py\web2py.py", line 23, in
  gluon.widget.start(cron=True)
File "C:\web2py\gluon\widget.py", line 785, in start
  newcron.hardcron(options.folder).start()
File "C:\web2py\gluon\newcron.py", line 50, in __init__
  crondance(self.path, 'hard', startup=True)
File "C:\web2py\gluon\newcron.py", line 234, in crondance
  cronmaster = token.acquire(startup=startup)
File "C:\web2py\gluon\newcron.py", line 118, in acquire
  portalocker.unlock(self.master)
File "C:\web2py\gluon\portalocker.py", line 78, in unlock
  msvcrt.locking(file.fileno(), mode,
os.path.getsize(file.filename))
AttributeError: 'file' object has no attribute 'filename'
On Nov 25, 9:31 am, mdipierrowrote:

can you please try again.
On Nov 24, 11:04 pm, Anthonywrote:

Is the test supposed to be done without the win32 extensions installed
(I have them installed)?
Anyway, I tried the test. Before updating trunk, it behaves as you say
-- I opened two windows in quick succession -- the first took 10
seconds to load, and then the second took an additional 10 seconds to
load after the first one finished.
I then updated trunk, and now can't start web2py -- getting the
following traceback:
Traceback (most recent call last):
File "web2py.py", line 23, ingluon.widget.start(cron=True)
File "C:\Users\Anthony\Programming\temp\gluon\widget.py", line 785,
in start newcron.hardcron(options.folder).start()
File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 50,
in __init__ crondance(self.path, 'hard', startup=True)
File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 234,
in crondance cronmaster = token.acquire(startup=startup)
File "C:\Users\Anthony\Programming\temp\gluon\newcron.py", line 118,
in acquire portalocker.unlock(self.master)
File "C:\Users\Anthony\Programming\temp\gluon\portalocker.py", line
76, in unlock file.fseek(0)
AttributeError: 'file' object has no attribute 'fseek'
Anthony
On Nov 24, 11:26 pm, mdipierrowrote:

I made a change that on windows will provide locking without need for
MH win32 extensions.
Can you help me test it.
Make a log action like
def index():
import time
time.sleep(10)
return dict()
call it twice (on windows) from different browser windows. Will the
second window lock until the former is done? should be locked because
session is locked with file-locking.
test before upgrade to trunk and after.
Massimo






[web2py] Re: change in trunk needs testing

2010-11-26 Thread dederocks
Fine, here you go (sorry, don't know how to attach files on google
groups):

-
(dp1
S'output'
p2
S''
sS'layer'
p3
S'C:\\Users\\Andre\\Documents\\web2py\\applications\\admin/views\
\default/index.html'
p4
sS'code'
p5
S'response.write(\'\\nhttp://www.w3.org/
1999/xhtml" xml:lang="en" lang="en">\\n\\n\\n\\t\\n\', escape=False)
\nresponse.write(response.title or URL())\nresponse.write(\'\
\n\', escape=False)\nresponse.files.append(URL(\'static\',
\'css/styles.css\'))\nresponse.write(\'\\n\', escape=False)
\nresponse.files.insert(0,URL(\'static\',\'js/jquery.js\'))
\nresponse.files.insert(1,URL(\'static\',\'css/calendar.css\'))
\nresponse.files.insert(2,URL(\'static\',\'js/calendar.js\'))\nfor
_item in response.meta or []:\nresponse.write(\'\\n \',
escape=False)\npass\nfor _k,_file in enumerate(response.files or
[]):\nif _file in response.files[:_k]:\ncontinue\n
_file0=_file.lower().split(\'?\')[0]\nif _file0.endswith(\'.css\'):
\nresponse.write(\'\\n \', escape=False)\nelif
_file0.endswith(\'.js\'):\nresponse.write(\'\\n \', escape=False)
\npass\npass\nresponse.write(\'\\n  \\n   FP Numeracy: Classroom visit form Grade 3 (FPN0303)
>
> 22c22
> <     {{label=db((db.label.fieldname==veld) &
> (db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> --->     {{label=db((db.label.fieldname==veld) &
>
> (db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> 66c66
> <     {{label=db((db.label.fieldname==veld) &
> (db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> --->     {{label=db((db.label.fieldname==veld) &
>
> (db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> 103c103
> <     {{label=db((db.label.fieldname==veld) &
> (db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> --->     {{label=db((db.label.fieldname==veld) &
>
> (db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> 140c140
> <     {{label=db((db.label.fieldname==veld) &
> (db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> --->     {{label=db((db.label.fieldname==veld) &
>
> (db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> 176c176
> <     {{label=db((db.label.fieldname==veld) &
> (db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> --->     {{label=db((db.label.fieldname==veld) &
>
> (db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> 211c211
> <     {{label=db((db.label.fieldname==veld) &
> (db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> --->     {{label=db((db.label.fieldname==veld) &
>
> (db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> 250c250
> <     {{label=db((db.label.fieldname==veld[i]) &
> (db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> --->     {{label=db((db.label.fieldname==veld[i]) &
>
> (db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> 289c289
> < {{for veld in [ 'q4_timea', 'q4_timeb', 'q4_timec',
> 'q4_timed','q4_timee','q4_timef','q4_timeg','q4_timeh','q4_timei']:}}
> ---> {{for veld in [ 'q4_timea', 'q4_timeb', 'q4_timec',
>
> 'q4_timed','q4_timee','q4_timef','q4_timeg','q4_timeh']:}}
> 294c294
> <     {{label=db((db.label.fieldname==veld) &
> (db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> --->     {{label=db((db.label.fieldname==veld) &
>
> (db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> 316c316
> <     {{label=db((db.label.fieldname==veld) &
> (db.label.form_id.lower()=='fpn0302')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> --->     {{label=db((db.label.fieldname==veld) &
>
> (db.label.form_id.lower()=='fpn0303')).select(db.label.fieldlabel)[0].fieldlabel}}{{=label}}
> 332c332
> < {{for veld in [  'q4_capacitya', 'q4_capacityb', 'q4_capacityc']:}}
> ---> {{for veld in [  'q4_capacitya', 'q4_capacityb', 'q4_capacityc',
>
> 'q4_capacityd']:

[web2py] Re: Recipe about mixing web2py, pydev, GoogleCode and others

2010-11-26 Thread mr.freeze
I would make sure the breakpoint is not contingent on any logic. Set
one in your model, for example, when auth or mail are instantiated.
Also, make sure you are launching your project in debug mode and not
run mode.

On Nov 26, 10:23 am, Lorin Rivers  wrote:
> I'm all set up, but I can't debug in Eclipse. I put a breakpoint in my code 
> and go to the page that should execute it and it doesn't break.
>
> Got any ideas?
>
> On Nov 17, 2010, at 20:17 , pierreth wrote:
>
> > Hello,
>
> > I just published a blog about mixing all this stuff in Eclipse for
> > web2py development:
>
> > # GC issue tracking with Mylyn;
> > # GC versioning using Mercurial and the MercurialEclipse plug-in;
> > # Pydev with code completion and code checking;
> > # Aptana Studio plug-in for Eclipse for the edition of HTML and CSS
> > files.
>
> >http://pierreth.blogspot.com/2010/10/web2py-eclipse-pydev-recipe.html
>
> > I hope you like. Comments are appreciated.
>
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing 
> 
> 512/203.3198 (m)


Re: [web2py] Re: Debugging my app

2010-11-26 Thread Lorin Rivers
So you just click (or whatever the gesture is) to the side of the line you want 
to break at and it just works?

To start a session, you right-click on web2py and start a debug session?

What platform are you on?

On Nov 26, 2010, at 10:32 , mr.freeze wrote:

> I use PyDev and Eclipse. It works like a champ. I can set breakpoints,
> inspect variables, create expressions at runtime. Very handy, not to
> mention that the mercurial eclipse plugin makes it very easy to
> update.
> 
> On Nov 26, 10:25 am, Lorin Rivers  wrote:
>> Getting pretty sick of using 'print' to debug.
>> 
>> I tried pydbgr, but that didn't seem to work (crashed python).
>> 
>> What other tools should I look at that will let me step through my web2py 
>> code?
>> --
>> Lorin Rivers
>> Mosasaur: Killer Technical Marketing 
>> 
>> 512/203.3198 (m)

-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




[web2py] Re: Foreign Key

2010-11-26 Thread mdipierro
Will tink about 1.

about 2. You can do

db.define_table(...,Field('name','reference
blabla',ondelete='cascade'))

cascade is default.

On Nov 26, 8:39 am, Mirek Zvolský  wrote:
> >> Could you elaborate on what you'd expect from
> >> join expressions aren't automatically created based on the DAL definition
>
> 1) - answer to your question
> 2) - idea to deleting integrity - I think this could be very useful
> and easy to add to web2py core
>
> 1)
>
> SQL language is very clever, but I always wondered, why millions of
> developer always thousand times have to write:
> JOIN dog ON dog.person_id=person.id
> or in web2y:
> db(db.dog.person_id==person.id)
> if they want records from both tables. Because this "connecting"
> expression is already known from the database definition (from
> definition of foreign keys).
>
> So, it would be nice, if we have tool, which can create such
> expressions automatically, when we ask for fields/records from linked
> tables.
>
> I don't know, if this idea is implemented somewhere in Java,
> Microsofts, python,.. utilities.
> I have implemented it partially in Visual FoxPro, where my ideas were
> following:
>
> Each SQL command has its "basic" table (in FROM..) and "linked" tables
> (in JOINs). Inside linked tables one table from database can however
> occur more times (we need more than one table alias for table), from 2
> reasons:
> -- table can have 2 or more foreign keys pointing to same table,
> -- through more joins we can come back to an already used table /I
> know you don't believe this much :-)/
> So, I decided to find possibility, how I can name all possible table
> aliases in automatic way. I had a metadata table of all joins in
> database, so there were primary keys join.id
> I created table aliases like: dog ("basic" table), dog_15 ("linked"
> table person", join.id==15 was primary key of the foreign key
> dogs.preson_id in metadata).
> That way I can created all possible table aliases, and the name isn't
> very long, f.e. dog_15_4_8 is shorter as
> dog__dog_person_id__person_city_id__city_country_id
> From metadata table I can then take all what I need to automatically
> create join expressions:  table1.foreignkey==table2.primarykey
> So I can create query designers, where user can choose everything in
> database (every field in every table) - he can always choose from
> fields in current table + from joins outgoing from current table (list
> of joins I can get easy, when I select records (means joins) from
> metadata table WHERE table=currenttable). And whatever user will
> choose, SQL SELECT will be created automaticaly to receive required
> data.
>
> But I stopped this work in Visual FoxPro and switched to web2py. I
> would like to continue sometimes later with this in web2py, to create
> a plugin for this. Maybe after 6 months, but now I'm new in python and
> web2py to do such work. Or maybe somebody here can try go in this way,
> if he is interested...
>
> If in web2py, maybe there is not necessary to use metadata table of
> joins.
> Maybe this can be implemented as properties of foreign key, f.e.:
> db.dog.person_id.joinname='15'   # just a symbol to create aliases;
> target table we know from 'reference..' field type, target key is
> always primary key .id
>
> 2)
>
> Similar it would be nice to implement the deleting integrity at the
> application level:
> db.dog.person_id.ondelete='setnull'   # 'setnull' (default?),
> 'cascade', 'restrict' - says what to do when person (dog owner) is to
> be deleted


[web2py] Re: Problem starting server web2py

2010-11-26 Thread mdipierro
Try install web2py nightly built from he download page. It should not
have this dependency any more.

On Nov 26, 7:48 am, Marcos Vinhal  wrote:
> Which file do I install?
>
> 2010/11/26 Bruno Rocha 
>
>
>
> > Did you installed Mark Hammond win32 extension?
>
> > 2010/11/26 Marcos Vinhal 
>
> > when I starting server web2py show this "web2py:unable to import Rocket".
>
> >> can help me.
>
> >> 2010/11/24 mdipierro 
>
> >>> How are you starting web2py?
>
> >>> On Nov 24, 5:47 pm, Marcos Vinhal  wrote:
> >>> > Every time I try to start the server web2py shows the message below:
>
> >>> > ---
> >>> > web2py start server
> >>> > ---
> >>> > global name 'rocket' is not defined
> >>> > ---
> >>> > OK
> >>> > ---
>
> >>> > Please help me if possible ...
>
> >>> > Thanks ...
>
> >> --
> >> Att,
>
> >> Marcos A. Vinhal
>
> > --
>
> > Bruno Rocha
> >http://about.me/rochacbruno/bio
>
> --
> Att,
>
> Marcos A. Vinhal


Re: [web2py] Best webframeworks

2010-11-26 Thread Branko Vukelic
On Fri, Nov 26, 2010 at 3:21 PM, Bruno Rocha  wrote:
> web2py is listed http://www.bestwebframeworks.com/python/
> but the download link is broken :(

Logo is old too.

But damn. The list is wrong in so many ways.

-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: Broken web2py Layout on IE6

2010-11-26 Thread mdipierro
Thanks for reporting this. We'll see if we can fix it.

On Nov 26, 8:56 am, Alexandre Augusto  wrote:
> New web2py layout renders all broken on IE6, as most of you I'm also
> big fan of Firefox and it looks great on Firefox.  Although not all of
> ours customers think the same way..  I looked over a post about this
> and could only find issues related to older versions of web2py not
> displaying correctly on IE6 (it still looks funny)
>
> So basically I just wanted to document that behavior in here.. below
> there are two screenshots on how the admin renders on IE6
>
> http://imgur.com/Qn8rt.jpg
>
> http://imgur.com/BFIlG.jpg
>
> There are many people around the globe making their protest about 
> IE6http://www.ie6nomore.com/http://ie6update.com/http://www.shlomifish.org/no-ie/
>
> Although I ask myself, if web2py should also enforce people to not use
> IE6 or it should
> have an administrative interface that works cross-browsers
>
> Peter-Paul Koch from quirksmode has a Compatibility Master Table list
> that can be seen in herehttp://www.quirksmode.org/compatibility.html
>
> I believe this does not happen with IE7 and IE8.. not sure I don't
> have them to test in here.
> My company police doesn't recommend us to upgrade IE6, I think because
> couple of  legacy web applications  only work correctly on IE6


[web2py] Re: documentation flow

2010-11-26 Thread mdipierro
The book has been published in HTML for long time

http://web2py.com/book

It is the same as the published book (350 pages).
There is search feature with text highlighting.
All features discussed in the book are current.

Massimo

On Nov 26, 9:54 am, oncle_bob  wrote:
> Hello,
>
> I like web2py product but I don't recommend it. The documentation and
> features flow is too spreaded and too speeded. Why don't you publish
> the book and documentation in html files, it's easier to check
> features and API point. The book reading is not fun to read and search
> anything. If I don't read the group, I miss a lot of. Developper can't
> spend all time to read group ;) every day.
>
> Thank you.
>
> J.H


[web2py] Re: Debugging my app

2010-11-26 Thread mr.freeze
I use both Ubuntu 10.10 and Windows 7.  The first time, you right
click web2py.py in the file tree and choose Debug As / Python Run. If
Python Run is not available, you need to verify your interpreter
setup.

On Nov 26, 10:37 am, Lorin Rivers  wrote:
> So you just click (or whatever the gesture is) to the side of the line you 
> want to break at and it just works?
>
> To start a session, you right-click on web2py and start a debug session?
>
> What platform are you on?
>
> On Nov 26, 2010, at 10:32 , mr.freeze wrote:
>
>
>
> > I use PyDev and Eclipse. It works like a champ. I can set breakpoints,
> > inspect variables, create expressions at runtime. Very handy, not to
> > mention that the mercurial eclipse plugin makes it very easy to
> > update.
>
> > On Nov 26, 10:25 am, Lorin Rivers  wrote:
> >> Getting pretty sick of using 'print' to debug.
>
> >> I tried pydbgr, but that didn't seem to work (crashed python).
>
> >> What other tools should I look at that will let me step through my web2py 
> >> code?
> >> --
> >> Lorin Rivers
> >> Mosasaur: Killer Technical Marketing 
> >> 
> >> 512/203.3198 (m)
>
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing 
> 
> 512/203.3198 (m)


Re: [web2py] Re: one more security feature in trunk

2010-11-26 Thread Jonathan Lundell
On Nov 26, 2010, at 8:33 AM, mdipierro wrote:
> 
> It is not optional

"now optional"?

> 
> session.connect(request,response,check_client=True) to enable the
> check.
> 
> On Nov 26, 3:53 am, selecta  wrote:
>> still it would be nice to have this optional
>> 
>> On Nov 26, 5:06 am, mdipierro  wrote:
>> 
>>> True. This is a counterindication.
>> 
>>> On Nov 25, 7:14 pm, Phyo Arkar  wrote:
>> 
 Most of them time i use a Remote VPN to change my IP and to access
 Unrestricted Internet.
 Coz internet here is very restrictive, (so restrictive that even google
 Blogger is banned lol) .
>> 
 And only about 5 outgoing ips thats goes out of this country.
>> 
 VPN sometimes loose connection and drops me back to original IP.
>> 
 So if i using web2py remotely , logging in and if connection of VPN drops
 and i do not know it goes back to normal ip. I will kicked out of the
 Session.
>> 
 Hmm?
>> 
 On Fri, Nov 26, 2010 at 4:44 AM, Kuba Kucharski 
 wrote:
>> 
> @michele
>> 
> yeap, IP-based security sucks.
>> 
>> 




[web2py] Re: one more security feature in trunk

2010-11-26 Thread mdipierro
ERRATA (thanks jonathan)

It is NOW optional

session.connect(request,response,check_client=True) to enable the
check.

On Nov 26, 10:58 am, Jonathan Lundell  wrote:
> On Nov 26, 2010, at 8:33 AM, mdipierro wrote:
>
>
>
> > It is not optional
>
> "now optional"?
>
>
>
> > session.connect(request,response,check_client=True) to enable the
> > check.
>
> > On Nov 26, 3:53 am, selecta  wrote:
> >> still it would be nice to have this optional
>
> >> On Nov 26, 5:06 am, mdipierro  wrote:
>
> >>> True. This is a counterindication.
>
> >>> On Nov 25, 7:14 pm, Phyo Arkar  wrote:
>
>  Most of them time i use a Remote VPN to change my IP and to access
>  Unrestricted Internet.
>  Coz internet here is very restrictive, (so restrictive that even google
>  Blogger is banned lol) .
>
>  And only about 5 outgoing ips thats goes out of this country.
>
>  VPN sometimes loose connection and drops me back to original IP.
>
>  So if i using web2py remotely , logging in and if connection of VPN drops
>  and i do not know it goes back to normal ip. I will kicked out of the
>  Session.
>
>  Hmm?
>
>  On Fri, Nov 26, 2010 at 4:44 AM, Kuba Kucharski 
>  wrote:
>
> > @michele
>
> > yeap, IP-based security sucks.
>
>


Re: [web2py] Re: Debugging my app

2010-11-26 Thread Lorin Rivers
I have python run, my web2py app is running, I can load it in the web browser 
in eclipse, the breakpoints are showing in the list of breakpoints and in the 
editor, my print statements are showing in the console, but it's NOT breaking.

Also, if I edit a file in an external editor, the changes don't appear in 
Eclipse. What's up with that?

On Nov 26, 2010, at 10:45 , mr.freeze wrote:

> I use both Ubuntu 10.10 and Windows 7.  The first time, you right
> click web2py.py in the file tree and choose Debug As / Python Run. If
> Python Run is not available, you need to verify your interpreter
> setup.
> 
> On Nov 26, 10:37 am, Lorin Rivers  wrote:
>> So you just click (or whatever the gesture is) to the side of the line you 
>> want to break at and it just works?
>> 
>> To start a session, you right-click on web2py and start a debug session?
>> 
>> What platform are you on?
>> 
>> On Nov 26, 2010, at 10:32 , mr.freeze wrote:
>> 
>> 
>> 
>>> I use PyDev and Eclipse. It works like a champ. I can set breakpoints,
>>> inspect variables, create expressions at runtime. Very handy, not to
>>> mention that the mercurial eclipse plugin makes it very easy to
>>> update.
>> 
>>> On Nov 26, 10:25 am, Lorin Rivers  wrote:
 Getting pretty sick of using 'print' to debug.
>> 
 I tried pydbgr, but that didn't seem to work (crashed python).
>> 
 What other tools should I look at that will let me step through my web2py 
 code?
 --
 Lorin Rivers
 Mosasaur: Killer Technical Marketing 
 
 512/203.3198 (m)
>> 
>> --
>> Lorin Rivers
>> Mosasaur: Killer Technical Marketing 
>> 
>> 512/203.3198 (m)

-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




[web2py] onvalidation only called if there are no form errors

2010-11-26 Thread mr.freeze
I see two issues with this:
1) The form errors found in onvalidation will not be displayed if
there are already form errors
2) The developer never gets a chance to remove form errors for certain
conditions (think contingent form fields)
For example, I am using IS_IN_DB on a field but I only want it to be
required if another field is a certain value.

Is there a better way?


[web2py] Re: Debugging my app

2010-11-26 Thread mr.freeze
You have to right click on your project and choose Refresh to reflect
external changes.  Do you see a green dot next to your breakpoint?
Double click in the gray border to the left of the code and it should
show a green dot.

On Nov 26, 11:09 am, Lorin Rivers  wrote:
> I have python run, my web2py app is running, I can load it in the web browser 
> in eclipse, the breakpoints are showing in the list of breakpoints and in the 
> editor, my print statements are showing in the console, but it's NOT breaking.
>
> Also, if I edit a file in an external editor, the changes don't appear in 
> Eclipse. What's up with that?
>
> On Nov 26, 2010, at 10:45 , mr.freeze wrote:
>
>
>
> > I use both Ubuntu 10.10 and Windows 7.  The first time, you right
> > click web2py.py in the file tree and choose Debug As / Python Run. If
> > Python Run is not available, you need to verify your interpreter
> > setup.
>
> > On Nov 26, 10:37 am, Lorin Rivers  wrote:
> >> So you just click (or whatever the gesture is) to the side of the line you 
> >> want to break at and it just works?
>
> >> To start a session, you right-click on web2py and start a debug session?
>
> >> What platform are you on?
>
> >> On Nov 26, 2010, at 10:32 , mr.freeze wrote:
>
> >>> I use PyDev and Eclipse. It works like a champ. I can set breakpoints,
> >>> inspect variables, create expressions at runtime. Very handy, not to
> >>> mention that the mercurial eclipse plugin makes it very easy to
> >>> update.
>
> >>> On Nov 26, 10:25 am, Lorin Rivers  wrote:
>  Getting pretty sick of using 'print' to debug.
>
>  I tried pydbgr, but that didn't seem to work (crashed python).
>
>  What other tools should I look at that will let me step through my 
>  web2py code?
>  --
>  Lorin Rivers
>  Mosasaur: Killer Technical Marketing 
>  
>  512/203.3198 (m)
>
> >> --
> >> Lorin Rivers
> >> Mosasaur: Killer Technical Marketing 
> >> 
> >> 512/203.3198 (m)
>
> --
> Lorin Rivers
> Mosasaur: Killer Technical Marketing 
> 
> 512/203.3198 (m)


Re: [web2py] Best webframeworks

2010-11-26 Thread Kuba Kucharski
> But damn. The list is wrong in so many ways.
+1


[web2py] Re: T with variables

2010-11-26 Thread Carlos
Hi Massimo,

I believe the T.set_current_languages you propose refers to viewing
the website in a specific language for a certain user.

What I'm asking for is a way to edit the language files (as regular
web apps, not appadmin) with authorization, e.g. userA can only edit
'en' language, userB can only edit 'es' language, and so on.

Such that we can assign the "translator" role to users for specific
languages.

Thanks,

   Carlos


On Nov 25, 9:58 pm, mdipierro  wrote:
> yes. Make a custom auth_user table with an extra 'language' field and
> then do
>
> if auth.user: T.set_current_language(auth.user.language)
>
> On Nov 25, 12:06 pm, Carlos  wrote:
>
>
>
>
>
>
>
> > Thanks Massimo.
>
> > Btw is it possible to update the language files via web apps with
> > authorization (e.g. userA can only update english, userB only spanish,
> > and so on)?.
>
> >    Carlos
>
> > On Nov 25, 11:33 am, mdipierro  wrote:
>
> > > This is a good idea. All you need to do is:
>
> > > T.current_languages=[]
>
> > > in this way even english will require translation.
>
> > > Massimo
>
> > > On Nov 25, 11:30 am, Carlos  wrote:
>
> > > > Hi,
>
> > > > Please let me know if the following makes sense:
>
> > > > I want to implement internationalization using always keys (codes) for
> > > > all T() occurrences, instead of using strings corresponding to one
> > > > specific default language.
>
> > > > I believe this is necessary (please correct me if I'm wrong) in the
> > > > following scenario: if I use 'en' as the default language and I wan to
> > > > use T('please enter your info'), then I can translate this string to
> > > > all other languages, BUT what would happen if I need to change the
> > > > translated string in english (e.g. from "please enter your info" to
> > > > "please type your info")?, then all other languages for that specific
> > > > translation will be gone (out or sync), correct?.
>
> > > > If we use keys/codes (instead of a default language), and require to
> > > > translate ALL languages (including 'en'), then I could make this
> > > > change without affecting all other languages, right?.
>
> > > > Do you see any problems with this approach?, do you have any
> > > > recommendations?.
>
> > > > Thanks,
>
> > > >    Carlos
>
> > > > On Nov 25, 10:36 am, mdipierro  wrote:
>
> > > > > Not for T(variable) since variable is only defined at runtime.
>
> > > > > On Nov 25, 10:24 am, Carlos  wrote:
>
> > > > > > Hi Massimo,
>
> > > > > > Thanks, it now works ok with T.force.
>
> > > > > > Is there a way to automatically update multiple language files at 
> > > > > > once
> > > > > > with all these lazy T's?.
>
> > > > > >    Carlos
>
> > > > > > On Nov 25, 10:00 am, mdipierro  wrote:
>
> > > > > > > Update all languages will not catch this because this can only be
> > > > > > > caught at run-time. The string should be added in the language 
> > > > > > > file
> > > > > > > when you run the action (and the browser set to the language 
> > > > > > > needing
> > > > > > > translation).
>
> > > > > > > try again, check the language file timestamp. If the file is not 
> > > > > > > being
> > > > > > > updated, may be a permission issue.
>
> > > > > > > On Nov 25, 9:48 am, Carlos  wrote:
>
> > > > > > > > Hi,
>
> > > > > > > > I am trying to make internationalization work with variables, 
> > > > > > > > in my
> > > > > > > > local environment on Win7, with web2py 1.89.1.
>
> > > > > > > > For reference I have the following test controller:
>
> > > > > > > > def xyz():
> > > > > > > >     x = 'xyz'
> > > > > > > >     return T(x)
>
> > > > > > > > But after calling that method, when I look at any of the 
> > > > > > > > language
> > > > > > > > files, the string 'xyz' is not there, even after executing 
> > > > > > > > "update all
> > > > > > > > languages".
>
> > > > > > > > Am I doing anything wrong?.
>
> > > > > > > > Thanks,
>
> > > > > > > >    Carlos


[web2py] Re: onvalidation only called if there are no form errors

2010-11-26 Thread mdipierro
What would you suggest?

On Nov 26, 11:10 am, "mr.freeze"  wrote:
> I see two issues with this:
> 1) The form errors found in onvalidation will not be displayed if
> there are already form errors
> 2) The developer never gets a chance to remove form errors for certain
> conditions (think contingent form fields)
> For example, I am using IS_IN_DB on a field but I only want it to be
> required if another field is a certain value.
>
> Is there a better way?


[web2py] Re: Best webframeworks

2010-11-26 Thread mdipierro
that site is useless. It does not provide any useful information on
any of the frameworks.

On Nov 26, 11:14 am, Kuba Kucharski  wrote:
> > But damn. The list is wrong in so many ways.
>
> +1


[web2py] Re: library of images and videos

2010-11-26 Thread Carlos
Hi all,

Thanks for your responses.

Can anybody also please comment on the other questions I ask in my
original message?.

Many thanks!,

   Carlos


On Nov 25, 8:19 pm, Bruno Rocha  wrote:
> No, PIL just deals with image files.
>
> 2010/11/26 Phyo Arkar 
>
>
>
>
>
>
>
>
>
> > Does it work for many kind of video files like ffmpeg?
>
> > On Fri, Nov 26, 2010 at 8:34 AM, Bruno Rocha wrote:
>
> >> Make thumbs with PIL
> >>http://www.web2pyslices.com/main/slices/take_slice/62
>
> >> (I did not test yet, I am going to do that tomorrow)
>
> >> 2010/11/25 Carlos 
>
> >> Hi,
>
> >>> For my project, I will need to create a library of images and videos.
>
> >>> What considerations should I have?.
>
> >>> For reference ...
>
> >>> How to automatically create a thumbnail for every image?.
>
> >>> Is there support for image/video galleries or albums?.
>
> >>> With respect to videos, should I let users upload videos to the site
> >>> or require them to upload to youtube and then just link them?.
>
> >>> If the users upload videos to the site, is there a mechanism similar
> >>> to how web2py processes images (change file names, provide the
> >>> download link, and such)?.
>
> >>> What are the pros (in addition to security?) and cons (less
> >>> flexibility?) of using web2py's built-in image field type instead of
> >>> simply ftp upload to a folder and reference by file name?.
>
> >>> Any other things I should prepare for to properly handle a library of
> >>> images and videos?.
>
> >>> Your advice is greatly appreciated - thanks!,
>
> >>>   Carlos
>
> >> --
>
> >> Bruno Rocha
> >>http://about.me/rochacbruno/bio
>
> --
>
> Bruno Rochahttp://about.me/rochacbruno/bio


[web2py] Re: T with variables

2010-11-26 Thread mdipierro
I see. There is this very old app:
http://web2py.com/appliances/default/show/9

that allows users permissions only to translate.

It should be revamped and:
1) change the edit language page to the new one
2) integrate with auth
3) allow administrator to assign languages to auth_users

It is a 1h job to a skilled web2py programmer. It would be nice to
have this functionality.
It is in my queue but my todo queue is long today so I will take help
with this one.

adopt this appliance!

massimo


On Nov 26, 11:27 am, Carlos  wrote:
> Hi Massimo,
>
> I believe the T.set_current_languages you propose refers to viewing
> the website in a specific language for a certain user.
>
> What I'm asking for is a way to edit the language files (as regular
> web apps, not appadmin) with authorization, e.g. userA can only edit
> 'en' language, userB can only edit 'es' language, and so on.
>
> Such that we can assign the "translator" role to users for specific
> languages.
>
> Thanks,
>
>    Carlos
>
> On Nov 25, 9:58 pm, mdipierro  wrote:
>
> > yes. Make a custom auth_user table with an extra 'language' field and
> > then do
>
> > if auth.user: T.set_current_language(auth.user.language)
>
> > On Nov 25, 12:06 pm, Carlos  wrote:
>
> > > Thanks Massimo.
>
> > > Btw is it possible to update the language files via web apps with
> > > authorization (e.g. userA can only update english, userB only spanish,
> > > and so on)?.
>
> > >    Carlos
>
> > > On Nov 25, 11:33 am, mdipierro  wrote:
>
> > > > This is a good idea. All you need to do is:
>
> > > > T.current_languages=[]
>
> > > > in this way even english will require translation.
>
> > > > Massimo
>
> > > > On Nov 25, 11:30 am, Carlos  wrote:
>
> > > > > Hi,
>
> > > > > Please let me know if the following makes sense:
>
> > > > > I want to implement internationalization using always keys (codes) for
> > > > > all T() occurrences, instead of using strings corresponding to one
> > > > > specific default language.
>
> > > > > I believe this is necessary (please correct me if I'm wrong) in the
> > > > > following scenario: if I use 'en' as the default language and I wan to
> > > > > use T('please enter your info'), then I can translate this string to
> > > > > all other languages, BUT what would happen if I need to change the
> > > > > translated string in english (e.g. from "please enter your info" to
> > > > > "please type your info")?, then all other languages for that specific
> > > > > translation will be gone (out or sync), correct?.
>
> > > > > If we use keys/codes (instead of a default language), and require to
> > > > > translate ALL languages (including 'en'), then I could make this
> > > > > change without affecting all other languages, right?.
>
> > > > > Do you see any problems with this approach?, do you have any
> > > > > recommendations?.
>
> > > > > Thanks,
>
> > > > >    Carlos
>
> > > > > On Nov 25, 10:36 am, mdipierro  wrote:
>
> > > > > > Not for T(variable) since variable is only defined at runtime.
>
> > > > > > On Nov 25, 10:24 am, Carlos  wrote:
>
> > > > > > > Hi Massimo,
>
> > > > > > > Thanks, it now works ok with T.force.
>
> > > > > > > Is there a way to automatically update multiple language files at 
> > > > > > > once
> > > > > > > with all these lazy T's?.
>
> > > > > > >    Carlos
>
> > > > > > > On Nov 25, 10:00 am, mdipierro  wrote:
>
> > > > > > > > Update all languages will not catch this because this can only 
> > > > > > > > be
> > > > > > > > caught at run-time. The string should be added in the language 
> > > > > > > > file
> > > > > > > > when you run the action (and the browser set to the language 
> > > > > > > > needing
> > > > > > > > translation).
>
> > > > > > > > try again, check the language file timestamp. If the file is 
> > > > > > > > not being
> > > > > > > > updated, may be a permission issue.
>
> > > > > > > > On Nov 25, 9:48 am, Carlos  wrote:
>
> > > > > > > > > Hi,
>
> > > > > > > > > I am trying to make internationalization work with variables, 
> > > > > > > > > in my
> > > > > > > > > local environment on Win7, with web2py 1.89.1.
>
> > > > > > > > > For reference I have the following test controller:
>
> > > > > > > > > def xyz():
> > > > > > > > >     x = 'xyz'
> > > > > > > > >     return T(x)
>
> > > > > > > > > But after calling that method, when I look at any of the 
> > > > > > > > > language
> > > > > > > > > files, the string 'xyz' is not there, even after executing 
> > > > > > > > > "update all
> > > > > > > > > languages".
>
> > > > > > > > > Am I doing anything wrong?.
>
> > > > > > > > > Thanks,
>
> > > > > > > > >    Carlos
>
>


[web2py] Re: onvalidation only called if there are no form errors

2010-11-26 Thread mr.freeze
Changing line 1565 of html.py from...
if status and onvalidation:
to...
if vars and onvalidation:


On Nov 26, 11:28 am, mdipierro  wrote:
> What would you suggest?
>
> On Nov 26, 11:10 am, "mr.freeze"  wrote:
>
> > I see two issues with this:
> > 1) The form errors found in onvalidation will not be displayed if
> > there are already form errors
> > 2) The developer never gets a chance to remove form errors for certain
> > conditions (think contingent form fields)
> > For example, I am using IS_IN_DB on a field but I only want it to be
> > required if another field is a certain value.
>
> > Is there a better way?
>
>


[web2py] Re: redirect using a new window

2010-11-26 Thread leone
I need to redirect to a new page (for example as a new tab in
chrome).

On Nov 25, 4:30 pm, mdipierro  wrote:
> I do not understand what you want to do.
>
> On Nov 25, 7:13 am, leone  wrote:
>
>
>
>
>
>
>
> > Thanks for suggest, but I need something redirect(URL(..),
> > _target='new').
> > I fear that it doesn't exists, though web2py does anything.
>
> > On Nov 24, 11:19 pm, mdipierro  wrote:
>
> > > or
>
> > > click me
>
> > > On Nov 24, 2:47 pm, Michele Comitini 
> > > wrote:
>
> > > > do you mean like this?
>
> > > > {{=A('click me!', _href=URL(...), _target='new')}}
>
> > > > 2010/11/24 leone :
>
> > > > > Hi,
> > > > > there is a way to redirect to a new page simulating  > > > > target='new'> using URL()
> > > > > or a controller function???
> > > > > Thanks
> > > > > leone


[web2py] Re: redirect using a new window

2010-11-26 Thread mr.freeze
Like so?:
A('Open in new window',_href=URL('...'),_target='_blank')

On Nov 26, 11:42 am, leone  wrote:
> I need to redirect to a new page (for example as a new tab in
> chrome).
>
> On Nov 25, 4:30 pm, mdipierro  wrote:
>
> > I do not understand what you want to do.
>
> > On Nov 25, 7:13 am, leone  wrote:
>
> > > Thanks for suggest, but I need something redirect(URL(..),
> > > _target='new').
> > > I fear that it doesn't exists, though web2py does anything.
>
> > > On Nov 24, 11:19 pm, mdipierro  wrote:
>
> > > > or
>
> > > > click me
>
> > > > On Nov 24, 2:47 pm, Michele Comitini 
> > > > wrote:
>
> > > > > do you mean like this?
>
> > > > > {{=A('click me!', _href=URL(...), _target='new')}}
>
> > > > > 2010/11/24 leone :
>
> > > > > > Hi,
> > > > > > there is a way to redirect to a new page simulating  > > > > > target='new'> using URL()
> > > > > > or a controller function???
> > > > > > Thanks
> > > > > > leone
>
>


[web2py] Re: redirect using a new window

2010-11-26 Thread mr.freeze
Or do you mean use some javascript in the response to open a new
window?

On Nov 26, 11:46 am, "mr.freeze"  wrote:
> Like so?:
> A('Open in new window',_href=URL('...'),_target='_blank')
>
> On Nov 26, 11:42 am, leone  wrote:
>
> > I need to redirect to a new page (for example as a new tab in
> > chrome).
>
> > On Nov 25, 4:30 pm, mdipierro  wrote:
>
> > > I do not understand what you want to do.
>
> > > On Nov 25, 7:13 am, leone  wrote:
>
> > > > Thanks for suggest, but I need something redirect(URL(..),
> > > > _target='new').
> > > > I fear that it doesn't exists, though web2py does anything.
>
> > > > On Nov 24, 11:19 pm, mdipierro  wrote:
>
> > > > > or
>
> > > > > click me
>
> > > > > On Nov 24, 2:47 pm, Michele Comitini 
> > > > > wrote:
>
> > > > > > do you mean like this?
>
> > > > > > {{=A('click me!', _href=URL(...), _target='new')}}
>
> > > > > > 2010/11/24 leone :
>
> > > > > > > Hi,
> > > > > > > there is a way to redirect to a new page simulating  > > > > > > target='new'> using URL()
> > > > > > > or a controller function???
> > > > > > > Thanks
> > > > > > > leone
>
>


[web2py] Add Youtube Video

2010-11-26 Thread Andrew Evans
How can I add a youtube video in web2py... Say a user in my blog submits a
form containing youtube video code how can I embed that code in the post?

*cheers


RE: [web2py] Re: Possible BUG: Hidden fields in SQLFORM with custom render template

2010-11-26 Thread Josh Jaques
Works for me.

-Original Message-
From: web2py@googlegroups.com [mailto:web...@googlegroups.com] On Behalf Of 
mdipierro
Sent: Thursday, November 25, 2010 10:01 PM
To: web2py-users
Subject: [web2py] Re: Possible BUG: Hidden fields in SQLFORM with custom render 
template

I like this. I will give some thought to it and this should be
probably be made the default web2py behavior. Any objection?

On Nov 25, 4:49 pm, Josh Jaques  wrote:
> Hey guys,
>
> I looked into this a little more.
>
> The problem seems to be that self.custom.begin and self.custom.end are 
> computed as soon as the form is initialized, and the hidden fields get 
> appended to self.custom.end only in the call to accepts.
>
> For this same reason, I was also having problems setting a class on a form 
> with a custom template using code like the following:
> form = crud.read(db.table, id)
> form["_class"] = "some class"
>
> The class is set after the form is created, and hence never shows up in 
> self.custom.begin.
>
> I'm using a quick work around by defining the following simple classes:
>
> # lets you add attributes after initialization to forms rendered with custom 
> templates
> class CustomFormBeginner(DIV):
>     def __init__(self, form):
>         self.form = form
>     def xml(self):
>         (begin, end) = self.form._xml()
>         return "<%s %s>" % (self.form.tag, begin)
>
> # ensures the hidden_field() are present on every form, regardless if accepts 
> has been called
> class CustomFormEnder(DIV):
>     def __init__(self, form):
>         self.form = form
>     def xml(self):
>         return "%s" % (self.form.hidden_fields().xml(),
>                             self.form.tag)
>
> And then externally set the form.custom.begin and form.custom.end at creation 
> time like so:
> form = crud.read(db.table, id)
> form["_class"] = "some class"
>
> form.custom.begin = CustomFormBeginner(form)
> form.custom.end = CustomFormEnder(form)
>
> This seems to solve the problem, and doesn't seem to break anything in the 
> testing I've done.
>
> Josh Jaques
> Intern
>
> From: web2py@googlegroups.com [mailto:web...@googlegroups.com] On Behalf Of 
> Josh Jaques
> Sent: Tuesday, November 23, 2010 10:35 AM
> To: web2py@googlegroups.com
> Subject: [web2py] Possible BUG: Hidden fields in SQLFORM with custom render 
> template
>
> Rendering SQLFORMs with a custom template,  any hidden fields I create, as 
> well as the hidden ID field are not displayed in the form until a call to 
> accepts.
>
> I think this might be a bug because the same form rendered without a custom 
> template will have the ID and hidden fields without calling accepts.
>
> I tested against latest release.
>
> Thoughts?
>
> Sample controller action:
> def index():
>     form = SQLFORM(db.images, db.images(1), 
> hidden=dict(test_field="test_value"))
>     accepted_form = SQLFORM(db.images, db.images(1), 
> hidden=dict(test_field="test_value"))
>     accepted_form.accepts(request.vars, formname=None)
>     return dict(form=form, accepted_form=accepted_form)
>
> Sample view:
> 
> {{=form}}
>
> 
> {{=form.custom.begin}}
> Image name: {{=form.custom.widget.name}}
> Image file: {{=form.custom.widget.file}}
> Click here to upload: {{=form.custom.submit}}
> {{=form.custom.end}}
>
> 
> {{form=accepted_form}}
> {{=form.custom.begin}}
> Image name: {{=form.custom.widget.name}}
> Image file: {{=form.custom.widget.file}}
> Click here to upload: {{=form.custom.submit}}
>
> {{=form.custom.end}}
>
> Sample output:
>
> 
>
>  id="images_id__row"> id="images_id__label">Id:  id="images_id">1 id="images_name__row"> id="images_name__label">Name:  class="string" id="images_name" name="name" type="text" value="a" /> class="w2p_fc"> for="images_file" id="images_file__label">File:  class="w2p_fw"> /> class="w2p_fl"> /> name="test_field" type="hidden" value="test_value" /> type="hidden" value="1" />
>
> 
>
> 
>
> Image name:  type="text" value="a" />
>
> Image file:  type="file" />
>
> Click here to upload: 
>
> 
>
> 
>
> 
>
> Image name:  type="text" value="" />enter from 10 to 
> 255 characters
>
> Image file:  type="file" />
>
> Click here to upload: 
>
>  />
>
> This communication, including any attachments, does not necessarily represent 
> official policy of Seccuris Inc.
> Please seehttp://www.seccuris.com/Contact-PrivacyPolicy.htmfor further 
> details about Seccuris Inc.'s Privacy Policy.
> If you have received this communication in error, please notify Seccuris Inc. 
> at i...@seccuris.com or at 1-866-644-8442.
>
> This communication, including any attachments, does not necessarily represent 
> official policy of Seccuris Inc.
> Please seehttp://www.seccuris.com/Contact-PrivacyPolicy.htm for further 
> details about Seccuris Inc.'s Privacy Policy.
> If you have received this communication in error, please notify Seccuris Inc. 
> at i...@seccuris.com or at 1-866-644-8442.
This communication, including any attachments, does not necessarily represent 
official po

[web2py] Re: Add Youtube Video

2010-11-26 Thread mr.freeze
This widget is ripped off from plugin_wiki but doesn't require it:

model
--
db.define_table('youtube',Field('code'))

def youtube_repr(code,width=400,height=250):
return XML("""http://www.youtube.com/v/%
(code)s&hl=en_US&fs=1&">http://www.youtube.com/v/%(code)s&hl=en_US&fs=1&"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="%(width)s" height="%(height)s">""" % dict(code=code, width=width, height=height))

db.youtube.code.represent = youtube_repr

controller
--
def index():
form = SQLFORM(db.youtube)
if form.accepts(request.vars,session):
response.flash = 'Video added'
vids = db(db.youtube.id>0).select()
return dict(form=form,vids=vids)

On Nov 26, 12:00 pm, Andrew Evans  wrote:
> How can I add a youtube video in web2py... Say a user in my blog submits a
> form containing youtube video code how can I embed that code in the post?
>
> *cheers


[web2py] Re: Foreign Key

2010-11-26 Thread Mirek Zvolský
> about 2, deleting integrity. You can do:
>db.define_table(...,Field('name','reference
>blabla',ondelete='cascade'))

yes, you are true. I think, ON DELETE command keeps the integrity
inside the backend database (web2py generates just one DELETE
command).
My idea was to keep the integrity at web2py level (generate separate
DELETE commands /or UPDATE foreignkey=Null/ for all children), however
this would be slow and not necessary if all supported databases
support ON DELETE CASCADE and ON DELETE SET NULL.

cascade is default.
--- And what other possibilities are and their syntax? Same as in SQL,
f.e. can/should I write ondelete='set null' ?

Problem for me is, that with 'reference...' type foreign key cannot
point to the table, which I will define later /at this time/. This
means that more complex database models cannot be implemented. --- I
know, I repeat this always, I apologize for this :-)


[web2py] Re: AppEngine turning off the routes logging

2010-11-26 Thread Wikus van de Merwe
On Nov 19, 4:18 pm, Luci3n  wrote:
> I've set my routes logging to be false, but on app engine every call
> about 10 / 15 debug logs are written, how can a switch them off.
> Here's my routes.py

Your routes.py is not relevant here. Just this one line:
> routes_logging = False

I've tried setting it to all possible values and there is no
difference (web2py 1.89.5) for me on GAE. So I looked at the code of /
gluon/rewrite.py and there is a logger defined like this:
logger = logging.getLogger('web2py.rewrite')

And the definition of this logger can be found in /
logging.example.conf:
[logger_rewrite]
level=WARNING
qualname=web2py.rewrite
handlers=consoleHandler
propagate=0

Now, what is the connection between the routes_logging and the
web2py.rewrite logger level? I believe the link is missing as
routes_logging is not used in /gluon/rewrite.py to set the level of
the logger and this is why it makes no difference. Can somebody
(Jonathan?) explain how this was intended to work? Is really the level
setting code missing here?


Re: [web2py] Re: Add Youtube Video

2010-11-26 Thread Andrew Evans
hey great ty very much this should work really well :D


[web2py] Re: redirect using a new window

2010-11-26 Thread leone
The first:
A('Open in new window',_href=URL('...'),_target='_blank')
.but using redirection. There is a way?

On Nov 26, 6:49 pm, "mr.freeze"  wrote:
> Or do you mean use some javascript in the response to open a new
> window?
>
> On Nov 26, 11:46 am, "mr.freeze"  wrote:
>
>
>
>
>
>
>
> > Like so?:
> > A('Open in new window',_href=URL('...'),_target='_blank')
>
> > On Nov 26, 11:42 am, leone  wrote:
>
> > > I need to redirect to a new page (for example as a new tab in
> > > chrome).
>
> > > On Nov 25, 4:30 pm, mdipierro  wrote:
>
> > > > I do not understand what you want to do.
>
> > > > On Nov 25, 7:13 am, leone  wrote:
>
> > > > > Thanks for suggest, but I need something redirect(URL(..),
> > > > > _target='new').
> > > > > I fear that it doesn't exists, though web2py does anything.
>
> > > > > On Nov 24, 11:19 pm, mdipierro  wrote:
>
> > > > > > or
>
> > > > > > click me
>
> > > > > > On Nov 24, 2:47 pm, Michele Comitini 
> > > > > > wrote:
>
> > > > > > > do you mean like this?
>
> > > > > > > {{=A('click me!', _href=URL(...), _target='new')}}
>
> > > > > > > 2010/11/24 leone :
>
> > > > > > > > Hi,
> > > > > > > > there is a way to redirect to a new page simulating  > > > > > > > target='new'> using URL()
> > > > > > > > or a controller function???
> > > > > > > > Thanks
> > > > > > > > leone


[web2py] Re: Broken web2py Layout on IE6

2010-11-26 Thread Wikus van de Merwe
I'm sorry but in my opinion this is a waste of time. IE6 is 9 years
old now. It still has about 5% of users worldwide but this is not
enough to justify the tremendous effort inevitably involved in working
around all IE6 quirks. And believe me I know what I'm saying because I
did just that. But I did it when IE6 had 50% of users, and I still
feel physical pain when I'm thinking back about this long weeks of CSS
tweaks.

So my advice for web2py is simple. Don't go there. Do your admin HTML/
CSS so that it conforms to the standards and that's it. Don't go all
the way to IE6 compatibility. Sometimes it is users responsibility to
upgrade and experience a better web too.

Alexandre, if you can't convince your customers (BTW, are customers
supposed to use admin?) to upgrade/install alternative browser (yes,
they can coexist with IE6!), then do the hard work of fighting with
IE6 yourself, or pay to have it done for you. Please don't expect
web2py developers to use their hobby time on this, they really have
much more interesting things to do :)


[web2py] Re: redirect using a new window

2010-11-26 Thread Wikus van de Merwe
If your talking about the HTTP redirect there is no such mechanism in
it. It's just a simple 303 response which informs your browser to
fetch the content of a page from a different URL. If you want to open
a new panel/window with URL_2 after visiting URL_1 that has to be done
with javascript.

Why do you want to do that anyway? Opening new panel/window is plain
evil (especially if done with javascript). This should be controlled
by the user, not the webapp developer who thinks he knows better what
the users want. Give a normal link and let the users decide how they
want to open it.


[web2py] Re: redirect using a new window

2010-11-26 Thread mdipierro
I still do not understand what you want to do. Perhaps you can explain
what problem are you trying to solve.

On Nov 26, 1:16 pm, leone  wrote:
> The first:
> A('Open in new window',_href=URL('...'),_target='_blank')
> .but using redirection. There is a way?
>
> On Nov 26, 6:49 pm, "mr.freeze"  wrote:
>
> > Or do you mean use some javascript in the response to open a new
> > window?
>
> > On Nov 26, 11:46 am, "mr.freeze"  wrote:
>
> > > Like so?:
> > > A('Open in new window',_href=URL('...'),_target='_blank')
>
> > > On Nov 26, 11:42 am, leone  wrote:
>
> > > > I need to redirect to a new page (for example as a new tab in
> > > > chrome).
>
> > > > On Nov 25, 4:30 pm, mdipierro  wrote:
>
> > > > > I do not understand what you want to do.
>
> > > > > On Nov 25, 7:13 am, leone  wrote:
>
> > > > > > Thanks for suggest, but I need something redirect(URL(..),
> > > > > > _target='new').
> > > > > > I fear that it doesn't exists, though web2py does anything.
>
> > > > > > On Nov 24, 11:19 pm, mdipierro  wrote:
>
> > > > > > > or
>
> > > > > > > click me
>
> > > > > > > On Nov 24, 2:47 pm, Michele Comitini 
> > > > > > > wrote:
>
> > > > > > > > do you mean like this?
>
> > > > > > > > {{=A('click me!', _href=URL(...), _target='new')}}
>
> > > > > > > > 2010/11/24 leone :
>
> > > > > > > > > Hi,
> > > > > > > > > there is a way to redirect to a new page simulating  > > > > > > > > target='new'> using URL()
> > > > > > > > > or a controller function???
> > > > > > > > > Thanks
> > > > > > > > > leone
>
>


Re: [web2py] Re: Best webframeworks

2010-11-26 Thread Branko Vukelic
On Fri, Nov 26, 2010 at 6:29 PM, mdipierro  wrote:
> that site is useless. It does not provide any useful information on
> any of the frameworks.

Exactly.

-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] Re: T with variables

2010-11-26 Thread Carlos
Hi Massimo,

I could not install that appliance.

But maybe it's better to do it from scratch, without repeating code,
i.e. calling the 'edit_language' action in the 'admin' app indirectly
via my own app (after checking auth_user permissions), with xmlrpc or
exec_environment?.

Does it make sense?.

Thanks,

   Carlos

On Nov 26, 11:33 am, mdipierro  wrote:
> I see. There is this very old app:http://web2py.com/appliances/default/show/9
>
> that allows users permissions only to translate.
>
> It should be revamped and:
> 1) change the edit language page to the new one
> 2) integrate with auth
> 3) allow administrator to assign languages to auth_users
>
> It is a 1h job to a skilled web2py programmer. It would be nice to
> have this functionality.
> It is in my queue but my todo queue is long today so I will take help
> with this one.
>
> adopt this appliance!
>
> massimo
>
> On Nov 26, 11:27 am, Carlos  wrote:
>
>
>
>
>
>
>
> > Hi Massimo,
>
> > I believe the T.set_current_languages you propose refers to viewing
> > the website in a specific language for a certain user.
>
> > What I'm asking for is a way to edit the language files (as regular
> > web apps, not appadmin) with authorization, e.g. userA can only edit
> > 'en' language, userB can only edit 'es' language, and so on.
>
> > Such that we can assign the "translator" role to users for specific
> > languages.
>
> > Thanks,
>
> >    Carlos
>
> > On Nov 25, 9:58 pm, mdipierro  wrote:
>
> > > yes. Make a custom auth_user table with an extra 'language' field and
> > > then do
>
> > > if auth.user: T.set_current_language(auth.user.language)
>
> > > On Nov 25, 12:06 pm, Carlos  wrote:
>
> > > > Thanks Massimo.
>
> > > > Btw is it possible to update the language files via web apps with
> > > > authorization (e.g. userA can only update english, userB only spanish,
> > > > and so on)?.
>
> > > >    Carlos
>
> > > > On Nov 25, 11:33 am, mdipierro  wrote:
>
> > > > > This is a good idea. All you need to do is:
>
> > > > > T.current_languages=[]
>
> > > > > in this way even english will require translation.
>
> > > > > Massimo
>
> > > > > On Nov 25, 11:30 am, Carlos  wrote:
>
> > > > > > Hi,
>
> > > > > > Please let me know if the following makes sense:
>
> > > > > > I want to implement internationalization using always keys (codes) 
> > > > > > for
> > > > > > all T() occurrences, instead of using strings corresponding to one
> > > > > > specific default language.
>
> > > > > > I believe this is necessary (please correct me if I'm wrong) in the
> > > > > > following scenario: if I use 'en' as the default language and I wan 
> > > > > > to
> > > > > > use T('please enter your info'), then I can translate this string to
> > > > > > all other languages, BUT what would happen if I need to change the
> > > > > > translated string in english (e.g. from "please enter your info" to
> > > > > > "please type your info")?, then all other languages for that 
> > > > > > specific
> > > > > > translation will be gone (out or sync), correct?.
>
> > > > > > If we use keys/codes (instead of a default language), and require to
> > > > > > translate ALL languages (including 'en'), then I could make this
> > > > > > change without affecting all other languages, right?.
>
> > > > > > Do you see any problems with this approach?, do you have any
> > > > > > recommendations?.
>
> > > > > > Thanks,
>
> > > > > >    Carlos
>
> > > > > > On Nov 25, 10:36 am, mdipierro  wrote:
>
> > > > > > > Not for T(variable) since variable is only defined at runtime.
>
> > > > > > > On Nov 25, 10:24 am, Carlos  wrote:
>
> > > > > > > > Hi Massimo,
>
> > > > > > > > Thanks, it now works ok with T.force.
>
> > > > > > > > Is there a way to automatically update multiple language files 
> > > > > > > > at once
> > > > > > > > with all these lazy T's?.
>
> > > > > > > >    Carlos
>
> > > > > > > > On Nov 25, 10:00 am, mdipierro  wrote:
>
> > > > > > > > > Update all languages will not catch this because this can 
> > > > > > > > > only be
> > > > > > > > > caught at run-time. The string should be added in the 
> > > > > > > > > language file
> > > > > > > > > when you run the action (and the browser set to the language 
> > > > > > > > > needing
> > > > > > > > > translation).
>
> > > > > > > > > try again, check the language file timestamp. If the file is 
> > > > > > > > > not being
> > > > > > > > > updated, may be a permission issue.
>
> > > > > > > > > On Nov 25, 9:48 am, Carlos  wrote:
>
> > > > > > > > > > Hi,
>
> > > > > > > > > > I am trying to make internationalization work with 
> > > > > > > > > > variables, in my
> > > > > > > > > > local environment on Win7, with web2py 1.89.1.
>
> > > > > > > > > > For reference I have the following test controller:
>
> > > > > > > > > > def xyz():
> > > > > > > > > >     x = 'xyz'
> > > > > > > > > >     return T(x)
>
> > > > > > > > > > But after calling that method, when I look at any of the 
> > > > > > > > > > language
> > > > > > > > > > files, the stri

[web2py] Re: Anyone with experience developing Facebook IFrame app using Web2Py?

2010-11-26 Thread berubejd
I have a couple of applications (unpublished) which are Facebook
iframe apps written using web2py.

There are a few caveats which are not web2py specific.  The biggest is
that, using the new GraphAPI the developer has been stripped nearly
entirely of efficient methods of doing anything but querying FB data.
There are few ways, and none that I have found that are decent (I am
still working on it...), to pop open invite boxes, let users post to
their stream, query which of your users friends use an application,
etc.  For much of that functionality you will need to rely on the JS
API (I hope), which I am hoping to start looking at this coming week,
or use the older REST API, which has a community only supported Python
library which is poorly maintained and required a LOT of work to just
make usable.

Over the last year, I have expanded upon Massimo's FB example,
correcting the community library, and created an Auth replacement out
of it.  I have created a hacked together Auth replacement which seems
to work well with the new GraphAPI, and I have, just over the last
week, hacked a bit on the module provided by Mr. Comitini because it
works well in concert with the existing Auth rather than replaces it
like the version I have put together.

Although the new module is very nice, and probably works well for apps
running outside of FB, I have had to make a couple of changes already
in regards to application authorization and there is at least one
additional outstanding bug relating to setting the application path
which FB is supposed to return a user to after authentication.  (I
have already dug through the new module and Auth but, without
additional work, have been unable to to source out the correct way to
set the 'next' variable which gets passed around half a dozen times
and needs to be set for FB... hehe)

I had intended to release the entire application source for my test
application to the community with a series of posts documenting how
the various parts work but keep getting pulled onto other tasks before
I can finish all the integration points (stream, invite, etc) because
JavaScript is definitely not my strongest skill.

I am more than happy to provide the Auth modifications or module, in
its current state, to anyone who can sort it out further.  I'm not a
programmer by trade, however, so I can't speak for the quality of my
code... hehe

Thanks!
Jeff

On Nov 25, 9:30 am, Narendran  wrote:
> Hello,
> I am in the process of developing a Facebook IFrame app using Web2Py.
> If there is someone who's done this before, I'd like to get some
> guidance regarding,
> 1. What is better to do? Login using Javascript, or using Web2py
> auth?
> 2. Any other things to consider/look at specific to FB + Web2Py?
>
> --
> Thanks
> Narendran


Re: [web2py] Broken web2py Layout on IE6

2010-11-26 Thread Branko Vukelic
On Fri, Nov 26, 2010 at 3:56 PM, Alexandre Augusto  wrote:
> Although I ask myself, if web2py should also enforce people to not use
> IE6 or it should
> have an administrative interface that works cross-browsers

Short answer is no, and no. Here's why.

1. Google discontinued support for IE6 on most of its services, so
that's a reason enough for most people to switch to a later version.
As a matter of fact, YouTube, ranked 3rd by Alexa, right after Google
and Facebook, doesn't support IE6 and displays a rather confusing
banner before it allows you to play video. This is reason enough for
most IE6 users to look for a way to update or switch.

2. The fix could be as short as 1 line, or as long as a new
stylesheet. You never know these things with IE6, and just the time
required to find the right solution would already be an overkill for
the number of potential users that would benefit from that.

3. As for enforcing IE upgrade, it's also a waste of time. Why waste a
second of developer time just to warn less than 1% of users to switch?
The reason it's less than 1% (probably closer to 0), and not 5% is
that people who use web2py admin interface are mostly developers, and
therefore have mostly updated their browsers or use alternative ones
(which I suspect is more common).

If you're willing to waste time on this, though, I'd suggest trying
the ``inline`` fix on all buttons. Buttons use inline-block, and I
suspect that's bothering IE6 which was never good with these things.
Personally, I don't even start IE6 to see the sites I design nowadays.
It creates too much stress. :)

-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


Re: [web2py] Re: Anyone with experience developing Facebook IFrame app using Web2Py?

2010-11-26 Thread Michele Comitini
Jeff,

If you want you can send me your version of the auth module.  So we can merge it

thanks
mic

2010/11/26 berubejd :
> I have a couple of applications (unpublished) which are Facebook
> iframe apps written using web2py.
>
> There are a few caveats which are not web2py specific.  The biggest is
> that, using the new GraphAPI the developer has been stripped nearly
> entirely of efficient methods of doing anything but querying FB data.
> There are few ways, and none that I have found that are decent (I am
> still working on it...), to pop open invite boxes, let users post to
> their stream, query which of your users friends use an application,
> etc.  For much of that functionality you will need to rely on the JS
> API (I hope), which I am hoping to start looking at this coming week,
> or use the older REST API, which has a community only supported Python
> library which is poorly maintained and required a LOT of work to just
> make usable.
>
> Over the last year, I have expanded upon Massimo's FB example,
> correcting the community library, and created an Auth replacement out
> of it.  I have created a hacked together Auth replacement which seems
> to work well with the new GraphAPI, and I have, just over the last
> week, hacked a bit on the module provided by Mr. Comitini because it
> works well in concert with the existing Auth rather than replaces it
> like the version I have put together.
>
> Although the new module is very nice, and probably works well for apps
> running outside of FB, I have had to make a couple of changes already
> in regards to application authorization and there is at least one
> additional outstanding bug relating to setting the application path
> which FB is supposed to return a user to after authentication.  (I
> have already dug through the new module and Auth but, without
> additional work, have been unable to to source out the correct way to
> set the 'next' variable which gets passed around half a dozen times
> and needs to be set for FB... hehe)
>
> I had intended to release the entire application source for my test
> application to the community with a series of posts documenting how
> the various parts work but keep getting pulled onto other tasks before
> I can finish all the integration points (stream, invite, etc) because
> JavaScript is definitely not my strongest skill.
>
> I am more than happy to provide the Auth modifications or module, in
> its current state, to anyone who can sort it out further.  I'm not a
> programmer by trade, however, so I can't speak for the quality of my
> code... hehe
>
> Thanks!
> Jeff
>
> On Nov 25, 9:30 am, Narendran  wrote:
>> Hello,
>> I am in the process of developing a Facebook IFrame app using Web2Py.
>> If there is someone who's done this before, I'd like to get some
>> guidance regarding,
>> 1. What is better to do? Login using Javascript, or using Web2py
>> auth?
>> 2. Any other things to consider/look at specific to FB + Web2Py?
>>
>> --
>> Thanks
>> Narendran


Re: [web2py] Re: Debugging my app

2010-11-26 Thread Lorin Rivers
Thanks, I ended up rebuilding my web2py project and now it works.

On Nov 26, 2010, at 11:13 , mr.freeze wrote:

> You have to right click on your project and choose Refresh to reflect
> external changes.  Do you see a green dot next to your breakpoint?
> Double click in the gray border to the left of the code and it should
> show a green dot.
> 
> On Nov 26, 11:09 am, Lorin Rivers  wrote:
>> I have python run, my web2py app is running, I can load it in the web 
>> browser in eclipse, the breakpoints are showing in the list of breakpoints 
>> and in the editor, my print statements are showing in the console, but it's 
>> NOT breaking.
>> 
>> Also, if I edit a file in an external editor, the changes don't appear in 
>> Eclipse. What's up with that?
>> 
>> On Nov 26, 2010, at 10:45 , mr.freeze wrote:
>> 
>> 
>> 
>>> I use both Ubuntu 10.10 and Windows 7.  The first time, you right
>>> click web2py.py in the file tree and choose Debug As / Python Run. If
>>> Python Run is not available, you need to verify your interpreter
>>> setup.
>> 
>>> On Nov 26, 10:37 am, Lorin Rivers  wrote:
 So you just click (or whatever the gesture is) to the side of the line you 
 want to break at and it just works?
>> 
 To start a session, you right-click on web2py and start a debug session?
>> 
 What platform are you on?
>> 
 On Nov 26, 2010, at 10:32 , mr.freeze wrote:
>> 
> I use PyDev and Eclipse. It works like a champ. I can set breakpoints,
> inspect variables, create expressions at runtime. Very handy, not to
> mention that the mercurial eclipse plugin makes it very easy to
> update.
>> 
> On Nov 26, 10:25 am, Lorin Rivers  wrote:
>> Getting pretty sick of using 'print' to debug.
>> 
>> I tried pydbgr, but that didn't seem to work (crashed python).
>> 
>> What other tools should I look at that will let me step through my 
>> web2py code?
>> --
>> Lorin Rivers
>> Mosasaur: Killer Technical Marketing 
>> 
>> 512/203.3198 (m)
>> 
 --
 Lorin Rivers
 Mosasaur: Killer Technical Marketing 
 
 512/203.3198 (m)
>> 
>> --
>> Lorin Rivers
>> Mosasaur: Killer Technical Marketing 
>> 
>> 512/203.3198 (m)

-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




[web2py] Using Jython with web2py

2010-11-26 Thread pierreth
Hello, I tried to use Jython with web2py. I am telling the story in my
blog:

http://pierrethibault.posterous.com/using-sqlite-with-java-on-linux

So far, I have this error:

Traceback (most recent call last):
  File "/media/pierreth-backup/work/web2py/gluon/restricted.py", line
188, in restricted
exec ccode in environment
  File "/media/pierreth-backup/work/web2py/applications/welcome/models/
db.py", line 15, in 
db = DAL('sqlite://storage.sqlite')   # if not, use SQLite or
other DB
  File "/media/pierreth-backup/work/web2py/gluon/sql.py", line 4051,
in DAL
raise RuntimeError, "%s (tried 5 times)" % exception
RuntimeError: global name 'sqlite3' is not defined (tried 5 times)

Error snapshot help Detailed traceback description

(global name 'sqlite3' is not defined
(tried 5 times))


How far have you been with Jython and web2py? Is it possible to make
the two work together?


Re: [web2py] Bug in model validator (require vs requires) ?

2010-11-26 Thread Branko Vukelic
It is valid if you assigned something to it. That's how Python works.

2010/11/26 António Ramos :
> I got no error when i save my model.
> It sould give some error because
> db.database.field.require is not valid
> I think.
> António
> 2010/11/26 Richard Vézina 
>>
>> And what will happen if we want to use require key word for an other
>> purpose??
>> Are you mean require or requires messages each type I write a line of
>> code?
>> May be you need a IDE (eclispe with python plugin) that will try to
>> complete the code you are typing... It may prevent some typo.
>>
>>
>> Richard
>>
>> 2010/11/26 António Ramos 
>>>
>>> Hello i have a model and this line
>>>
>>> db.trabalhadores.empreiteiro.require=IS_IN_DB(db,'empreiteiros.id','%(empreiteiro)s')
>>> it hapens that there is no error from web2py but when i insert a record i
>>> got no dropdownlist for field empreiteiro.
>>> After copy paste some examples i noticed that it is not require but
>>> requires
>>> Shouldn´t web2py warned me about the type error?
>>>
>>> I lost 15 minutes looking for the bug.
>>>
>>> Best regards
>>> António
>
>



-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] passing json from javascript to controller

2010-11-26 Thread b0j3
Hi!

I'm trying to call controller from javascript using the jquery load:

$.post("todb",{"name": in_name,"desc": in_desc, "location": in_loc});

The problem is that I don't know how to get the json valu passed to
todb controller.
I've tried
@service.json decorator,
adding variable to the function definition and also
gluon.contrib.simplejson.loads(response.body.read())
but I always get an error message.

Do you guys have a recomendation or idea what to do?


Re: [web2py] Development Questions

2010-11-26 Thread Lorin Rivers

On Nov 26, 2010, at 16:35 , Steve Shepherd wrote:

> IF someone could help with some examples of answers would be great.


Someone less ignorant than I should answer that.

> 2. How do I trace through code. line by line and then inspect values in 
> variables or objects

This I just solved for myself.

The short answer for #2 is Eclipse with PyDev & Aptana.

There are some good instructions here (plus a script that will do much of the 
setup):


It took me 2 tries to get it working, one of the options is to copy all the 
files from your project into your workspace, which caused me problems.

That option is unclearly worded, so avoid all the copying option in the Eclipse 
UI.

Hope that helps!

If you are on the Mac I could probably provide some more tips.
-- 
Lorin Rivers
Mosasaur: Killer Technical Marketing 

512/203.3198 (m)




[web2py] Re: Using Jython with web2py

2010-11-26 Thread mdipierro
The instructions are here:
http://web2py.com/book/default/chapter/12#Jython

Make sure you have zxJDBC.

It works (some of us have tested it) but there are some know problems
and I would not recommend it in production. One problem is a known
problem with Java regular expression parses that Sun marked as "won't
fix". It is not a web2py specific problem but can cause some web2py
templates send enter into a loop.

Massimo





On Nov 26, 4:15 pm, pierreth  wrote:
> Hello, I tried to use Jython with web2py. I am telling the story in my
> blog:
>
> http://pierrethibault.posterous.com/using-sqlite-with-java-on-linux
>
> So far, I have this error:
>
> Traceback (most recent call last):
>   File "/media/pierreth-backup/work/web2py/gluon/restricted.py", line
> 188, in restricted
>     exec ccode in environment
>   File "/media/pierreth-backup/work/web2py/applications/welcome/models/
> db.py", line 15, in 
>     db = DAL('sqlite://storage.sqlite')       # if not, use SQLite or
> other DB
>   File "/media/pierreth-backup/work/web2py/gluon/sql.py", line 4051,
> in DAL
>     raise RuntimeError, "%s (tried 5 times)" % exception
> RuntimeError: global name 'sqlite3' is not defined (tried 5 times)
>
> Error snapshot help Detailed traceback description
>
> (global name 'sqlite3' is not defined
> (tried 5 times))
>
> How far have you been with Jython and web2py? Is it possible to make
> the two work together?


[web2py] Re: onvalidation only called if there are no form errors

2010-11-26 Thread mdipierro
Consider this case:

db.define_table('numbers',Field('a','integre'),Field('b','integer'))
def validate(form):
if form.vars.a+form.vars.b>100:
form.errors.b="a+b must not exceed 100"
form=crud.create(db.numbers,onvalidation=validate)

Before the change the function validate is not called if a and b are
not valid integer this never triggering an exception, only validation
errors.

With your proposed change this would cause an error because
form.vars.a is None if request.vars.a does ot pass the default integer
validation. The function validation would be called again and issue a
ticket.

This is a change of behavior. I am not convinced this change is a good
idea.

Why do you need it?
Other opinions?

Massimo

On Nov 26, 11:34 am, "mr.freeze"  wrote:
> Changing line 1565 of html.py from...
>         if status and onvalidation:
> to...
>         if vars and onvalidation:
>
> On Nov 26, 11:28 am, mdipierro  wrote:
>
> > What would you suggest?
>
> > On Nov 26, 11:10 am, "mr.freeze"  wrote:
>
> > > I see two issues with this:
> > > 1) The form errors found in onvalidation will not be displayed if
> > > there are already form errors
> > > 2) The developer never gets a chance to remove form errors for certain
> > > conditions (think contingent form fields)
> > > For example, I am using IS_IN_DB on a field but I only want it to be
> > > required if another field is a certain value.
>
> > > Is there a better way?
>
>


[web2py] Re: passing json from javascript to controller

2010-11-26 Thread mdipierro
On Nov 26, 5:33 pm, b0j3  wrote:
> Hi!
>
> I'm trying to call controller from javascript using the jquery load:
>
> $.post("todb",{"name": in_name,"desc": in_desc, "location": in_loc});

this is not sending json. The values will be in request.name.is_name,
etc.

>
> The problem is that I don't know how to get the json valu passed to
> todb controller.
> I've tried
> @service.json decorator,
> adding variable to the function definition and also
> gluon.contrib.simplejson.loads(response.body.read())
> but I always get an error message.
>
> Do you guys have a recomendation or idea what to do?


Re: [web2py] Re: AppEngine turning off the routes logging

2010-11-26 Thread Jonathan Lundell
On Nov 26, 2010, at 10:44 AM, Wikus van de Merwe wrote:
> 
> On Nov 19, 4:18 pm, Luci3n  wrote:
>> I've set my routes logging to be false, but on app engine every call
>> about 10 / 15 debug logs are written, how can a switch them off.
>> Here's my routes.py
> 
> Your routes.py is not relevant here. Just this one line:
>> routes_logging = False
> 
> I've tried setting it to all possible values and there is no
> difference (web2py 1.89.5) for me on GAE. So I looked at the code of /
> gluon/rewrite.py and there is a logger defined like this:
> logger = logging.getLogger('web2py.rewrite')
> 
> And the definition of this logger can be found in /
> logging.example.conf:
> [logger_rewrite]
> level=WARNING
> qualname=web2py.rewrite
> handlers=consoleHandler
> propagate=0
> 
> Now, what is the connection between the routes_logging and the
> web2py.rewrite logger level? I believe the link is missing as
> routes_logging is not used in /gluon/rewrite.py to set the level of
> the logger and this is why it makes no difference. Can somebody
> (Jonathan?) explain how this was intended to work? Is really the level
> setting code missing here?

routes_logging is not used; it's left over from a previous version and should 
be deleted.

Copy logging.example.conf to logging.conf. That should turn off all your debug 
logs, since they're lower priority than WARNING.

I'm not sure why you're logging at the debug level, unless that's the way the 
GAE installation defaults. Notice that if there's no logging.conf, we rely on 
logging.basicConfig() for initialization (see main.py). Perhaps we should add 
level=logging.WARNING or the like to the basicConfig() call (you might 
experiment with that before you install logging.conf and see what happens; it 
might make a good patch).

[web2py] Re: onvalidation only called if there are no form errors

2010-11-26 Thread mr.freeze
Good point. Here is my use case:

db.define_table('cars',
Field('make'),
Field('model'),
Field('year'),
Field('catalytic_converter_type',requires =
IS_IN_SET('one','two','three'),
comment='for cars later than 1975'))

I want catalytic_converter_type to be required if the car year is
greater than 1975. I also want to show an error if
catalytic_converter_type is selected and the year is less than 1975.
Allowing the user to see all errors at once would be a bonus but not a
deal breaker. onvalidation seems like the place to handle it but let
me know if there is a better way.


On Nov 26, 5:48 pm, mdipierro  wrote:
> Consider this case:
>
> db.define_table('numbers',Field('a','integre'),Field('b','integer'))
> def validate(form):
>     if form.vars.a+form.vars.b>100:
>         form.errors.b="a+b must not exceed 100"
> form=crud.create(db.numbers,onvalidation=validate)
>
> Before the change the function validate is not called if a and b are
> not valid integer this never triggering an exception, only validation
> errors.
>
> With your proposed change this would cause an error because
> form.vars.a is None if request.vars.a does ot pass the default integer
> validation. The function validation would be called again and issue a
> ticket.
>
> This is a change of behavior. I am not convinced this change is a good
> idea.
>
> Why do you need it?
> Other opinions?
>
> Massimo
>
> On Nov 26, 11:34 am, "mr.freeze"  wrote:
>
> > Changing line 1565 of html.py from...
> >         if status and onvalidation:
> > to...
> >         if vars and onvalidation:
>
> > On Nov 26, 11:28 am, mdipierro  wrote:
>
> > > What would you suggest?
>
> > > On Nov 26, 11:10 am, "mr.freeze"  wrote:
>
> > > > I see two issues with this:
> > > > 1) The form errors found in onvalidation will not be displayed if
> > > > there are already form errors
> > > > 2) The developer never gets a chance to remove form errors for certain
> > > > conditions (think contingent form fields)
> > > > For example, I am using IS_IN_DB on a field but I only want it to be
> > > > required if another field is a certain value.
>
> > > > Is there a better way?
>
>


Re: [web2py] Development Questions

2010-11-26 Thread Branko Vukelic
On Sat, Nov 27, 2010 at 12:39 AM, Lorin Rivers  wrote:
> 
> Someone less ignorant than I should answer that.

Not me. :)

>> 2. How do I trace through code. line by line and then inspect values in 
>> variables or objects
>
> This I just solved for myself.
>
> The short answer for #2 is Eclipse with PyDev & Aptana.

There are a few more alternatives (each with its own advantages and
shortcomings):

1. WinPDB (http://winpdb.org/)

Great GUI debugger with remote debugging capabilities.

2. Ipdb (http://pypi.python.org/pypi/ipdb)

Embedded IPython sheel and debugger. If you know IPython, you know
this is awesome. :)


-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


Re: [web2py] documentation flow

2010-11-26 Thread Branko Vukelic
On Fri, Nov 26, 2010 at 4:54 PM, oncle_bob
 wrote:
> I like web2py product but I don't recommend it. The documentation and

To each their own, eh? :)

> features flow is too spreaded and too speeded. Why don't you publish
> the book and documentation in html files, it's easier to check
> features and API point. The book reading is not fun to read and search

You'll find both the book and the API docs in the documentation
section. I would've sworn that's the first place anyone would look,
but I guess I'd be wrong. :)

Online book: http://web2py.com/book
API: http://www.web2py.com/examples/static/epydoc/index.html
API section in the book: http://web2py.com/book/default/chapter/04#API

> anything. If I don't read the group, I miss a lot of. Developper can't
> spend all time to read group ;) every day.

Some of us are obviously happy with reading this list. :)

-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group


[web2py] [pypy-dev] PyPy 1.4 released

2010-11-26 Thread Phyo Arkar
I think its time try to give web2py on pypy 1.4 a try! its production
quality they said.

-- Forwarded message --
From: Maciej Fijalkowski 
Date: Fri, 26 Nov 2010 20:23:45 +0200
Subject: [pypy-dev] PyPy 1.4 released
To: PyPy Dev , ""
, python-annou...@python.org

===
PyPy 1.4: Ouroboros in practice
===

We're pleased to announce the 1.4 release of PyPy. This is a major breakthrough
in our long journey, as PyPy 1.4 is the first PyPy release that can translate
itself faster than CPython.  Starting today, we are using PyPy more for
our every-day development.  So may you :) You can download it here:

http://pypy.org/download.html

What is PyPy


PyPy is a very compliant Python interpreter, almost a drop-in replacement
for CPython. It's fast (`pypy 1.4 and cpython 2.6`_ comparison)

Among its new features, this release includes numerous performance improvements
(which made fast self-hosting possible), a 64-bit JIT backend, as well
as serious stabilization. As of now, we can consider the 32-bit and 64-bit
linux versions of PyPy stable enough to run `in production`_.

Numerous speed achievements are described on `our blog`_. Normalized speed
charts comparing `pypy 1.4 and pypy 1.3`_ as well as `pypy 1.4 and cpython 2.6`_
are available on benchmark website. For the impatient: yes, we got a lot faster!

More highlights
===

* PyPy's built-in Just-in-Time compiler is fully transparent and
  automatically generated; it now also has very reasonable memory
  requirements.  The total memory used by a very complex and
  long-running process (translating PyPy itself) is within 1.5x to
  at most 2x the memory needed by CPython, for a speed-up of 2x.

* More compact instances.  All instances are as compact as if
  they had ``__slots__``.  This can give programs a big gain in
  memory.  (In the example of translation above, we already have
  carefully placed ``__slots__``, so there is no extra win.)

* `Virtualenv support`_: now PyPy is fully compatible with
virtualenv_: note that
  to use it, you need a recent version of virtualenv (>= 1.5).

* Faster (and JITted) regular expressions - huge boost in speeding up
  the `re` module.

* Other speed improvements, like JITted calls to functions like map().

.. _virtualenv: http://pypi.python.org/pypi/virtualenv
.. _`Virtualenv support`:
http://morepypy.blogspot.com/2010/08/using-virtualenv-with-pypy.html
.. _`in production`:
http://morepypy.blogspot.com/2010/11/running-large-radio-telescope-software.html
.. _`our blog`: http://morepypy.blogspot.com
.. _`pypy 1.4 and pypy 1.3`:
http://speed.pypy.org/comparison/?exe=1%2B41,1%2B172&ben=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20&env=1&hor=false&bas=1%2B41&chart=normal+bars
.. _`pypy 1.4 and cpython 2.6`:
http://speed.pypy.org/comparison/?exe=2%2B35,1%2B172&ben=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20&env=1&hor=false&bas=2%2B35&chart=normal+bars

Cheers,

Carl Friedrich Bolz, Antonio Cuni, Maciej Fijalkowski,
Amaury Forgeot d'Arc, Armin Rigo and the PyPy team
___
pypy-...@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev


Re: [web2py] Re: Problem starting server web2py

2010-11-26 Thread Marcos Vinhal
even installing this version the problem continues

2010/11/26 mdipierro 

> Try install web2py nightly built from he download page. It should not
> have this dependency any more.
>
> On Nov 26, 7:48 am, Marcos Vinhal  wrote:
> > Which file do I install?
> >
> > 2010/11/26 Bruno Rocha 
> >
> >
> >
> > > Did you installed Mark Hammond win32 extension?
> >
> > > 2010/11/26 Marcos Vinhal 
> >
> > > when I starting server web2py show this "web2py:unable to import
> Rocket".
> >
> > >> can help me.
> >
> > >> 2010/11/24 mdipierro 
> >
> > >>> How are you starting web2py?
> >
> > >>> On Nov 24, 5:47 pm, Marcos Vinhal  wrote:
> > >>> > Every time I try to start the server web2py shows the message
> below:
> >
> > >>> > ---
> > >>> > web2py start server
> > >>> > ---
> > >>> > global name 'rocket' is not defined
> > >>> > ---
> > >>> > OK
> > >>> > ---
> >
> > >>> > Please help me if possible ...
> >
> > >>> > Thanks ...
> >
> > >> --
> > >> Att,
> >
> > >> Marcos A. Vinhal
> >
> > > --
> >
> > > Bruno Rocha
> > >http://about.me/rochacbruno/bio
> >
> > --
> > Att,
> >
> > Marcos A. Vinhal
>



-- 
Att,

Marcos A. Vinhal


[web2py] Re: documentation flow

2010-11-26 Thread DenesL

The book navigation could be improved, and I mentioned this recently
to Massimo; specially for the majority of us that still depend on it.
For example, the general index entries do a search of the term instead
of taking you directly to where it is defined, not very efficient. If
I want to find something fast I have to use my PDF copy but alas, it
does not include the latest features.

Reading the group posts is a great way to learn and more so if you try
to answer some of them; time consuming, yes, but learning requires
some commitment.

Denes.


On Nov 26, 7:36 pm, Branko Vukelic  wrote:
> On Fri, Nov 26, 2010 at 4:54 PM, oncle_bob
>
>  wrote:
> > I like web2py product but I don't recommend it. The documentation and
>
> To each their own, eh? :)
>
> > features flow is too spreaded and too speeded. Why don't you publish
> > the book and documentation in html files, it's easier to check
> > features and API point. The book reading is not fun to read and search
>
> You'll find both the book and the API docs in the documentation
> section. I would've sworn that's the first place anyone would look,
> but I guess I'd be wrong. :)
>
> Online book:http://web2py.com/book
> API:http://www.web2py.com/examples/static/epydoc/index.html
> API section in the book:http://web2py.com/book/default/chapter/04#API
>
> > anything. If I don't read the group, I miss a lot of. Developper can't
> > spend all time to read group ;) every day.
>
> Some of us are obviously happy with reading this list. :)
>
> --
> Branko Vukelić
>
> bg.bra...@gmail.com
> stu...@brankovukelic.com
>
> Check out my blog:http://www.brankovukelic.com/
> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
> Registered Linux user #438078 (http://counter.li.org/)
> I hang out on identi.ca:http://identi.ca/foxbunny
>
> Gimp Brushmakers Guildhttp://bit.ly/gbg-group


[web2py] Re: Development Questions

2010-11-26 Thread DenesL


On Nov 26, 5:35 pm, Steve Shepherd  wrote:
> IF someone could help with some examples of answers would be great.
>
> 1. Where should we put common functions that will be called by different
> parts.
> For example I am wanting to use a Soundex function to add as a computed
> field.
> Where should I put it so I can call it and then how should I call it.

Those common functions can go in your modules directory.
Use local_import to have access to them in your code as explained in
http://web2py.com/book/default/chapter/04#Third-Party-Modules


> Here is the Soundex code:
>
> def soundex(name, len=4):
>     """ soundex module conforming to Knuth's algorithm
> implementation 2000-12-24 by Gregory Jorgensen        public domain
> """
>
>     # digits holds the soundex values for the alphabet
>     digits = '01230120022455012623010202'
>     sndx = ''
>     fc = ''
>
>     # translate alpha chars in name to soundex digits
>     for c in name.upper():
>         if c.isalpha():
>             if not fc: fc = c   # remember first letter
>             d = digits[ord(c)-ord('A')]
>             # duplicate consecutive soundex digits are skipped
>             if not sndx or (d != sndx[-1]):
>                 sndx += d
>
>     # replace first digit with first alpha character
>     sndx = fc + sndx[1:]
>
>     # remove all 0s from the soundex code
>     sndx = sndx.replace('0','')
>
>     # return soundex code padded to len characters
>     return (sndx + (len * '0'))[:len]
>
> 2. How do I trace through code. line by line and then inspect values in
> variables or objects
>
> Steve Shepherd
> Newbie


Re: [web2py] Re: documentation flow

2010-11-26 Thread Phyo Arkar
i guess he dont even bother to read homepage well :D

On 11/27/10, DenesL  wrote:
>
> The book navigation could be improved, and I mentioned this recently
> to Massimo; specially for the majority of us that still depend on it.
> For example, the general index entries do a search of the term instead
> of taking you directly to where it is defined, not very efficient. If
> I want to find something fast I have to use my PDF copy but alas, it
> does not include the latest features.
>
> Reading the group posts is a great way to learn and more so if you try
> to answer some of them; time consuming, yes, but learning requires
> some commitment.
>
> Denes.
>
>
> On Nov 26, 7:36 pm, Branko Vukelic  wrote:
>> On Fri, Nov 26, 2010 at 4:54 PM, oncle_bob
>>
>>  wrote:
>> > I like web2py product but I don't recommend it. The documentation and
>>
>> To each their own, eh? :)
>>
>> > features flow is too spreaded and too speeded. Why don't you publish
>> > the book and documentation in html files, it's easier to check
>> > features and API point. The book reading is not fun to read and search
>>
>> You'll find both the book and the API docs in the documentation
>> section. I would've sworn that's the first place anyone would look,
>> but I guess I'd be wrong. :)
>>
>> Online book:http://web2py.com/book
>> API:http://www.web2py.com/examples/static/epydoc/index.html
>> API section in the book:http://web2py.com/book/default/chapter/04#API
>>
>> > anything. If I don't read the group, I miss a lot of. Developper can't
>> > spend all time to read group ;) every day.
>>
>> Some of us are obviously happy with reading this list. :)
>>
>> --
>> Branko Vukelić
>>
>> bg.bra...@gmail.com
>> stu...@brankovukelic.com
>>
>> Check out my blog:http://www.brankovukelic.com/
>> Check out my portfolio:http://www.flickr.com/photos/foxbunny/
>> Registered Linux user #438078 (http://counter.li.org/)
>> I hang out on identi.ca:http://identi.ca/foxbunny
>>
>> Gimp Brushmakers Guildhttp://bit.ly/gbg-group


[web2py] elFinder web file manager

2010-11-26 Thread Carlos
Hi,

I'm wondering what ever happened with elFinder web file manager?:

http://elrte.org/elfinder/

http://groups.google.com/group/web2py/browse_thread/thread/3af7b48d3267fd59/09847d81ae92ef26

Is it already integrated with web2py?, for all types of users (admin,
appadmin, endusers)?.

Is anybody actually using it in production environments?, or was it
abandoned (why)?.

Is there something better (as a web file manager, integrated with
web2py) out there?.

Best regards,

   Carlos


[web2py] Re: onvalidation only called if there are no form errors

2010-11-26 Thread DenesL

You can always change requires on the fly

def test():
  if request.vars.year:
try:
  y = int(request.vars.year)
except 'ValueError':
  y = 0
if y > 1975:
  db.cars.catalytic_converter_type.requires =
IS_IN_SET(['one','two','three'], error_message='cars later than 1975
must have at least one')
else:
  db.cars.catalytic_converter_type.requires = IS_EQUAL_TO('',
error_message='cars before 1975 should not have one')
  f=SQLFORM(db.cars)
  if f.accepts(request.vars, session):
response.flash='accepted'
  elif f.errors:
response.flash='please fix and re-submit'
  return dict(f=f)


On Nov 26, 7:17 pm, "mr.freeze"  wrote:
> Good point. Here is my use case:
>
> db.define_table('cars',
>     Field('make'),
>     Field('model'),
>     Field('year'),
>     Field('catalytic_converter_type',requires =
> IS_IN_SET('one','two','three'),
> comment='for cars later than 1975'))
>
> I want catalytic_converter_type to be required if the car year is
> greater than 1975. I also want to show an error if
> catalytic_converter_type is selected and the year is less than 1975.
> Allowing the user to see all errors at once would be a bonus but not a
> deal breaker. onvalidation seems like the place to handle it but let
> me know if there is a better way.
>
> On Nov 26, 5:48 pm, mdipierro  wrote:
>
> > Consider this case:
>
> > db.define_table('numbers',Field('a','integre'),Field('b','integer'))
> > def validate(form):
> >     if form.vars.a+form.vars.b>100:
> >         form.errors.b="a+b must not exceed 100"
> > form=crud.create(db.numbers,onvalidation=validate)
>
> > Before the change the function validate is not called if a and b are
> > not valid integer this never triggering an exception, only validation
> > errors.
>
> > With your proposed change this would cause an error because
> > form.vars.a is None if request.vars.a does ot pass the default integer
> > validation. The function validation would be called again and issue a
> > ticket.
>
> > This is a change of behavior. I am not convinced this change is a good
> > idea.
>
> > Why do you need it?
> > Other opinions?
>
> > Massimo
>
> > On Nov 26, 11:34 am, "mr.freeze"  wrote:
>
> > > Changing line 1565 of html.py from...
> > >         if status and onvalidation:
> > > to...
> > >         if vars and onvalidation:
>
> > > On Nov 26, 11:28 am, mdipierro  wrote:
>
> > > > What would you suggest?
>
> > > > On Nov 26, 11:10 am, "mr.freeze"  wrote:
>
> > > > > I see two issues with this:
> > > > > 1) The form errors found in onvalidation will not be displayed if
> > > > > there are already form errors
> > > > > 2) The developer never gets a chance to remove form errors for certain
> > > > > conditions (think contingent form fields)
> > > > > For example, I am using IS_IN_DB on a field but I only want it to be
> > > > > required if another field is a certain value.
>
> > > > > Is there a better way?
>
>


[web2py] Re: elFinder web file manager

2010-11-26 Thread mdipierro
It is not integrated but there was a plugin for it. If somebody could
post a list to it (and host it on google code somewhere) I would post
a link from appliances. It could be used for admin2.

On Nov 26, 9:15 pm, Carlos  wrote:
> Hi,
>
> I'm wondering what ever happened with elFinder web file manager?:
>
> http://elrte.org/elfinder/
>
> http://groups.google.com/group/web2py/browse_thread/thread/3af7b48d32...
>
> Is it already integrated with web2py?, for all types of users (admin,
> appadmin, endusers)?.
>
> Is anybody actually using it in production environments?, or was it
> abandoned (why)?.
>
> Is there something better (as a web file manager, integrated with
> web2py) out there?.
>
> Best regards,
>
>    Carlos