[web2py] Re: Required password

2011-05-29 Thread Massimo Di Pierro
On a second thought... I think you want

db.auth_user.requires=[IS_NOT_EMPTY(),CRYPT(auth.settings.hmac_key)]

On May 30, 12:49 am, Dmitriy  wrote:
> Hi,
>
> How I can make required password field in auth_user?
> Adding the 'required = True,' doesn't works.
>
> Field('password', type='password', required = True,  readable=False,
> label=T('Password')),
>
> I use web2py 1.95.1, sqlite on Windows.
>
> Thanks a lot,
> Dmitriy


[web2py] Re: Required password

2011-05-29 Thread Massimo Di Pierro
I think you want notnull=True not required=True.



On May 30, 12:49 am, Dmitriy  wrote:
> Hi,
>
> How I can make required password field in auth_user?
> Adding the 'required = True,' doesn't works.
>
> Field('password', type='password', required = True,  readable=False,
> label=T('Password')),
>
> I use web2py 1.95.1, sqlite on Windows.
>
> Thanks a lot,
> Dmitriy


[web2py] Re: {{=response.toolbar()}}

2011-05-29 Thread Massimo Di Pierro
We can make this better in two ways...

1) make it display its own stylesheet and display as a slide-in/out
panel.
2) have it read the options.profiler file and extract all the profiler
info

1) requires simply a good css designer.
2) requires a little more work to parse the profiler log and extract
the corresponding entry.

On May 30, 12:36 am, "Jason (spot) Brower" 
wrote:
> YEAH!
> Your Increadable!!
> ---
> BR,
> Jason
>
> On Mon, May 30, 2011 at 3:16 AM, Massimo Di Pierro <
>
>
>
>
>
>
>
> massimo.dipie...@gmail.com> wrote:
> > This is in trunk. Give it a try:
>
> > {{=response.toolbar()}}
>
> > display request,response, session and db stats.


[web2py] Required password

2011-05-29 Thread Dmitriy
Hi,

How I can make required password field in auth_user?
Adding the 'required = True,' doesn't works.

Field('password', type='password', required = True,  readable=False,
label=T('Password')),

I use web2py 1.95.1, sqlite on Windows.

Thanks a lot,
Dmitriy


[web2py] Re: {{=response.toolbar()}}

2011-05-29 Thread mattgorecki
Extremely useful.  Thanks.

On May 29, 6:16 pm, Massimo Di Pierro 
wrote:
> This is in trunk. Give it a try:
>
> {{=response.toolbar()}}
>
> display request,response, session and db stats.


Re: [web2py] {{=response.toolbar()}}

2011-05-29 Thread Jason (spot) Brower
YEAH!
Your Increadable!!
---
BR,
Jason

On Mon, May 30, 2011 at 3:16 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> This is in trunk. Give it a try:
>
> {{=response.toolbar()}}
>
> display request,response, session and db stats.


Re: [web2py] Re: experimental... .pdf

2011-05-29 Thread Martin Weissenboeck
Massimo, does markmin2pdflatex understand utf-8?

2011/5/30 Massimo Di Pierro 

> In trunk, web2py tries to use markmin2pdflatex is installed. If not it
> uses pyfpdf. pyfpdf fails on some html, for example if table do not
> follow the pyfpdf specs. I believe Marino is working on making pyfpdf
> more forgiving.
>
> Massimo
>
> On May 29, 10:39 pm, Christopher Steel  wrote:
> > I am going try things out again when I get a chance. This stuff is
> > just great. I love the fact that we build on a solid API so in the end
> > we get the GUI and command line and API access for developers and the
> > blind. It totally rocks!!!
> >
> > Markmin to PDF would be very interesting as well..
> >
> > Chris
> >
> > On May 27, 12:08 pm, Mariano Reingart  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Regarding PyFPDF:
> >
> > > Headers should be rendered.
> >
> > > Tables need at least a first  TH, prior any TD, who indicates column
> > > width (and it is wise to use THEAD and TBODY when you have multiple
> > > pages), see:http://code.google.com/p/pyfpdf/wiki/WriteHTML
> >
> > > 
> > > Header 1header
> > > 2
> > > 
> > > cell 1cell 2
> > > cell 2cell 3
> > > 
> > > 
> >
> > > I'm planning to fix this issues, to cover more basic html conversions.
> >
> > > You can see what can do pyfpdf in this file:
> http://pyfpdf.googlecode.com/files/html.pdf
> >
> > > BTW, did you see the new visual designer of pdf templates?
> >
> > >http://code.google.com/p/pyfpdf/wiki/Templates?ts=1306512231&updated=.
> ..
> >
> > > It is a wx application, and I'm planning to connect it using DAL to
> > > ease template/report generation (I think this is much easier and
> > > manageable way  than converting html).
> >
> > > Best regards,
> >
> > > Mariano Reingarthttp://www.sistemasagiles.com.arhttp://
> reingart.blogspot.com
> >
> > > On Fri, May 27, 2011 at 1:35 AM, Massimo Di Pierro
> >
> > >  wrote:
> > > > There are still problems...it does not render headers and tables...
> >
> > > > On May 26, 11:06 pm, Massimo Di Pierro 
> > > > wrote:
> > > >> I just made a change to trunk about. the new generic.pdf uses pyfpdf
> > > >> and it is smart in locating files for including images.
> >
> > > >> massimo
> >
> > > >> On May 26, 10:44 pm, Christopher Steel 
> wrote:
> >
> > > >> > I think report.pdf required reportlab? Massimo had an application
> for
> > > >> > creating forms that used markmin and latex.
> >
> > > >> > This web2py app includes a plugin that implements an assortment of
> pdf
> > > >> > stuff (mostly your implementation of pyfpdf and the report.pdf,
> was
> > > >> > that a Google thing?.
> >
> > > >> > Anyway the plugin is handy for testing and experimenting and
> includes
> > > >> > some other PDF examples, one with a different font.
> >
> > > >> >http://code.google.com/p/uc-pyfpdf/
> >
> > > >> > If you need some testing let me know, I love PDF's
> >
> > > >> > Cheers,
> >
> > > >> > Chris
> >
> > > >> > On May 26, 3:48 pm, Mariano Reingart  wrote:
> >
> > > >> > > Putting the following code in generic.pdf and getting report.pdf
> does not work?
> > > >> > > (also, per default there is a generic.pdf made by massimo that
> uses
> > > >> > > markmin and latex if I remember it correctly)
> >
> > > >> > > from gluon.contrib.pyfpdf import FPDF, HTMLMixin
> > > >> > > from gluon.sanitizer import sanitize
> >
> > > >> > > class MyFPDF(FPDF, HTMLMixin):
> > > >> > >pass
> >
> > > >> > > pdf=MyFPDF()
> > > >> > > pdf.add_page()
> > > >> > > html=response.render('%s/%s.html' %
> > > >> > > (request.controller,request.function))
> > > >> > > html = sanitize(html, escape=False)
> > > >> > > pdf.write_html(html)
> > > >> > > response.headers['Content-Type']='application/pdf'
> > > >> > > response.write(pdf.output(dest='S'), escape=False)
> >
> > > >> > > Mariano
> Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.comOnThu,
> May 26, 2011 at 4:30 PM, luifran  wrote:
> > > >> > > > if I have a view , for example report.html, how I render this
> view in
> > > >> > > > pdf with the generic pdf?
> >
> > > >> > > > On 4 oct 2010, 17:08, Mariano Reingart 
> wrote:
> > > >> > > >> On Sun, Oct 3, 2010 at 1:10 AM, mdipierro <
> mdipie...@cs.depaul.edu> wrote:
> >
> > > >> > > >> > I am sure this can also be done and better with pyfpdf but
> I have not
> > > >> > > >> > tried. Perhaps Mariano can help us
> >
> > > >> > > >> Having latest web2py versions (including pyfpdf), write in a
> views/generic.pdf:
> >
> > > >> > > >>  begin file 
> > > >> > > >> {{
> >
> > > >> > > >> from gluon.contrib.pyfpdf import FPDF, HTMLMixin
> > > >> > > >> from gluon.sanitizer import sanitize
> >
> > > >> > > >> class MyFPDF(FPDF, HTMLMixin):
> > > >> > > >> pass
> >
> > > >> > > >> pdf=MyFPDF()pdf.add_page()
> > > >> > > >> html=response.render('%s/%s.html' %
> > > >> > > >> (request.controller,request.function))
> > > >> > > >> html = sanitize(html, escape=False)pdf.write_html(html)
> > > >> > > >> response.headers['Content-Type']='application/pdf'
>

[web2py] Re: experimental... .pdf

2011-05-29 Thread Massimo Di Pierro
In trunk, web2py tries to use markmin2pdflatex is installed. If not it
uses pyfpdf. pyfpdf fails on some html, for example if table do not
follow the pyfpdf specs. I believe Marino is working on making pyfpdf
more forgiving.

Massimo

On May 29, 10:39 pm, Christopher Steel  wrote:
> I am going try things out again when I get a chance. This stuff is
> just great. I love the fact that we build on a solid API so in the end
> we get the GUI and command line and API access for developers and the
> blind. It totally rocks!!!
>
> Markmin to PDF would be very interesting as well..
>
> Chris
>
> On May 27, 12:08 pm, Mariano Reingart  wrote:
>
>
>
>
>
>
>
> > Regarding PyFPDF:
>
> > Headers should be rendered.
>
> > Tables need at least a first  TH, prior any TD, who indicates column
> > width (and it is wise to use THEAD and TBODY when you have multiple
> > pages), see:http://code.google.com/p/pyfpdf/wiki/WriteHTML
>
> > 
> > Header 1header
> > 2
> > 
> > cell 1cell 2
> > cell 2cell 3
> > 
> > 
>
> > I'm planning to fix this issues, to cover more basic html conversions.
>
> > You can see what can do pyfpdf in this 
> > file:http://pyfpdf.googlecode.com/files/html.pdf
>
> > BTW, did you see the new visual designer of pdf templates?
>
> >http://code.google.com/p/pyfpdf/wiki/Templates?ts=1306512231&updated=...
>
> > It is a wx application, and I'm planning to connect it using DAL to
> > ease template/report generation (I think this is much easier and
> > manageable way  than converting html).
>
> > Best regards,
>
> > Mariano Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.com
>
> > On Fri, May 27, 2011 at 1:35 AM, Massimo Di Pierro
>
> >  wrote:
> > > There are still problems...it does not render headers and tables...
>
> > > On May 26, 11:06 pm, Massimo Di Pierro 
> > > wrote:
> > >> I just made a change to trunk about. the new generic.pdf uses pyfpdf
> > >> and it is smart in locating files for including images.
>
> > >> massimo
>
> > >> On May 26, 10:44 pm, Christopher Steel  wrote:
>
> > >> > I think report.pdf required reportlab? Massimo had an application for
> > >> > creating forms that used markmin and latex.
>
> > >> > This web2py app includes a plugin that implements an assortment of pdf
> > >> > stuff (mostly your implementation of pyfpdf and the report.pdf, was
> > >> > that a Google thing?.
>
> > >> > Anyway the plugin is handy for testing and experimenting and includes
> > >> > some other PDF examples, one with a different font.
>
> > >> >http://code.google.com/p/uc-pyfpdf/
>
> > >> > If you need some testing let me know, I love PDF's
>
> > >> > Cheers,
>
> > >> > Chris
>
> > >> > On May 26, 3:48 pm, Mariano Reingart  wrote:
>
> > >> > > Putting the following code in generic.pdf and getting report.pdf 
> > >> > > does not work?
> > >> > > (also, per default there is a generic.pdf made by massimo that uses
> > >> > > markmin and latex if I remember it correctly)
>
> > >> > > from gluon.contrib.pyfpdf import FPDF, HTMLMixin
> > >> > > from gluon.sanitizer import sanitize
>
> > >> > > class MyFPDF(FPDF, HTMLMixin):
> > >> > >    pass
>
> > >> > > pdf=MyFPDF()
> > >> > > pdf.add_page()
> > >> > > html=response.render('%s/%s.html' %
> > >> > > (request.controller,request.function))
> > >> > > html = sanitize(html, escape=False)
> > >> > > pdf.write_html(html)
> > >> > > response.headers['Content-Type']='application/pdf'
> > >> > > response.write(pdf.output(dest='S'), escape=False)
>
> > >> > > Mariano 
> > >> > > Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.comOnThu,
> > >> > >  May 26, 2011 at 4:30 PM, luifran  wrote:
> > >> > > > if I have a view , for example report.html, how I render this view 
> > >> > > > in
> > >> > > > pdf with the generic pdf?
>
> > >> > > > On 4 oct 2010, 17:08, Mariano Reingart  wrote:
> > >> > > >> On Sun, Oct 3, 2010 at 1:10 AM, mdipierro 
> > >> > > >>  wrote:
>
> > >> > > >> > I am sure this can also be done and better with pyfpdf but I 
> > >> > > >> > have not
> > >> > > >> > tried. Perhaps Mariano can help us
>
> > >> > > >> Having latest web2py versions (including pyfpdf), write in a 
> > >> > > >> views/generic.pdf:
>
> > >> > > >>  begin file 
> > >> > > >> {{
>
> > >> > > >> from gluon.contrib.pyfpdf import FPDF, HTMLMixin
> > >> > > >> from gluon.sanitizer import sanitize
>
> > >> > > >> class MyFPDF(FPDF, HTMLMixin):
> > >> > > >>     pass
>
> > >> > > >> pdf=MyFPDF()pdf.add_page()
> > >> > > >> html=response.render('%s/%s.html' %
> > >> > > >> (request.controller,request.function))
> > >> > > >> html = sanitize(html, escape=False)pdf.write_html(html)
> > >> > > >> response.headers['Content-Type']='application/pdf'
> > >> > > >> response.write(pdf.output(dest='S'), escape=False)
>
> > >> > > >> }}
>
> > >> > > >>  end file---
>
> > >> > > >> At MyFPDF class you can add headers and footers.
>
> > >> > > >> The sanitize part is to strip some HTML tags that cannot be 
> > >> > > >> rendered
> > >> > > >> (ie. javascript).

[web2py] Re: How do I get a controller to return back to the page that calls it (when it can be called by many pages)?

2011-05-29 Thread Luis Goncalves
Awesome!  Thanks!!!
L.


[web2py] Re: experimental... .pdf

2011-05-29 Thread Christopher Steel
I am going try things out again when I get a chance. This stuff is
just great. I love the fact that we build on a solid API so in the end
we get the GUI and command line and API access for developers and the
blind. It totally rocks!!!

Markmin to PDF would be very interesting as well..

Chris

On May 27, 12:08 pm, Mariano Reingart  wrote:
> Regarding PyFPDF:
>
> Headers should be rendered.
>
> Tables need at least a first  TH, prior any TD, who indicates column
> width (and it is wise to use THEAD and TBODY when you have multiple
> pages), see:http://code.google.com/p/pyfpdf/wiki/WriteHTML
>
> 
> Header 1header
> 2
> 
> cell 1cell 2
> cell 2cell 3
> 
> 
>
> I'm planning to fix this issues, to cover more basic html conversions.
>
> You can see what can do pyfpdf in this 
> file:http://pyfpdf.googlecode.com/files/html.pdf
>
> BTW, did you see the new visual designer of pdf templates?
>
> http://code.google.com/p/pyfpdf/wiki/Templates?ts=1306512231&updated=...
>
> It is a wx application, and I'm planning to connect it using DAL to
> ease template/report generation (I think this is much easier and
> manageable way  than converting html).
>
> Best regards,
>
> Mariano Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.com
>
> On Fri, May 27, 2011 at 1:35 AM, Massimo Di Pierro
>
>  wrote:
> > There are still problems...it does not render headers and tables...
>
> > On May 26, 11:06 pm, Massimo Di Pierro 
> > wrote:
> >> I just made a change to trunk about. the new generic.pdf uses pyfpdf
> >> and it is smart in locating files for including images.
>
> >> massimo
>
> >> On May 26, 10:44 pm, Christopher Steel  wrote:
>
> >> > I think report.pdf required reportlab? Massimo had an application for
> >> > creating forms that used markmin and latex.
>
> >> > This web2py app includes a plugin that implements an assortment of pdf
> >> > stuff (mostly your implementation of pyfpdf and the report.pdf, was
> >> > that a Google thing?.
>
> >> > Anyway the plugin is handy for testing and experimenting and includes
> >> > some other PDF examples, one with a different font.
>
> >> >http://code.google.com/p/uc-pyfpdf/
>
> >> > If you need some testing let me know, I love PDF's
>
> >> > Cheers,
>
> >> > Chris
>
> >> > On May 26, 3:48 pm, Mariano Reingart  wrote:
>
> >> > > Putting the following code in generic.pdf and getting report.pdf does 
> >> > > not work?
> >> > > (also, per default there is a generic.pdf made by massimo that uses
> >> > > markmin and latex if I remember it correctly)
>
> >> > > from gluon.contrib.pyfpdf import FPDF, HTMLMixin
> >> > > from gluon.sanitizer import sanitize
>
> >> > > class MyFPDF(FPDF, HTMLMixin):
> >> > >    pass
>
> >> > > pdf=MyFPDF()
> >> > > pdf.add_page()
> >> > > html=response.render('%s/%s.html' %
> >> > > (request.controller,request.function))
> >> > > html = sanitize(html, escape=False)
> >> > > pdf.write_html(html)
> >> > > response.headers['Content-Type']='application/pdf'
> >> > > response.write(pdf.output(dest='S'), escape=False)
>
> >> > > Mariano 
> >> > > Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.comOnThu,
> >> > >  May 26, 2011 at 4:30 PM, luifran  wrote:
> >> > > > if I have a view , for example report.html, how I render this view in
> >> > > > pdf with the generic pdf?
>
> >> > > > On 4 oct 2010, 17:08, Mariano Reingart  wrote:
> >> > > >> On Sun, Oct 3, 2010 at 1:10 AM, mdipierro  
> >> > > >> wrote:
>
> >> > > >> > I am sure this can also be done and better with pyfpdf but I have 
> >> > > >> > not
> >> > > >> > tried. Perhaps Mariano can help us
>
> >> > > >> Having latest web2py versions (including pyfpdf), write in a 
> >> > > >> views/generic.pdf:
>
> >> > > >>  begin file 
> >> > > >> {{
>
> >> > > >> from gluon.contrib.pyfpdf import FPDF, HTMLMixin
> >> > > >> from gluon.sanitizer import sanitize
>
> >> > > >> class MyFPDF(FPDF, HTMLMixin):
> >> > > >>     pass
>
> >> > > >> pdf=MyFPDF()pdf.add_page()
> >> > > >> html=response.render('%s/%s.html' %
> >> > > >> (request.controller,request.function))
> >> > > >> html = sanitize(html, escape=False)pdf.write_html(html)
> >> > > >> response.headers['Content-Type']='application/pdf'
> >> > > >> response.write(pdf.output(dest='S'), escape=False)
>
> >> > > >> }}
>
> >> > > >>  end file---
>
> >> > > >> At MyFPDF class you can add headers and footers.
>
> >> > > >> The sanitize part is to strip some HTML tags that cannot be rendered
> >> > > >> (ie. javascript).
>
> >> > > >> As some DIVs contents and similar may still pass (like menus), a
> >> > > >> better alternative may be render only certains portions of the page 
> >> > > >> in
> >> > > >> a custom view:
>
> >> > > >> pdf.write_html(str(XML(CENTER(section), sanitize=False)))
>
> >> > > >> Best regards,
>
> >> > > >> Mariano 
> >> > > >> Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.com
>
>


[web2py] Re: misbehaves on a view of a controller with arguments

2011-05-29 Thread Luis Goncalves
Thanks!

I was confused, but the URL doc makes it clear that there are applications, 
controllers, functions, arguments, and variables.

Thx,
L.


[web2py] Re: misbehaves on a view of a controller with arguments

2011-05-29 Thread pbreit
I think that's correct behavior. The browser interprets AAA as part of the 
path, not an arg, and puts my_control.html at the end of the path.

It's always a good idea to use URL() helper. ie: 


c= and f= are optional.

Also, my_control is better called a function.


[web2py] Re: misbehaves on a view of a controller with arguments

2011-05-29 Thread Luis Goncalves
I figured it out ...  

.. use the powerful URL()  helper function!

sorry for the 'spam'
L.


[web2py] misbehaves on a view of a controller with arguments

2011-05-29 Thread Luis Goncalves
Hello!

I have a  controller,  my_control(),  that can be called by itself,  or with 
two  arguments ,   ../default/my_control/AAA  or  .../BBB

In the associated view, my_control.html, I have some  href links that call a 
new controller:

  Compute Value


If I was on the URL   
   .../default/my_control

  this works fine, because the href  becomes  
   .../default/compute_value?id=9

but if instead I am on the URL
   ../default/my_control/AAA

  then the href breaks, because it becomes
   .../default/AAA/compute_value?id=9

That is, it seems thatonly replaces the very last element 
from the URL


Is there a better way to generate a URL to my controller, irrespective of 
what page (with or without arguments)  I am on?

Thanks!!!

Luis.



[web2py] Re: Default user.html

2011-05-29 Thread Massimo Di Pierro
You can disable actions if you use third party authentication.

On May 29, 6:19 pm, Dwayne Blind  wrote:
> Hi,
>
> The following lines are usual :
>
> 
> {{=form}}
> {{if request.args(0)=='login':}}
> {{if not 'register' in auth.settings.actions_disabled:}}   # CONDITION
> N°1
> register
> {{pass}}
> {{if not 'request_reset_password' in
> auth.settings.actions_disabled:}}     # CONDITION N°2
> lost
> password
> {{pass}}
> {{pass}}
> 
>
> The links "register" and "lost password" appear conditionally on the
> conditions 1 and 2. Can somebody explain these conditions to me ? I
> have the impression that these links always appear :)
>
> Thanks a lot,
> Dwayne


[web2py] {{=response.toolbar()}}

2011-05-29 Thread Massimo Di Pierro
This is in trunk. Give it a try:

{{=response.toolbar()}}

display request,response, session and db stats.


[web2py] Default user.html

2011-05-29 Thread Dwayne Blind
Hi,

The following lines are usual :


{{=form}}
{{if request.args(0)=='login':}}
{{if not 'register' in auth.settings.actions_disabled:}}   # CONDITION
N°1
register
{{pass}}
{{if not 'request_reset_password' in
auth.settings.actions_disabled:}} # CONDITION N°2
lost
password
{{pass}}
{{pass}}


The links "register" and "lost password" appear conditionally on the
conditions 1 and 2. Can somebody explain these conditions to me ? I
have the impression that these links always appear :)

Thanks a lot,
Dwayne


Re: [web2py] Re: LOAD: ajax_trap errors...

2011-05-29 Thread howesc
Sebastian,

I agree with your views completely!  i *never* use anything but stable 
releases with my clients, but sometimes when i have issues i get help and 
fixes from the maintainers much more quickly if i can test their fixes in 
trunk.  Help us out (if you can) and confirm that the fix is in trunk and 
will be ready for you with the next stable release.

thanks,

cfh


[web2py] Re: GAE and MySQL

2011-05-29 Thread Massimo Di Pierro
GAE restricts outbound connections except using GAE api, so I doubt
the pymysql driver will work. Moreover it would be very slow because
it will be unable to maintain state.

Massimo



On May 29, 4:55 pm, ra3don  wrote:
> I think this should be possible.
>
> You would just have to do:
> mysql://username:password@IP_OF_MYSQL_SERVER/DB_NAME
>
> I'd also imagine you would have to allow remote users in your MySQL
> database. If i'm not mistaken, the default is to allow only local
> users in, you will have to try your luck.
>
> If you have access to the server, then you should be able to edit: /
> etc/mysql/my.cnf to allow in remote users.
>
> Good Luck. Let me know what happens!
>
> On May 28, 10:29 pm, Ialejandro  wrote:
>
>
>
>
>
>
>
> > Hi every one!!!
>
> > I was wondering if is possible to deploy an app using GAE but taking
> > data from a MySQL server, for example
>
> > I have a free account at 000webhost with MySQL DB and I'd like to use
> > GAE just as a hosting service and connect to my 000webhost DB.
>
> > Is it possible??? if not, any suggestion for a free hosting to fully
> > use web2py???
>
> > Thank's!!!


[web2py] Re: GAE and MySQL

2011-05-29 Thread ra3don
I think this should be possible.

You would just have to do:
mysql://username:password@IP_OF_MYSQL_SERVER/DB_NAME

I'd also imagine you would have to allow remote users in your MySQL
database. If i'm not mistaken, the default is to allow only local
users in, you will have to try your luck.

If you have access to the server, then you should be able to edit: /
etc/mysql/my.cnf to allow in remote users.

Good Luck. Let me know what happens!

On May 28, 10:29 pm, Ialejandro  wrote:
> Hi every one!!!
>
> I was wondering if is possible to deploy an app using GAE but taking
> data from a MySQL server, for example
>
> I have a free account at 000webhost with MySQL DB and I'd like to use
> GAE just as a hosting service and connect to my 000webhost DB.
>
> Is it possible??? if not, any suggestion for a free hosting to fully
> use web2py???
>
> Thank's!!!


[web2py] Re: Missing paramenter?

2011-05-29 Thread mikech
Thanks my Pycharm was reporting it as an error.

[web2py] Re: How do I get a controller to return back to the page that calls it (when it can be called by many pages)?

2011-05-29 Thread mattgorecki
In your db_action() controller, rather than doing a return() at the
end, you could just redirect like so:

redirect(request.env.http_referer)


On May 29, 2:46 pm, Luis Goncalves  wrote:
> Hello All!
>
> There is a database action that I want to do in several views.
>
> Right now, I have it implemented as a link in each view as
>
>      Toggle Status
>
> How do I get my db_action()  controller to return back to the page
> with the link that called it?
>
> Is there a way to cause the browser to do the equivalent of the "back"
> button?
>
> Something like:
>
>      response.view = find_the_controller(request.env.http_referer)
>      return dict()
>
> won't work because I'm not returning the proper dictionary for the
> referring controller.
>
> Maybe something like:
>
>      dict_from_referring_controller =
> run_referring_controller( request.env.http_referer )
>      # ? do I have to define the response view?
>      return dict_from_referring_controller
>
> Perhaps the nicest/cleanest implementation would be with AJAX/JQuery,
> but I haven't learned that yet.
>
> Is there a way to do it with  links?  Or is that super-bad
> form?
>
> Thanks!
> Luis.


[web2py] Re: LOAD needs optional "_class" argument for its wrapper DIV [enhancement request]

2011-05-29 Thread Massimo Di Pierro
In trunk. Try it.


On May 29, 4:03 pm, weheh  wrote:
> Yes, I can confirm that I can get my app to work using id only and
> creating a css entry for that id. Thank you for the suggestion,
> stephanl. But, I stick to my conviction that the LOAD helper should be
> extended to support a _class arg. Cheers.
>
> On May 29, 4:44 pm, weheh  wrote:
>
>
>
>
>
>
>
> > It's possible that might work, although it seems kludgy. I like to use
> > id for naming things, not describing how they are to be displayed.
> > That's what I use class for.
>
> > LOAD produces a DIV, so it makes sense it should take a lot or all of
> > the same arguments as DIV, including _class.
>
> > On May 29, 11:13 am, stephanl  wrote:
>
> > > The LOAD function takes an target argument. I think, this does what you
> > > want.
>
> > > from the book:
> > > target is the id id the target DIV. If it is not specified a random target
> > > id is generated.


[web2py] Re: LOAD needs optional "_class" argument for its wrapper DIV [enhancement request]

2011-05-29 Thread weheh
Yes, I can confirm that I can get my app to work using id only and
creating a css entry for that id. Thank you for the suggestion,
stephanl. But, I stick to my conviction that the LOAD helper should be
extended to support a _class arg. Cheers.

On May 29, 4:44 pm, weheh  wrote:
> It's possible that might work, although it seems kludgy. I like to use
> id for naming things, not describing how they are to be displayed.
> That's what I use class for.
>
> LOAD produces a DIV, so it makes sense it should take a lot or all of
> the same arguments as DIV, including _class.
>
> On May 29, 11:13 am, stephanl  wrote:
>
>
>
>
>
>
>
> > The LOAD function takes an target argument. I think, this does what you
> > want.
>
> > from the book:
> > target is the id id the target DIV. If it is not specified a random target
> > id is generated.


[web2py] How do I get a controller to return back to the page that calls it (when it can be called by many pages)?

2011-05-29 Thread Luis Goncalves
Hello All!

There is a database action that I want to do in several views.

Right now, I have it implemented as a link in each view as

 Toggle Status


How do I get my db_action()  controller to return back to the page
with the link that called it?

Is there a way to cause the browser to do the equivalent of the "back"
button?

Something like:

 response.view = find_the_controller(request.env.http_referer)
 return dict()

won't work because I'm not returning the proper dictionary for the
referring controller.

Maybe something like:

 dict_from_referring_controller =
run_referring_controller( request.env.http_referer )
 # ? do I have to define the response view?
 return dict_from_referring_controller



Perhaps the nicest/cleanest implementation would be with AJAX/JQuery,
but I haven't learned that yet.

Is there a way to do it with  links?  Or is that super-bad
form?

Thanks!
Luis.


[web2py] Re: LOAD needs optional "_class" argument for its wrapper DIV [enhancement request]

2011-05-29 Thread weheh
It's possible that might work, although it seems kludgy. I like to use
id for naming things, not describing how they are to be displayed.
That's what I use class for.

LOAD produces a DIV, so it makes sense it should take a lot or all of
the same arguments as DIV, including _class.

On May 29, 11:13 am, stephanl  wrote:
> The LOAD function takes an target argument. I think, this does what you
> want.
>
> from the book:
> target is the id id the target DIV. If it is not specified a random target
> id is generated.


[web2py] Re: GROUP BY Date, Ignore Time

2011-05-29 Thread Massimo Di Pierro
set = db(db.posts.id).select(db.posts.posted_date, count,
groupby=db.posts.posted_date.year()|db.posts.posted_date.month()|
db.posts.posted_date.day())

On May 29, 2:42 pm, Neodudeman  wrote:
> Hi web2py; I've got some problems.
> I'm attempting to get a count of some rows based on the date; but when
> I attempt the grouping, it includes the time as well, giving me a
> false count. (Since no two rows were created at the exact same second,
> the count never goes above 1 per 'date')
>
> Here's my current code:
>
> count = db.posts.id.count()
> set = db(db.posts.id).select(db.posts.posted_date, count,
> groupby=db.posts.posted_date)
>
> How can I change the groupby to ignore the time portion of the
> posted_date?


[web2py] clarification of usage of auth

2011-05-29 Thread apple
I have added auth to my application using crud. However there are a
couple of areas where it does not act as I was expecting.

1) If I have change a permission from create to update then I now have
both permissions until I log off. I guess it has
cached the old permission somewhere. Is it possible to force any
changes to happen immediately?

2) If I have update permission it allows me to delete as well. Is it
possible to allow update but not delete? As I am using crud in the
application it is the same function for update and delete so it is not
possible to use a decorator nor to put a test within the code for
permissions.


[web2py] components with links inside components ?

2011-05-29 Thread Sebastian E. Ovide
Hi All,

Is anybody using components within components ?

I have a couple of components created as explained by the book. They uses
few links with the cid=request.cid options. One component contains another
component.  When I'm clicking on any of the inner components, the outer
components stop working.

I'm using ajax=True (until when the ajax_trap=False will be fixed) and the
latest stable version 1.95.1)

Is it working as expected ? any workaround ?

Thanks

-- 
Sebastian E. Ovide


[web2py] clarification of usage of auth

2011-05-29 Thread apple
I have added auth to my application using crud. However there are a
couple of areas where it does not act as I was expecting.

1) If I have a permission to create and change it to update it seems
that I now have both permissions until I log off. I guess it has
cached the old permission somewhere. Is it possible to force any
changes to happen immediately?

2) If I have update permission it allows me to delete as well. Is it
possible to allow update but not delete?


[web2py] GROUP BY Date, Ignore Time

2011-05-29 Thread Neodudeman
Hi web2py; I've got some problems.
I'm attempting to get a count of some rows based on the date; but when
I attempt the grouping, it includes the time as well, giving me a
false count. (Since no two rows were created at the exact same second,
the count never goes above 1 per 'date')

Here's my current code:

count = db.posts.id.count()
set = db(db.posts.id).select(db.posts.posted_date, count,
groupby=db.posts.posted_date)

How can I change the groupby to ignore the time portion of the
posted_date?


[web2py] Re: Do I have to re-invent the wheel to display and manage messages between users on a website?

2011-05-29 Thread Luis Goncalves
Yes, in the end likely I'd have to customize whatever I found.

Still, may have been a good base to start from.

thx,
Luis.

On May 29, 4:44 am, Albert Abril  wrote:
> I guess you should make a model called messages, which you must relate it
> within users.
> Depends how you want to it working.
>
> 2011/5/29 Luis Goncalves 
>
>
>
>
>
>
>
> > Hello!
>
> > I'm building an application where logged-in users can send messages to
> > each other (the message gets sent to the recipient's normal email, and
> > they use a link to come back to the site and reply).
>
> > I want a page (ie, controller, view, (and model)) that allows the user
> > to see the messages sent and received, and manage them (delete, reply,
> > etc).  Basically this part of the website is like an email system,
> > except that you don't ever know the other person's email, and can only
> > contact them through the site.
>
> > I was hoping that something like that already exists (a web2py
> > messaging "slice", perhaps?).  I'm sure I can implement it, but it
> > would be clever to use something that already exists (and is likely to
> > be a more thorough and featured implementation) rather than hacking it
> > up from scratch.
>
> > I have been searching, but haven't found anything.
>
> > Does anyone know of anything available that I can use?
>
> > Thanks!!!
>
> > Luis.


[web2py] Re: Do I have to re-invent the wheel to display and manage messages between users on a website?

2011-05-29 Thread Luis Goncalves
Yes, I have something like that already.

But I also want a user to see all the messages he has sent/received
(as a list showing sender, date, and subject), and be able to view the
entire message and reply to it upon selecting one.

Not hard stuff, just would be nice to have something already done and
polished rather than hacking my way at it from zero ...

thanks,
Luis.

On May 29, 5:52 am, Bruno Rocha  wrote:
> You can reuse some code from this appliance:
>
> contact form (store in dbb then sends an 
> email)http://web2py.com/appliances/default/show/10
>
> 
> --
> Bruno Rocha
> [ About me:http://zerp.ly/rochacbruno]
>
> On Sun, May 29, 2011 at 2:09 AM, Luis Goncalves wrote:
>
>
>
>
>
>
>
> > Hello!
>
> > I'm building an application where logged-in users can send messages to
> > each other (the message gets sent to the recipient's normal email, and
> > they use a link to come back to the site and reply).
>
> > I want a page (ie, controller, view, (and model)) that allows the user
> > to see the messages sent and received, and manage them (delete, reply,
> > etc).  Basically this part of the website is like an email system,
> > except that you don't ever know the other person's email, and can only
> > contact them through the site.
>
> > I was hoping that something like that already exists (a web2py
> > messaging "slice", perhaps?).  I'm sure I can implement it, but it
> > would be clever to use something that already exists (and is likely to
> > be a more thorough and featured implementation) rather than hacking it
> > up from scratch.
>
> > I have been searching, but haven't found anything.
>
> > Does anyone know of anything available that I can use?
>
> > Thanks!!!
>
> > Luis.


[web2py] Re: How do I modify the form on default/user/profile ?

2011-05-29 Thread Luis Goncalves
Hello Annet!

Your example helps a lot!  I'm not yet familiar enough with web2py/
python to realize that I could just extend the empty user() controller
(and I don't think I came across an example in the web2py book or the
online examples).

Since I already had my own my_profile() controller, what I did is,

def user():
...
if request.args(0)=='profile'
my_profile_dict = my_profile()
return my_profile_dict
...

I don't know if that's proper usage/style for python/web2py,  but it
works fine!!

Thanks!!!

Luis.

On May 28, 11:22 pm, annet  wrote:
> Hi Luis,
>
> I am not sure I understand your question correctly, but as far as I
> know default/user/profile is based on the auth_user table, to which
> you can add any field you want e.g.
>
> # Custom Auth table definition
> db.define_table(auth.settings.table_user_name,
>     Field('username', length=20, unique=True),
>     Field('first_name', length=128, default='', comment='required'),
>     Field('last_name', length=128, default='', comment='required'),
>     Field('email', length=128, default='', unique=True),
>     Field('hide_email', 'boolean', default=False),
>     Field('phone', length=64, default=''),
>     Field('homepage', requires=IS_EMPTY_OR(IS_URL())),
>     Field('facebook_access_token', writable=False, readable=False),
>     Field('flickr_user', label='Flickr Screenname'),
>     Field('flickr_id', writable=False),#, readable=False), # computed,
> see below
>     Field('twitter_user'),
>     Field('bio', 'text', default=''),
>     Field('ref_friends' , 'list:reference
> '+auth.settings.table_user_name,
>         writable=False, readable=False),
>     Field('password', 'password', length=64, readable=False,
> label='Password'),
>     Field('registration_key', length=512, writable=False,
> readable=False,
>         default=''),
>     Field('reset_password_key', length=512, writable=False,
> readable=False,
>         default=''),
>     Field('registration_id', length=512, writable=False,
> readable=False,
>         default=''),
>     Field('record_created', 'datetime', default=request.now,
> writable=False,
>         readable=False),
>     Field('record_updated', 'datetime', default=request.now,
>         update=request.now, writable=False, readable=False)
>     )
>
> Whether a field is editable in default/user/profile depends on
> writable and readable being True or False.
>
> In one of my apps I wanted the form to display differently, I solved
> this by adding the following lines of code to the default/user
> function:
>
>     form=auth()
>     if isinstance(form,FORM):
>         form[0][-1]
> [1].append(INPUT(_type="button",_value="Cancel",_onclick="window.location=' 
> %s';"%URL(r=request,c='usercms',f='index')))
>     if request.args(0)=='login':
>         form.element(_type='submit')['_value']='Login'
>     if request.args(0)=='profile':
>         response.view='default/profile.html'
>     return dict(form=form)
>
> I hope this point you in the right direction.
>
> Kind regards,
>
> Annet.


[web2py] Re: Thursday, May 26...

2011-05-29 Thread mart
sorry, the table below looks terrible :(

On May 29, 2:26 pm, mart  wrote:
> Hi,
>
> On some days, things move really fast, which is a great thing!,
> but...  also backtracking (going back and taking time go through them)
> isn't so easy...  Does anyone have something to keep track of trunk
> changes when, for example, Massimo submits multiple changes/features
> in one day?
>
> Last Thusrday, I think there were at least 3 of these new features,
> and I only see 2. I remember thinking that are somehow related (kind
> of - i think). Anyways, if someone already has something set up (a
> table or something) with description, change number, paths, etc...),
> would be nice to track these things...
>
> Just thought I'd ask :)  Sometimes syncing the files affected by a
> change we want to look at is easier to manage than grabbing everything
> - at least, that's how I like to manage the ins and outs. But no
> worry, I will come up with something if none already exists.
>
> anyways, was think something simple that would link trunk to release:
>
> TRUNK                                              |  RELEASE
> ___|___
> title                                                      |  title
> ___|___
> submitted to 'REALEASE': T/F       |
> ___|___
> submission number                         |   submission number
> ___|
> affected files                                      |  affected files
> ___|___
> description                                        |
> description
> ___|
> blablabla                                           |    blablabla
>
> Thanks,
> Mart :)


[web2py] Thursday, May 26...

2011-05-29 Thread mart
Hi,

On some days, things move really fast, which is a great thing!,
but...  also backtracking (going back and taking time go through them)
isn't so easy...  Does anyone have something to keep track of trunk
changes when, for example, Massimo submits multiple changes/features
in one day?

Last Thusrday, I think there were at least 3 of these new features,
and I only see 2. I remember thinking that are somehow related (kind
of - i think). Anyways, if someone already has something set up (a
table or something) with description, change number, paths, etc...),
would be nice to track these things...

Just thought I'd ask :)  Sometimes syncing the files affected by a
change we want to look at is easier to manage than grabbing everything
- at least, that's how I like to manage the ins and outs. But no
worry, I will come up with something if none already exists.

anyways, was think something simple that would link trunk to release:

TRUNK  |  RELEASE
___|___
title  |  title
___|___
submitted to 'REALEASE': T/F   |
___|___
submission number |   submission number
___|
affected files  |  affected files
___|___
description|
description
___|
blablabla   |blablabla

Thanks,
Mart :)


[web2py] Re: experimental... .pdf

2011-05-29 Thread mart
Wow! This is really nice! so all that is need for the designer is
wxPython?

Mart :)

On May 27, 12:08 pm, Mariano Reingart  wrote:
> Regarding PyFPDF:
>
> Headers should be rendered.
>
> Tables need at least a first  TH, prior any TD, who indicates column
> width (and it is wise to use THEAD and TBODY when you have multiple
> pages), see:http://code.google.com/p/pyfpdf/wiki/WriteHTML
>
> 
> Header 1header
> 2
> 
> cell 1cell 2
> cell 2cell 3
> 
> 
>
> I'm planning to fix this issues, to cover more basic html conversions.
>
> You can see what can do pyfpdf in this 
> file:http://pyfpdf.googlecode.com/files/html.pdf
>
> BTW, did you see the new visual designer of pdf templates?
>
> http://code.google.com/p/pyfpdf/wiki/Templates?ts=1306512231&updated=...
>
> It is a wx application, and I'm planning to connect it using DAL to
> ease template/report generation (I think this is much easier and
> manageable way  than converting html).
>
> Best regards,
>
> Mariano Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.com
>
> On Fri, May 27, 2011 at 1:35 AM, Massimo Di Pierro
>
>
>
>
>
>
>
>  wrote:
> > There are still problems...it does not render headers and tables...
>
> > On May 26, 11:06 pm, Massimo Di Pierro 
> > wrote:
> >> I just made a change to trunk about. the new generic.pdf uses pyfpdf
> >> and it is smart in locating files for including images.
>
> >> massimo
>
> >> On May 26, 10:44 pm, Christopher Steel  wrote:
>
> >> > I think report.pdf required reportlab? Massimo had an application for
> >> > creating forms that used markmin and latex.
>
> >> > This web2py app includes a plugin that implements an assortment of pdf
> >> > stuff (mostly your implementation of pyfpdf and the report.pdf, was
> >> > that a Google thing?.
>
> >> > Anyway the plugin is handy for testing and experimenting and includes
> >> > some other PDF examples, one with a different font.
>
> >> >http://code.google.com/p/uc-pyfpdf/
>
> >> > If you need some testing let me know, I love PDF's
>
> >> > Cheers,
>
> >> > Chris
>
> >> > On May 26, 3:48 pm, Mariano Reingart  wrote:
>
> >> > > Putting the following code in generic.pdf and getting report.pdf does 
> >> > > not work?
> >> > > (also, per default there is a generic.pdf made by massimo that uses
> >> > > markmin and latex if I remember it correctly)
>
> >> > > from gluon.contrib.pyfpdf import FPDF, HTMLMixin
> >> > > from gluon.sanitizer import sanitize
>
> >> > > class MyFPDF(FPDF, HTMLMixin):
> >> > >    pass
>
> >> > > pdf=MyFPDF()
> >> > > pdf.add_page()
> >> > > html=response.render('%s/%s.html' %
> >> > > (request.controller,request.function))
> >> > > html = sanitize(html, escape=False)
> >> > > pdf.write_html(html)
> >> > > response.headers['Content-Type']='application/pdf'
> >> > > response.write(pdf.output(dest='S'), escape=False)
>
> >> > > Mariano 
> >> > > Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.comOnThu,
> >> > >  May 26, 2011 at 4:30 PM, luifran  wrote:
> >> > > > if I have a view , for example report.html, how I render this view in
> >> > > > pdf with the generic pdf?
>
> >> > > > On 4 oct 2010, 17:08, Mariano Reingart  wrote:
> >> > > >> On Sun, Oct 3, 2010 at 1:10 AM, mdipierro  
> >> > > >> wrote:
>
> >> > > >> > I am sure this can also be done and better with pyfpdf but I have 
> >> > > >> > not
> >> > > >> > tried. Perhaps Mariano can help us
>
> >> > > >> Having latest web2py versions (including pyfpdf), write in a 
> >> > > >> views/generic.pdf:
>
> >> > > >>  begin file 
> >> > > >> {{
>
> >> > > >> from gluon.contrib.pyfpdf import FPDF, HTMLMixin
> >> > > >> from gluon.sanitizer import sanitize
>
> >> > > >> class MyFPDF(FPDF, HTMLMixin):
> >> > > >>     pass
>
> >> > > >> pdf=MyFPDF()pdf.add_page()
> >> > > >> html=response.render('%s/%s.html' %
> >> > > >> (request.controller,request.function))
> >> > > >> html = sanitize(html, escape=False)pdf.write_html(html)
> >> > > >> response.headers['Content-Type']='application/pdf'
> >> > > >> response.write(pdf.output(dest='S'), escape=False)
>
> >> > > >> }}
>
> >> > > >>  end file---
>
> >> > > >> At MyFPDF class you can add headers and footers.
>
> >> > > >> The sanitize part is to strip some HTML tags that cannot be rendered
> >> > > >> (ie. javascript).
>
> >> > > >> As some DIVs contents and similar may still pass (like menus), a
> >> > > >> better alternative may be render only certains portions of the page 
> >> > > >> in
> >> > > >> a custom view:
>
> >> > > >> pdf.write_html(str(XML(CENTER(section), sanitize=False)))
>
> >> > > >> Best regards,
>
> >> > > >> Mariano 
> >> > > >> Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.com


[web2py] Re: Paypal on Appengine

2011-05-29 Thread pbreit
The redirect URL is going to need to look something like this:

https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-1NK66318YB717835M
or
https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-1NK66318YB717835M&useraction=commit

I don't think you need all the escaping. Here what mine looks like:
if result['ACK'][0]=='Success':
token = result['TOKEN'][0]
url = 
'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=commit&token='
redirect('%s%s' % (url, token))

Yes, SUBJECT is optional. It specifies the email address of the seller's 
account. I like to include it to be explicit.

INVNUM is also optional and you need to be careful with it because in most 
cases PayPal enforces uniqueness on this value in your PayPal account.


[web2py] Aw: LOAD needs optional "_class" argument for its wrapper DIV [enhancement request]

2011-05-29 Thread stephanl
The LOAD function takes an target argument. I think, this does what you 
want.

from the book:
target is the id id the target DIV. If it is not specified a random target 
id is generated.




[web2py] Re: TypeError: 'module' object is not callable on globals()

2011-05-29 Thread dlypka
Great news.
Will upgrade.
Thanks!

On May 28, 7:40 pm, Massimo Di Pierro 
wrote:
> This is fixed in trunk.
> You cannot do
>
> from gluon import *
>
> in version before 1.95.1
>
> On May 28, 3:44 pm, dlypka  wrote:
>
>
>
>
>
>
>
> > I am trying to use crud but I get
>
> > TypeError: 'module' object is not callable
> > when I reference
> >    globals() in
>
> >   crud = Crud(globals(), mydb)
>
> > At the top of my source file I have
>
> > from gluon import *
> > from gluon.globals import *
> > from gluon.tools import Crud
>
> > My web2py is Version 1.93.2 (2011-03-04 23:48:59)
>
> > Any ideas?


[web2py] LOAD needs optional "_class" argument for its wrapper DIV [enhancement request]

2011-05-29 Thread weheh
LOAD wraps the loaded contents with a div whose id=.
I need to get that wrapper div to have a particular class for my page
layout to work properly with various jQuery widgets I'm using.
Therefore, could LOAD please be enhanced to take an optional _class
argument?


Re: [web2py] Do I have to re-invent the wheel to display and manage messages between users on a website?

2011-05-29 Thread Bruno Rocha
You can reuse some code from this appliance:

contact form (store in dbb then sends an email)
http://web2py.com/appliances/default/show/10



--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]



On Sun, May 29, 2011 at 2:09 AM, Luis Goncalves wrote:

> Hello!
>
> I'm building an application where logged-in users can send messages to
> each other (the message gets sent to the recipient's normal email, and
> they use a link to come back to the site and reply).
>
> I want a page (ie, controller, view, (and model)) that allows the user
> to see the messages sent and received, and manage them (delete, reply,
> etc).  Basically this part of the website is like an email system,
> except that you don't ever know the other person's email, and can only
> contact them through the site.
>
> I was hoping that something like that already exists (a web2py
> messaging "slice", perhaps?).  I'm sure I can implement it, but it
> would be clever to use something that already exists (and is likely to
> be a more thorough and featured implementation) rather than hacking it
> up from scratch.
>
> I have been searching, but haven't found anything.
>
> Does anyone know of anything available that I can use?
>
> Thanks!!!
>
> Luis.


[web2py] Do I have to re-invent the wheel to display and manage messages between users on a website?

2011-05-29 Thread pbreit
I haven't seen anyhin like that ready to go. I'm building an 
eBay/craigslist-like app so would be mildly interesting. By the way, I have 
recently switched from amazon ses to sendgrid for emailing (pricetack.com).


[web2py] Re: Paypal on Appengine

2011-05-29 Thread pbreit
I'll take a closer look tomorrow. For one thing you are mixing production API 
calls with a sandbox URL. With express checkout I usually work exclusively on 
production. Seems to be easier. You can do refunds.


[web2py] Confusing about FORM created and then printing it...

2011-05-29 Thread Jason Brower

I have created a form as follows:
invitation_form = FORM('Invitations List:', 
TEXTAREA(_name='invitations', requires=IS_NOT_EMPTY()),
"Subject:", INPUT(_name='subject', 
requires=IS_NOT_EMPTY()),
"Message:", 
TEXTAREA(_name='message', requires=IS_NOT_EMPTY()),

INPUT(_type='submit', _value="Send"))
And it works...
but when it displays it doesn't look like the other forms.
For example when I have an SQLFORM it never shows like this.  Is there a 
way for me to:

1: Print the form easily like with SQLFORM
and
2: Print field that I have out to make a specially made form.
I would looking here in the book: 
http://web2py.com/book/default/chapter/07#Custom-forms

But I couldn't apply the example here directly.
---
Best Regards,
Jason Brower


[web2py] Re: What is documentation top priotity?

2011-05-29 Thread weheh
Components with file upload needs improved doc ... with and without
ajax, e.g. ajax=True and ajax=False.

On May 28, 11:38 pm, Vinicius Assef  wrote:
> Hey guys,
> I had volunteered to help in documentation.
>
> In your oppinion, what would be the top priority to work on?
>
> --
> Vinicius Assef.


Re: [web2py] Do I have to re-invent the wheel to display and manage messages between users on a website?

2011-05-29 Thread Albert Abril
I guess you should make a model called messages, which you must relate it
within users.
Depends how you want to it working.




2011/5/29 Luis Goncalves 

> Hello!
>
> I'm building an application where logged-in users can send messages to
> each other (the message gets sent to the recipient's normal email, and
> they use a link to come back to the site and reply).
>
> I want a page (ie, controller, view, (and model)) that allows the user
> to see the messages sent and received, and manage them (delete, reply,
> etc).  Basically this part of the website is like an email system,
> except that you don't ever know the other person's email, and can only
> contact them through the site.
>
> I was hoping that something like that already exists (a web2py
> messaging "slice", perhaps?).  I'm sure I can implement it, but it
> would be clever to use something that already exists (and is likely to
> be a more thorough and featured implementation) rather than hacking it
> up from scratch.
>
> I have been searching, but haven't found anything.
>
> Does anyone know of anything available that I can use?
>
> Thanks!!!
>
> Luis.


Re: [web2py] Re: LOAD: ajax_trap errors...

2011-05-29 Thread Sebastian E. Ovide
No, I'm not using trunk. We are using web2py as a stable and robust
enterprise framework and I'm sure that you would understand that it goes out
of our budget to invest in maintaining the same framework which aim is to
save us money.

I'll wait patiently to the next "stable" version

Thanks

On Sun, May 29, 2011 at 12:36 AM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> If you are not using trunk, can you try trunk?
>
>

Sebastian E. Ovide


[web2py] Re: What is documentation top priotity?

2011-05-29 Thread cjrh
On May 29, 5:38 am, Vinicius Assef  wrote:
> In your oppinion, what would be the top priority to work on?

If you write new sections, I am happy to proof-read for you.  I just
don't have too much time to write such sections myself, and do the
testing work required to get the technical accuracy correct.


[web2py] Re: Highest ID and UPDATE table with variable

2011-05-29 Thread Blackpainter
Thank you so much, everything is working now =).

my deepest thanks,
Blackpainter

On 29 Mai, 01:50, Massimo Di Pierro 
wrote:
> My mistake:
>
> max_id = db(db.table).select(db.table.id.max()).first()
> [db.table.id.max()]
> and
> db(db.table.id==max_id).update(field='avariable')
>
> On May 28, 10:23 am, Massimo Di Pierro 
> wrote:
>
> > max_id = db(db.table).select(db.table.id.max())
> > and
> > db(db.table.id==max_id).update(field='avariable')
>
> > or
>
> > db(db.table.id.belongs(db(db.table)._select(db.table.id.max())).update(fiel 
> > d='avariable')
>
> > but you should not count on id being sequential. That is not true on
> > GAE and it is not true for other NoSQL which we partially support. You
> > should use a datetime timestemp.
>
> > On May 28, 3:22 am, Blackpainter  wrote:
>
> > > Hi all,
>
> > > im pretty new to web2py and encountered a little problem.
> > > i need to find the highest ID in my table ( which through other
> > > threads i
> > > already accomplished) and update another field in this entry with an
> > > variable.
> > > (db.table.insert(field=db.table.field.store(request.body,'picture.jpg'))
>
> > > i started with:
> > > db.executesql(""" UPDATE table SET field='*variable*' WHERE id=(SELECT
> > > MAX(id) FROM table)""")
>
> > > but kinda reached a dead end as its probably not possible to include
> > > my
> > > variable in the executesql command.
> > > The Variable comes from a flash application, which takes a webcam foto
> > > and
> > > accesses a function in web2py.
> > > plz, help, cant help myself :/
>
> > > Your newbie,
> > > Blackpainter
>
>