[web2py] Re: Custom registration form -- password_two [OPEN]

2010-05-24 Thread weheh
OK, this is reopened. It doesn't seem to matter whether the passwords
are the same or different. If different, no error message is flashed.
If same and the other fields entered correctly, the form doesn't seem
to submit, the db isn't updated, and the page redirects right back to
register again.

Again, if anyone has a working example of a custom submit MCV I would
very much like to see the whole thing. From the number of threads
discussing this problem, I suggest a working example be published in
an easy to find location.


[web2py] Re: hiding email password

2010-05-24 Thread howesc
GAE has magic around sending emails.  Someone extended the Mail()
class in web2py to work with this magic.  basically you don't need
passwords to send from a GAE application if you are sending mail as
one of the administrators.   your configuration for mail should look
like:

mail=Mail()  # mailer
mail.settings.server='gae'# your SMTP server
mail.settings.sender='exam...@example.com' # your email
auth.settings.mailer=mail# for user email
verification

and it will send mail.  no password required.  if a user is logged in
via google accounts you can also send mail from that user.  i'm
using that for a support form - it sends mail to my support address
from the logged in user.  no passwords, it just works.  pretty nifty,
eh?

good luck,

cfh

On May 23, 9:51 am, mattynoce mattyn...@gmail.com wrote:
 hi, i have a question about sending emails. i'm running my program on
 google app engine, and due to google's rules i need to have an
 administrator as the from for all my emails. so i created an
 account, let's call it sampleemai...@gmail.com, figuring that would
 be the from for all my emails for now.

 to send emails, sampleemai...@gmail.com needs to be an administrator
 of the application on gae, so i did that. but i'm in a situation where
 i'm sharing code with other developers i need to work with but don't
 want to give them admin access.

 in db.py, i have the following lines:
 mail.settings.sender='sampleemai...@gmail.com'
 mail.settings.login='sampleemai...@gmail.com:testPassword'

 but by giving web2py my email password, i'm actually giving other
 developers full administrative access to my application on gae.

 i recognize this isn't a web2py problem, but it's an issue i need to
 solve. does anyone have any ideas of how to get around this?

 thanks,

 matt


[web2py] imageshow

2010-05-24 Thread mdipierro
I was trying to convert a new potential customer on reddit so I made
this:

http://www.reddit.com/r/Python/comments/c7f0a/best_choice_for_this_application/c0qmtfm

It may be useful to some of you. The galleria.js plugin is incomplete
but works.

Massimo


[web2py] Re: monetize web2py anybody?

2010-05-24 Thread Adi
I'm in too. Is there any similar model working successfully? Might
help us.

On May 24, 10:08 am, weheh richard_gor...@verizon.net wrote:
 @mdp: Consider me in.

 I agree with the toolset. I am moving from YUI to jQuery and the move
 has gone well. I still use YUI to reset the grid.

 I've already worked with a chosen few web2py-ers on various consulting
 gigs. I thought the interactions were very positive and would like to
 work with them some more if possible, as well as expand the circle.
 This is a good community.

 I position to my clients that I am not a one-man show, but rather a
 program manager for a virtual company. I believe this resonates with
 your idea. I agree with many of the points you make here. Need to
 think about it some more to understand how to contribute.


[web2py] auth.login problem - redirect on error

2010-05-24 Thread arnaud
Hi all,

in my controller site.py, i have this code for display a login
form :

def login() :
return
dict(form=auth.login(next=URL(a='helloworld',c='admin',f='index')))

When i try to login, if my login codes are correct, no problem. I am
redirected to admin/index. But on error, I am redirected to an another
controller, /default/login. Why ?

How control redirection on error ?

Thanks.



[web2py] Re: crud problem

2010-05-24 Thread annet
Massimo,

Thanks for pointing me in the right direction, I had to add the next
argument to the crud.update() function to get the check to delete work
properly. There's one small problem to solve, when the user logs in
the flash reads: Logged in. Whereas, I would like it to read 'Insert
tagline' or 'Update tagline'.

The function:

@auth.requires_login()
def index():
response.functionname='Basic account'
 
record=db(db.tagline.bedrijf_id==auth.user.bedrijf_id).select().first()
if record:
if not response.init_flash: response.init_flash='Update
tagline'
message='Tagline updated'
else:
if not response.init_flash: response.init_flash='Insert
tagline'
message='Tagline inserted'
db.tagline.bedrijf_id.default=auth.user.bedrijf_id
 
form=crud.update(db.tagline,record,next=(URL(r=request,f='index')),message=message)
return dict(form=form)


The view:

div id=oneColLayout
  div id=primarycontent
{{if response.functionname:}}
  h2{{=response.functionname}}/h2
{{pass}}
{{if response.flash:}}
  div class=flash
{{=response.flash}}
  /div !-- flash --
{{else:}}
  div class=flash
{{=response.init_flash}}
  /div !-- flash --
{{pass}}
{{if form:}}
  {{=form}}
{{pass}}
  /div !-- primarycontent --
/div !-- oneColLayout --



Kind regards,

Annet.


[web2py] Re: auth.login problem - redirect on error

2010-05-24 Thread annet
Hi Arnaud,

Why don't you use default/user/login and set
auth.settings.login_next=URL(a='helloworld',c='admin',f='index'), in
that case, when login fails there is no need to redirect. When you
need a custom Invalid login message just set:
auth.messages.invalid_login='your customized message'


Kind regards,

Annet.


[web2py] Re: parsehtml

2010-05-24 Thread Iceberg
I did not try but I assume the builtin python module HTMLParser
already handle at least (1) tags like input /, not sure about (2)
and (3).

On May24, 4:32am, mdipierro mdipie...@cs.depaul.edu wrote:
 hmmm somehow I did not save comments in the file.

 This does not handle well:

 1) tags like input /
 2) attributes that contain  in quotes a onclick=if(ab)alert()
 3) attributes that contain escaped quotes a onclick=var a=\x\

 On May 23, 10:46 am, Massimo Di Pierro mdipie...@cs.depaul.edu
 wrote:



  Anybody interested in helping with this?

  It scrapes an html files and converts into a tree hierarchy of web2py  
  helpers

  'divxxx/div' - DIV('xxx')

  It kind of works but fails at three exceptions described in the file.

  Massimo

   parsehtml.py
  1KViewDownload


[web2py] Ajax style calls blocking

2010-05-24 Thread eddie
Hi guys,

I'm looking for some help on allowing controller functions to respond
to ajax calls from a view in parallel. I've got my head around the
basic web2py architecture, but this is my first time trying out ajax
in web2py.

Here's the problem. I have a simple view that makes a number of ajax
calls, to provide delay loading of data. The results are from querying
and parsing URLs on demand, so they can be slow. The controller
function I am calling (default/results_data) appears to be blocking,
only executing one request at a time. This obviously defeats the
purpose of delay loading the data on the page.

I have made sure I am running the web2py app locally with the -n
option (for threads), but this isn't the issue. I have found the
session.forget() call, but this isn't it either.

I am guessing there is something fundamental that I am doing wrong
here, I am hoping someone can clarify what is required to allow the
controller functions that respond to the ajax query to execute in
parallel, without blocking.

A snippet from the html generated by the view:

function sendRequest(url,callback,postData) {
try {
var req = createXMLHTTPObject();
if (!req) return;
var method = (postData) ? POST : GET;
req.open(method,url,true);
req.setRequestHeader('User-Agent','XMLHTTP/1.0');
if (postData)

req.setRequestHeader('Content-Type','application/x-www-form-
urlencoded');
req.onreadystatechange = function () {
if (req.readyState != 4) return;
if (req.status != 200  req.status != 304) {
alert('HTTP error ' + req.status);
return;
}
callback(req);
}

if (req.readState ==  4) return;
req.send(postData);
}
catch (e) {
throw e;//alert(e);
}
}
...
script
function source1_results(req)
{document.getElementById('query1_results').innerHTML =
req.responseText;}
sendRequest('/myapp/default/results_data?
query=foosource_name=source1', source1_results)
function souce2_results(req)
{document.getElementById('source2_results').innerHTML =
req.responseText;}
sendRequest('/myapp/default/results_data?
query=foosource_name=source2', source2_results)
/script
...
table
trtdsource1/tdtd id=source1_resultsLoading.../tdtda
href=http://...;View page/a/td/tr
trtdsource2/tdtd id=source2_resultsLoading.../tdtda
href=http://...;View page/a/td/tr
/table


[web2py] Re: monetize web2py anybody?

2010-05-24 Thread dbb
Massimo:

First this is noble idea, we need a point man like you Massimo whom we
describe the function and put the money we are willing to pay for the
function at your disposal, you have a say whether the money is enough
or not enough and clarity of the task  before contacting the
associate, then once everything is in order, the associate is
contacted, the description and the fee will be discussed and the
associate takes the description and performs the work and hand it to
Massimo and the fee will be paid by Massimo ( this one is sure, it is
Massimo who has the money and pays the associate). The description of
the work is in writing. All evaluations, conduct, rules, and etc must
be a joint task of all.

Debebe

On May 23, 11:20 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 Getafreelancer is what some of my students use to get their homework
 done. Does not resonate very well with me. :-(

 Massimo

 On May 23, 10:15 pm, Álvaro Justen alv...@justen.eng.br wrote:

  On Sun, May 23, 2010 at 20:18, mdipierro mdipie...@cs.depaul.edu wrote:
   I have some problems:

   1) people ask me to contribute to more projects that I can handle.
   2) I am good at kicking off a project (20% of the work) but I am not
   the best person to bring it to production (the other 80%) of the work.
   3) I want to delegate some of these projects to users I trust. I need
   to better keep track of you, the users, your skills and interests.

   You and I have some problems in common:
   1)  you are an individual or you own a small consulting company and
   you find hard to compete for large projects
   2) you want to use web2py but you need to sell web2py before you can
   sell yoru services.
   3) you need legal help (sample non-disclosure agreement, sample
   contracts, etc.)
   4) for large projects you need to find people who can help you with
   development (you man need a designer, a coder, a system administrator,
   a GAE expert, etc).
   5) you want somebody else to handle advertising for you

   I want to help. I want to help you find development jobs, network, and
   compete for larger projects by providing some assistance.

   I am about to create something like an association of web2py
   professionals with a portal that provides web sites for members,
   repository of legal forms, job posting, progress tracking, feedback
   forms, etc. Here is the basic idea: we do not advertise web2py, we
   advertise the association and its members. you find a client? you keep
   all the money. You want to offer your client long term support or code
   review? the association will sell that to the client directly
   directly. You want to be listed as a member? Follow a code of conduct
   (basically use approved tools and ask your clients to review your work
   publicly). You already have a consulting company or an employer? You
   can have the company listed as an associate under some conditions.

   We can turn our group into a large international consulting
   organization overnight. There would be no contract between the
   association and you other than a code of conduct that you will have to
   follow to be listed and that I am about to wrote. You can continue to
   work as an individual or with your existing company. The association
   will just help when you need help.

   The association may also partner with some member to provide venture
   capital in the form of code development (and perhaps money but not
   immediately) for specific projects submitted to the association, in
   exchange of shares.

   I have already incorporated to do this. This will be independent and
   complementary form web2py itself and web2py would not be the onlytool
   in the association approved toolkit.

   For now the toolkit will include: web2py, ubuntu, postgresql, jquery,
   andgoogleapp engine. You as an individual or a company can provide
   services based on other tools but the association will endorse these
   tools because we can easily find people skilled in them and you, as a
   member, will be required to endorse these tools as good tools and
   demonstrate your skills in some of them (not all of them).

   web2py is atool. We will all outlive web2py. But we have created
   something important here. A community of skilled professional that
   share some experience. I want to see this grow with web2py and beyond
   web2py later. I want to see us compete with large consulting
   companies. I want to do it using a new business model in which there
   are no shareholders to take a cut of your work since they would not be
   providing any means of production to you (you already own a laptop and
   that is your office), yet I want to provide the other benefits that a
   large corporation can offer (a single image, consistency,
   reliability).

   Not sure if there should be an admission criteria. I could use your
   feedback about this.

   Comments? Thought? You do not have to commit to anything now but who
   is interested?

  I'm very 

[web2py] Re: monetize web2py anybody?

2010-05-24 Thread blackthorne
On May 24, 12:18 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I have some problems:

 1) people ask me to contribute to more projects that I can handle.
 2) I am good at kicking off a project (20% of the work) but I am not
 the best person to bring it to production (the other 80%) of the work.
 3) I want to delegate some of these projects to users I trust. I need
 to better keep track of you, the users, your skills and interests.

 You and I have some problems in common:
 1)  you are an individual or you own a small consulting company and
 you find hard to compete for large projects
 2) you want to use web2py but you need to sell web2py before you can
 sell yoru services.
 3) you need legal help (sample non-disclosure agreement, sample
 contracts, etc.)
 4) for large projects you need to find people who can help you with
 development (you man need a designer, a coder, a system administrator,
 a GAE expert, etc).
 5) you want somebody else to handle advertising for you

 I want to help. I want to help you find development jobs, network, and
 compete for larger projects by providing some assistance.

 I am about to create something like an association of web2py
 professionals with a portal that provides web sites for members,
 repository of legal forms, job posting, progress tracking, feedback
 forms, etc. Here is the basic idea: we do not advertise web2py, we
 advertise the association and its members. you find a client? you keep
 all the money. You want to offer your client long term support or code
 review? the association will sell that to the client directly
 directly. You want to be listed as a member? Follow a code of conduct
 (basically use approved tools and ask your clients to review your work
 publicly). You already have a consulting company or an employer? You
 can have the company listed as an associate under some conditions.

 We can turn our group into a large international consulting
 organization overnight. There would be no contract between the
 association and you other than a code of conduct that you will have to
 follow to be listed and that I am about to wrote. You can continue to
 work as an individual or with your existing company. The association
 will just help when you need help.

 The association may also partner with some member to provide venture
 capital in the form of code development (and perhaps money but not
 immediately) for specific projects submitted to the association, in
 exchange of shares.

 I have already incorporated to do this. This will be independent and
 complementary form web2py itself and web2py would not be the only tool
 in the association approved toolkit.

 For now the toolkit will include: web2py, ubuntu, postgresql, jquery,
 and google app engine. You as an individual or a company can provide
 services based on other tools but the association will endorse these
 tools because we can easily find people skilled in them and you, as a
 member, will be required to endorse these tools as good tools and
 demonstrate your skills in some of them (not all of them).

 web2py is a tool. We will all outlive web2py. But we have created
 something important here. A community of skilled professional that
 share some experience. I want to see this grow with web2py and beyond
 web2py later. I want to see us compete with large consulting
 companies. I want to do it using a new business model in which there
 are no shareholders to take a cut of your work since they would not be
 providing any means of production to you (you already own a laptop and
 that is your office), yet I want to provide the other benefits that a
 large corporation can offer (a single image, consistency,
 reliability).

 Not sure if there should be an admission criteria. I could use your
 feedback about this.

 Comments? Thought? You do not have to commit to anything now but who
 is interested?

 Massimo

Eventually, I intend to open my small business and I'm not that
confident that I will ever get enough market by exclusively working on
IT security, my area. I don't neglect the possibility of including web
development not only as a way (become web is, for me, the most
powerful interface) but also as an end, even if not an exclusive one.
So, either way I will use web development and when it comes to fruit,
after intense research, I consider web2py the right one to get the
best  juice.

as you all know, I'm an idiot (literally) with many good and bad ideas
always emerging and yet I only share about 10% on this ML so that you
don't get too bored and I don't see my efforts dissolved. I had this
idea some time ago and I even started some work which could be used to
retrieve ideas on a possible implementation.

I do think this as a great idea and if it wasn't by Massimo I would
probably neglect it as he, with a Physics background and with his
intense workload still manages to keep web2py in constant evolution
with a very responsive attitude. However, web2py is growing at a rate
that goes beyond any 

[web2py] Re: monetize web2py anybody?

2010-05-24 Thread blackthorne
Eventually, I intend to open my small business and I'm not that
confident that I will ever get enough market by exclusively working
on
IT security, my area. I don't neglect the possibility of including
web
development not only as a way (become web is, for me, the most
powerful interface) but also as an end, even if not an exclusive one.
So, either way I will use web development and when it comes to fruit,
after intense research, I consider web2py the right one to get the
best  juice.

as you all know, I'm an idiot (literally) with many good and bad
ideas
always emerging and yet I only share about 10% on this ML so that you
don't get too bored and I don't see my efforts dissolved. I had this
idea some time ago and I even started some work which could be used
to
retrieve ideas on a possible implementation.

I do think this as a great idea and if it wasn't by Massimo I would
probably neglect it as he, with a Physics background and with his
intense workload still manages to keep web2py in constant evolution
with a very responsive attitude. However, web2py is growing at a rate
that goes beyond any programming wolverine and it's now much more
than
a program. This is not just a great idea, it's a must, really!!

Best regards,
Francisco Gama T. R.


On May 24, 12:18 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I have some problems:

 1) people ask me to contribute to more projects that I can handle.
 2) I am good at kicking off a project (20% of the work) but I am not
 the best person to bring it to production (the other 80%) of the work.
 3) I want to delegate some of these projects to users I trust. I need
 to better keep track of you, the users, your skills and interests.

 You and I have some problems in common:
 1)  you are an individual or you own a small consulting company and
 you find hard to compete for large projects
 2) you want to use web2py but you need to sell web2py before you can
 sell yoru services.
 3) you need legal help (sample non-disclosure agreement, sample
 contracts, etc.)
 4) for large projects you need to find people who can help you with
 development (you man need a designer, a coder, a system administrator,
 a GAE expert, etc).
 5) you want somebody else to handle advertising for you

 I want to help. I want to help you find development jobs, network, and
 compete for larger projects by providing some assistance.

 I am about to create something like an association of web2py
 professionals with a portal that provides web sites for members,
 repository of legal forms, job posting, progress tracking, feedback
 forms, etc. Here is the basic idea: we do not advertise web2py, we
 advertise the association and its members. you find a client? you keep
 all the money. You want to offer your client long term support or code
 review? the association will sell that to the client directly
 directly. You want to be listed as a member? Follow a code of conduct
 (basically use approved tools and ask your clients to review your work
 publicly). You already have a consulting company or an employer? You
 can have the company listed as an associate under some conditions.

 We can turn our group into a large international consulting
 organization overnight. There would be no contract between the
 association and you other than a code of conduct that you will have to
 follow to be listed and that I am about to wrote. You can continue to
 work as an individual or with your existing company. The association
 will just help when you need help.

 The association may also partner with some member to provide venture
 capital in the form of code development (and perhaps money but not
 immediately) for specific projects submitted to the association, in
 exchange of shares.

 I have already incorporated to do this. This will be independent and
 complementary form web2py itself and web2py would not be the only tool
 in the association approved toolkit.

 For now the toolkit will include: web2py, ubuntu, postgresql, jquery,
 and google app engine. You as an individual or a company can provide
 services based on other tools but the association will endorse these
 tools because we can easily find people skilled in them and you, as a
 member, will be required to endorse these tools as good tools and
 demonstrate your skills in some of them (not all of them).

 web2py is a tool. We will all outlive web2py. But we have created
 something important here. A community of skilled professional that
 share some experience. I want to see this grow with web2py and beyond
 web2py later. I want to see us compete with large consulting
 companies. I want to do it using a new business model in which there
 are no shareholders to take a cut of your work since they would not be
 providing any means of production to you (you already own a laptop and
 that is your office), yet I want to provide the other benefits that a
 large corporation can offer (a single image, consistency,
 reliability).

 Not sure if there should be an admission 

[web2py] Re: monetize web2py anybody?

2010-05-24 Thread blackthorne
Eventually, I intend to open my small business and I'm not that
confident that I will ever get enough market by exclusively working
on IT security, my area. I don't neglect the possibility of including
web development not only as a way (become web is, for me, the most
powerful interface) but also as an end, even if not an exclusive one.
So, either way I will use web development and when it comes to fruit,
after intense research, I consider web2py the right one to get the
best  juice.

as you all know, I'm an idiot (literally) with many good and bad
ideas always emerging and yet I only share about 10% on this ML so
that you
don't get too bored and I don't see my efforts dissolved. I had this
idea some time ago and I even started some work which could be used
to retrieve ideas on a possible implementation.

I do think this as a great idea and if it wasn't by Massimo I would
probably neglect it as he, with a Physics background and with his
intense workload still manages to keep web2py in constant evolution
with a very responsive attitude. However, web2py is growing at a rate
that goes beyond any programming wolverine and it's now much more
than a program. This is not just a great idea, it's a must, really!!

Best regards,
Francisco Gama T. R.


On May 24, 12:18 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I have some problems:

 1) people ask me to contribute to more projects that I can handle.
 2) I am good at kicking off a project (20% of the work) but I am not
 the best person to bring it to production (the other 80%) of the work.
 3) I want to delegate some of these projects to users I trust. I need
 to better keep track of you, the users, your skills and interests.

 You and I have some problems in common:
 1)  you are an individual or you own a small consulting company and
 you find hard to compete for large projects
 2) you want to use web2py but you need to sell web2py before you can
 sell yoru services.
 3) you need legal help (sample non-disclosure agreement, sample
 contracts, etc.)
 4) for large projects you need to find people who can help you with
 development (you man need a designer, a coder, a system administrator,
 a GAE expert, etc).
 5) you want somebody else to handle advertising for you

 I want to help. I want to help you find development jobs, network, and
 compete for larger projects by providing some assistance.

 I am about to create something like an association of web2py
 professionals with a portal that provides web sites for members,
 repository of legal forms, job posting, progress tracking, feedback
 forms, etc. Here is the basic idea: we do not advertise web2py, we
 advertise the association and its members. you find a client? you keep
 all the money. You want to offer your client long term support or code
 review? the association will sell that to the client directly
 directly. You want to be listed as a member? Follow a code of conduct
 (basically use approved tools and ask your clients to review your work
 publicly). You already have a consulting company or an employer? You
 can have the company listed as an associate under some conditions.

 We can turn our group into a large international consulting
 organization overnight. There would be no contract between the
 association and you other than a code of conduct that you will have to
 follow to be listed and that I am about to wrote. You can continue to
 work as an individual or with your existing company. The association
 will just help when you need help.

 The association may also partner with some member to provide venture
 capital in the form of code development (and perhaps money but not
 immediately) for specific projects submitted to the association, in
 exchange of shares.

 I have already incorporated to do this. This will be independent and
 complementary form web2py itself and web2py would not be the only tool
 in the association approved toolkit.

 For now the toolkit will include: web2py, ubuntu, postgresql, jquery,
 and google app engine. You as an individual or a company can provide
 services based on other tools but the association will endorse these
 tools because we can easily find people skilled in them and you, as a
 member, will be required to endorse these tools as good tools and
 demonstrate your skills in some of them (not all of them).

 web2py is a tool. We will all outlive web2py. But we have created
 something important here. A community of skilled professional that
 share some experience. I want to see this grow with web2py and beyond
 web2py later. I want to see us compete with large consulting
 companies. I want to do it using a new business model in which there
 are no shareholders to take a cut of your work since they would not be
 providing any means of production to you (you already own a laptop and
 that is your office), yet I want to provide the other benefits that a
 large corporation can offer (a single image, consistency,
 reliability).

 Not sure if there should be an admission 

[web2py] Re: monetize web2py anybody?

2010-05-24 Thread Richard
I am interested, and glad you brought this up again:
http://groups.google.com/group/web2py/browse_thread/thread/226863714adbb7cb



On May 24, 9:18 am, mdipierro mdipie...@cs.depaul.edu wrote:
 I have some problems:

 1) people ask me to contribute to more projects that I can handle.
 2) I am good at kicking off a project (20% of the work) but I am not
 the best person to bring it to production (the other 80%) of the work.
 3) I want to delegate some of these projects to users I trust. I need
 to better keep track of you, the users, your skills and interests.

 You and I have some problems in common:
 1)  you are an individual or you own a small consulting company and
 you find hard to compete for large projects
 2) you want to use web2py but you need to sell web2py before you can
 sell yoru services.
 3) you need legal help (sample non-disclosure agreement, sample
 contracts, etc.)
 4) for large projects you need to find people who can help you with
 development (you man need a designer, a coder, a system administrator,
 a GAE expert, etc).
 5) you want somebody else to handle advertising for you

 I want to help. I want to help you find development jobs, network, and
 compete for larger projects by providing some assistance.

 I am about to create something like an association of web2py
 professionals with a portal that provides web sites for members,
 repository of legal forms, job posting, progress tracking, feedback
 forms, etc. Here is the basic idea: we do not advertise web2py, we
 advertise the association and its members. you find a client? you keep
 all the money. You want to offer your client long term support or code
 review? the association will sell that to the client directly
 directly. You want to be listed as a member? Follow a code of conduct
 (basically use approved tools and ask your clients to review your work
 publicly). You already have a consulting company or an employer? You
 can have the company listed as an associate under some conditions.

 We can turn our group into a large international consulting
 organization overnight. There would be no contract between the
 association and you other than a code of conduct that you will have to
 follow to be listed and that I am about to wrote. You can continue to
 work as an individual or with your existing company. The association
 will just help when you need help.

 The association may also partner with some member to provide venture
 capital in the form of code development (and perhaps money but not
 immediately) for specific projects submitted to the association, in
 exchange of shares.

 I have already incorporated to do this. This will be independent and
 complementary form web2py itself and web2py would not be the only tool
 in the association approved toolkit.

 For now the toolkit will include: web2py, ubuntu, postgresql, jquery,
 and google app engine. You as an individual or a company can provide
 services based on other tools but the association will endorse these
 tools because we can easily find people skilled in them and you, as a
 member, will be required to endorse these tools as good tools and
 demonstrate your skills in some of them (not all of them).

 web2py is a tool. We will all outlive web2py. But we have created
 something important here. A community of skilled professional that
 share some experience. I want to see this grow with web2py and beyond
 web2py later. I want to see us compete with large consulting
 companies. I want to do it using a new business model in which there
 are no shareholders to take a cut of your work since they would not be
 providing any means of production to you (you already own a laptop and
 that is your office), yet I want to provide the other benefits that a
 large corporation can offer (a single image, consistency,
 reliability).

 Not sure if there should be an admission criteria. I could use your
 feedback about this.

 Comments? Thought? You do not have to commit to anything now but who
 is interested?

 Massimo


Re: [web2py] Re: monetize web2py anybody?

2010-05-24 Thread Albert Abril
I am interested too.
Still learning daily a bit more.
I'm planning to do a dental clinic management, but had a lot of work to do.

Regards.

On Mon, May 24, 2010 at 1:31 PM, Richard richar...@gmail.com wrote:

 I am interested, and glad you brought this up again:
 http://groups.google.com/group/web2py/browse_thread/thread/226863714adbb7cb



 On May 24, 9:18 am, mdipierro mdipie...@cs.depaul.edu wrote:
  I have some problems:
 
  1) people ask me to contribute to more projects that I can handle.
  2) I am good at kicking off a project (20% of the work) but I am not
  the best person to bring it to production (the other 80%) of the work.
  3) I want to delegate some of these projects to users I trust. I need
  to better keep track of you, the users, your skills and interests.
 
  You and I have some problems in common:
  1)  you are an individual or you own a small consulting company and
  you find hard to compete for large projects
  2) you want to use web2py but you need to sell web2py before you can
  sell yoru services.
  3) you need legal help (sample non-disclosure agreement, sample
  contracts, etc.)
  4) for large projects you need to find people who can help you with
  development (you man need a designer, a coder, a system administrator,
  a GAE expert, etc).
  5) you want somebody else to handle advertising for you
 
  I want to help. I want to help you find development jobs, network, and
  compete for larger projects by providing some assistance.
 
  I am about to create something like an association of web2py
  professionals with a portal that provides web sites for members,
  repository of legal forms, job posting, progress tracking, feedback
  forms, etc. Here is the basic idea: we do not advertise web2py, we
  advertise the association and its members. you find a client? you keep
  all the money. You want to offer your client long term support or code
  review? the association will sell that to the client directly
  directly. You want to be listed as a member? Follow a code of conduct
  (basically use approved tools and ask your clients to review your work
  publicly). You already have a consulting company or an employer? You
  can have the company listed as an associate under some conditions.
 
  We can turn our group into a large international consulting
  organization overnight. There would be no contract between the
  association and you other than a code of conduct that you will have to
  follow to be listed and that I am about to wrote. You can continue to
  work as an individual or with your existing company. The association
  will just help when you need help.
 
  The association may also partner with some member to provide venture
  capital in the form of code development (and perhaps money but not
  immediately) for specific projects submitted to the association, in
  exchange of shares.
 
  I have already incorporated to do this. This will be independent and
  complementary form web2py itself and web2py would not be the only tool
  in the association approved toolkit.
 
  For now the toolkit will include: web2py, ubuntu, postgresql, jquery,
  and google app engine. You as an individual or a company can provide
  services based on other tools but the association will endorse these
  tools because we can easily find people skilled in them and you, as a
  member, will be required to endorse these tools as good tools and
  demonstrate your skills in some of them (not all of them).
 
  web2py is a tool. We will all outlive web2py. But we have created
  something important here. A community of skilled professional that
  share some experience. I want to see this grow with web2py and beyond
  web2py later. I want to see us compete with large consulting
  companies. I want to do it using a new business model in which there
  are no shareholders to take a cut of your work since they would not be
  providing any means of production to you (you already own a laptop and
  that is your office), yet I want to provide the other benefits that a
  large corporation can offer (a single image, consistency,
  reliability).
 
  Not sure if there should be an admission criteria. I could use your
  feedback about this.
 
  Comments? Thought? You do not have to commit to anything now but who
  is interested?
 
  Massimo



[web2py] Re: Ajax style calls blocking

2010-05-24 Thread eddie
I have found this recent thread:

http://groups.google.com/group/web2py/browse_thread/thread/80941011f6407703/5047c1417c35b125#5047c1417c35b125

But I'm still not entirely sure what the net result is for multiple
controller calls, via ajax or otherwise.

What exactly does the -n option allow in terms of threading and
handling requests in parallel?

On May 24, 8:47 pm, eddie eddie.sh...@gmail.com wrote:
 Hi guys,

 I'm looking for some help on allowing controller functions to respond
 to ajax calls from a view in parallel. I've got my head around the
 basic web2py architecture, but this is my first time trying out ajax
 in web2py.

 Here's the problem. I have a simple view that makes a number of ajax
 calls, to provide delay loading of data. The results are from querying
 and parsing URLs on demand, so they can be slow. The controller
 function I am calling (default/results_data) appears to be blocking,
 only executing one request at a time. This obviously defeats the
 purpose of delay loading the data on the page.

 I have made sure I am running the web2py app locally with the -n
 option (for threads), but this isn't the issue. I have found the
 session.forget() call, but this isn't it either.

 I am guessing there is something fundamental that I am doing wrong
 here, I am hoping someone can clarify what is required to allow the
 controller functions that respond to the ajax query to execute in
 parallel, without blocking.

 A snippet from the html generated by the view:

 function sendRequest(url,callback,postData) {
         try {
                 var req = createXMLHTTPObject();
                 if (!req) return;
                 var method = (postData) ? POST : GET;
                 req.open(method,url,true);
                 req.setRequestHeader('User-Agent','XMLHTTP/1.0');
                 if (postData)
                         
 req.setRequestHeader('Content-Type','application/x-www-form-
 urlencoded');
                 req.onreadystatechange = function () {
                         if (req.readyState != 4) return;
                         if (req.status != 200  req.status != 304) {
                                 alert('HTTP error ' + req.status);
                                 return;
                         }
                         callback(req);
                 }

                 if (req.readState ==  4) return;
                 req.send(postData);
         }
         catch (e) {
                 throw e;//alert(e);
         }}

 ...
 script
 function source1_results(req)
 {document.getElementById('query1_results').innerHTML =
 req.responseText;}
 sendRequest('/myapp/default/results_data?
 query=foosource_name=source1', source1_results)
 function souce2_results(req)
 {document.getElementById('source2_results').innerHTML =
 req.responseText;}
 sendRequest('/myapp/default/results_data?
 query=foosource_name=source2', source2_results)
 /script
 ...
 table
 trtdsource1/tdtd id=source1_resultsLoading.../tdtda
 href=http://...;View page/a/td/tr
 trtdsource2/tdtd id=source2_resultsLoading.../tdtda
 href=http://...;View page/a/td/tr
 /table


[web2py] Re: monetize web2py anybody?

2010-05-24 Thread greenpoise
Count me in.


Dan

On May 24, 7:39 am, Albert Abril albert.ab...@gmail.com wrote:
 I am interested too.
 Still learning daily a bit more.
 I'm planning to do a dental clinic management, but had a lot of work to do.

 Regards.

 On Mon, May 24, 2010 at 1:31 PM, Richard richar...@gmail.com wrote:
  I am interested, and glad you brought this up again:
 http://groups.google.com/group/web2py/browse_thread/thread/226863714a...

  On May 24, 9:18 am, mdipierro mdipie...@cs.depaul.edu wrote:
   I have some problems:

   1) people ask me to contribute to more projects that I can handle.
   2) I am good at kicking off a project (20% of the work) but I am not
   the best person to bring it to production (the other 80%) of the work.
   3) I want to delegate some of these projects to users I trust. I need
   to better keep track of you, the users, your skills and interests.

   You and I have some problems in common:
   1)  you are an individual or you own a small consulting company and
   you find hard to compete for large projects
   2) you want to use web2py but you need to sell web2py before you can
   sell yoru services.
   3) you need legal help (sample non-disclosure agreement, sample
   contracts, etc.)
   4) for large projects you need to find people who can help you with
   development (you man need a designer, a coder, a system administrator,
   a GAE expert, etc).
   5) you want somebody else to handle advertising for you

   I want to help. I want to help you find development jobs, network, and
   compete for larger projects by providing some assistance.

   I am about to create something like an association of web2py
   professionals with a portal that provides web sites for members,
   repository of legal forms, job posting, progress tracking, feedback
   forms, etc. Here is the basic idea: we do not advertise web2py, we
   advertise the association and its members. you find a client? you keep
   all the money. You want to offer your client long term support or code
   review? the association will sell that to the client directly
   directly. You want to be listed as a member? Follow a code of conduct
   (basically use approved tools and ask your clients to review your work
   publicly). You already have a consulting company or an employer? You
   can have the company listed as an associate under some conditions.

   We can turn our group into a large international consulting
   organization overnight. There would be no contract between the
   association and you other than a code of conduct that you will have to
   follow to be listed and that I am about to wrote. You can continue to
   work as an individual or with your existing company. The association
   will just help when you need help.

   The association may also partner with some member to provide venture
   capital in the form of code development (and perhaps money but not
   immediately) for specific projects submitted to the association, in
   exchange of shares.

   I have already incorporated to do this. This will be independent and
   complementary form web2py itself and web2py would not be the only tool
   in the association approved toolkit.

   For now the toolkit will include: web2py, ubuntu, postgresql, jquery,
   and google app engine. You as an individual or a company can provide
   services based on other tools but the association will endorse these
   tools because we can easily find people skilled in them and you, as a
   member, will be required to endorse these tools as good tools and
   demonstrate your skills in some of them (not all of them).

   web2py is a tool. We will all outlive web2py. But we have created
   something important here. A community of skilled professional that
   share some experience. I want to see this grow with web2py and beyond
   web2py later. I want to see us compete with large consulting
   companies. I want to do it using a new business model in which there
   are no shareholders to take a cut of your work since they would not be
   providing any means of production to you (you already own a laptop and
   that is your office), yet I want to provide the other benefits that a
   large corporation can offer (a single image, consistency,
   reliability).

   Not sure if there should be an admission criteria. I could use your
   feedback about this.

   Comments? Thought? You do not have to commit to anything now but who
   is interested?

   Massimo


[web2py] Re: Ajax style calls blocking

2010-05-24 Thread Candid
I might be completely wrong, but I think the problem is that web2py
locks the session file while executing controller's actions, so two
simultaneous requests within the same session are processed one by one
sequentially.

On May 24, 8:37 am, eddie eddie.sh...@gmail.com wrote:
 I have found this recent thread:

 http://groups.google.com/group/web2py/browse_thread/thread/80941011f6...

 But I'm still not entirely sure what the net result is for multiple
 controller calls, via ajax or otherwise.

 What exactly does the -n option allow in terms of threading and
 handling requests in parallel?

 On May 24, 8:47 pm, eddie eddie.sh...@gmail.com wrote:



  Hi guys,

  I'm looking for some help on allowing controller functions to respond
  to ajax calls from a view in parallel. I've got my head around the
  basic web2py architecture, but this is my first time trying out ajax
  in web2py.

  Here's the problem. I have a simple view that makes a number of ajax
  calls, to provide delay loading of data. The results are from querying
  and parsing URLs on demand, so they can be slow. The controller
  function I am calling (default/results_data) appears to be blocking,
  only executing one request at a time. This obviously defeats the
  purpose of delay loading the data on the page.

  I have made sure I am running the web2py app locally with the -n
  option (for threads), but this isn't the issue. I have found the
  session.forget() call, but this isn't it either.

  I am guessing there is something fundamental that I am doing wrong
  here, I am hoping someone can clarify what is required to allow the
  controller functions that respond to the ajax query to execute in
  parallel, without blocking.

  A snippet from the html generated by the view:

  function sendRequest(url,callback,postData) {
          try {
                  var req = createXMLHTTPObject();
                  if (!req) return;
                  var method = (postData) ? POST : GET;
                  req.open(method,url,true);
                  req.setRequestHeader('User-Agent','XMLHTTP/1.0');
                  if (postData)
                          
  req.setRequestHeader('Content-Type','application/x-www-form-
  urlencoded');
                  req.onreadystatechange = function () {
                          if (req.readyState != 4) return;
                          if (req.status != 200  req.status != 304) {
                                  alert('HTTP error ' + req.status);
                                  return;
                          }
                          callback(req);
                  }

                  if (req.readState ==  4) return;
                  req.send(postData);
          }
          catch (e) {
                  throw e;//alert(e);
          }}

  ...
  script
  function source1_results(req)
  {document.getElementById('query1_results').innerHTML =
  req.responseText;}
  sendRequest('/myapp/default/results_data?
  query=foosource_name=source1', source1_results)
  function souce2_results(req)
  {document.getElementById('source2_results').innerHTML =
  req.responseText;}
  sendRequest('/myapp/default/results_data?
  query=foosource_name=source2', source2_results)
  /script
  ...
  table
  trtdsource1/tdtd id=source1_resultsLoading.../tdtda
  href=http://...;View page/a/td/tr
  trtdsource2/tdtd id=source2_resultsLoading.../tdtda
  href=http://...;View page/a/td/tr
  /table


[web2py] Re: monetize web2py anybody?

2010-05-24 Thread Leandro - ProfessionalIT
Massimo,

  Despite being a product and not a tool, the business plan of OpenERP
is very interesting.
  I think that Regional/Country Departments of the Association can
provide more global visibility to Web2Py.

  IMHO, a business plan to this association can have a certification
program with three levels: bronze, silver and gold, and companies
like mine for example, offer my services to customers presenting my
Web2Py certificate.

  To have a [level] Certificate, your campany needs fill some
criterias...

  what you think about this idea?

-- Leandro.



[web2py] Re: monetize web2py anybody?

2010-05-24 Thread greenpoise
I think that rather than discriminating and hence giving competitive
advantage to one company over another would defy the purpose of it
all! I dont know what a good admission system would be like but I am
all up for a filter type rather than giving some competitive advantage
to ones more than others, that would be unfair.



On May 24, 9:37 am, Leandro - ProfessionalIT lsever...@gmail.com
wrote:
 Massimo,

   Despite being a product and not a tool, the business plan of OpenERP
 is very interesting.
   I think that Regional/Country Departments of the Association can
 provide more global visibility to Web2Py.

   IMHO, a business plan to this association can have a certification
 program with three levels: bronze, silver and gold, and companies
 like mine for example, offer my services to customers presenting my
 Web2Py certificate.

   To have a [level] Certificate, your campany needs fill some
 criterias...

   what you think about this idea?

 -- Leandro.


[web2py] validation in forms, DAL and Database

2010-05-24 Thread puercoespin
In a db.py:


db.define_table('vendedor',
Field('auth_user_id', unique=True, default =
auth.user.id),
Field('direccion'),
Field('provincia'),
Field('coordenadas_gps'),
Field('email', requires=IS_EMPTY_OR(IS_EMAIL()),
default = auth.user.email),
Field('telefono', 'integer'),
Field('profesional', 'boolean', default=True))


In the admin app, raises an error when 'auth_user_id'  values is in
database, but not in controller, allowing repeated values in
'auth_user_id':



default.py


def registrovendedor():

form = SQLFORM(db.vendedor)

if form.accepts(request.vars, session):
response.flash = T('Registo válido')
elif form.errors:
response.flash = T('Atención: Errores en los datos del
formulario')
else:
response.flash = T('Por favor, rellene el formulario de
registro')

return dict(form=form)


what's wrong? It's necessary to validate in all levels (DAL, Form and
Database)? If you validate at low level (I think in database level),
why you must to validate at form level?

Thanks


[web2py] before_filter / after_filter / around_filter in web2py

2010-05-24 Thread Tex
Hi,

sorry for my poor english...

I'm wondering how can I put controller code filters like rails
(before_filter / after_filter / around_filter).

Searching into user group posts I see many responses on activerecord
callbacks (before_save / after_save) wrongly referred to question on
before/after/around filter (controller filter).

Now I know that in web2py I can put code into model /db.py) and that
code is execute before globals and before controller code, my
questions are:

1. in rails I write before_filter only for given controllers and given
actions, seems that in web2py if I write the code in db.py it is
executed for all controllers and actions, is there a way to limit that
code execution to given controllers and actions ? (I think that put
too much code into db.py may slow the excution of requests, it'isnt ?)

2. how can I write code execution that emulates after_filter or
around_filter ala Rails ? (example: I want to track remote ip for all
my controller/actions into database...),

Many thanks in advance.

Tex


[web2py] Re: monetize web2py anybody?

2010-05-24 Thread greenpoise
by the way, I was referring to the idea of: To have a [level]
Certificate, your campany needs fill some
criterias... .

Also, have you ever seen blender.org? They have good ideas themselves.
One for example is to pay certain amount ($200) if not mistaken if you
use blender for commercial purposes.


Just a thought.


dan

On May 24, 10:06 am, greenpoise danel.sega...@gmail.com wrote:
 I think that rather than discriminating and hence giving competitive
 advantage to one company over another would defy the purpose of it
 all! I dont know what a good admission system would be like but I am
 all up for a filter type rather than giving some competitive advantage
 to ones more than others, that would be unfair.

 On May 24, 9:37 am, Leandro - ProfessionalIT lsever...@gmail.com
 wrote:





  Massimo,

    Despite being a product and not a tool, the business plan of OpenERP
  is very interesting.
    I think that Regional/Country Departments of the Association can
  provide more global visibility to Web2Py.

    IMHO, a business plan to this association can have a certification
  program with three levels: bronze, silver and gold, and companies
  like mine for example, offer my services to customers presenting my
  Web2Py certificate.

    To have a [level] Certificate, your campany needs fill some
  criterias...

    what you think about this idea?

  -- Leandro.


[web2py] Sanitizer and strip()

2010-05-24 Thread howesc
Hello,

I have a spot on my site where i want a user to be able to input HTML
formatted text, with limitations to accepted tags.  I would also like
to use a WYSIWYG editor.  The trouble that I'm having is that users
like to write the stuff in Microsoft Word and paste it into the
editor.  When that happens all sorts of crap gets inserted into the
HTML.  I want to remove this from the HTML completely.

I was looking at gluon.sanitizer and found this:

from gluon.sanitizer import sanitize
request.vars.story = sanitize(request.vars.dedication)
logging.info(cleaned dedication is: %s %
request.vars.dedication)

trouble is that it escapes the HTML that i don't want.  There is a
method in sanitizer called strip(), but it really just escapes.  would
it be bad to extend the functionality of sanitizer to provide an
option to remove the dis-allowed items rather than escaping them?

(i've tried to make both nicEdit and OpenWYSIWYG editors strip for me,
but neither works well - nicEdit misses some formatting, and
OpenWYSIWYG removes *all* formating, even permitted formatting)

Thanks,

Christian


Re: [web2py] Re: monetize web2py anybody?

2010-05-24 Thread Jason Brower
I certainly didn't know about a commercial licence for Blender.  Could
you show me the link to that?
Best Regards,
Jason Brower
On Mon, 2010-05-24 at 08:06 -0700, greenpoise wrote: 
 by the way, I was referring to the idea of: To have a [level]
 Certificate, your campany needs fill some
 criterias... .
 
 Also, have you ever seen blender.org? They have good ideas themselves.
 One for example is to pay certain amount ($200) if not mistaken if you
 use blender for commercial purposes.
 
 
 Just a thought.
 
 
 dan
 
 On May 24, 10:06 am, greenpoise danel.sega...@gmail.com wrote:
  I think that rather than discriminating and hence giving competitive
  advantage to one company over another would defy the purpose of it
  all! I dont know what a good admission system would be like but I am
  all up for a filter type rather than giving some competitive advantage
  to ones more than others, that would be unfair.
 
  On May 24, 9:37 am, Leandro - ProfessionalIT lsever...@gmail.com
  wrote:
 
 
 
 
 
   Massimo,
 
 Despite being a product and not a tool, the business plan of OpenERP
   is very interesting.
 I think that Regional/Country Departments of the Association can
   provide more global visibility to Web2Py.
 
 IMHO, a business plan to this association can have a certification
   program with three levels: bronze, silver and gold, and companies
   like mine for example, offer my services to customers presenting my
   Web2Py certificate.
 
 To have a [level] Certificate, your campany needs fill some
   criterias...
 
 what you think about this idea?
 
   -- Leandro.




[web2py] display a stored .jpg during a record list or update

2010-05-24 Thread NetAdmin
I'm a bit confused.

During an edit or listing of all books,
how can I display the .jpg file that is
stored in the field named coverblob ?

I can only see the blob field contents
when using appadmin.

Thanks!

==   db.py  ==

db.define_table( 'tbbooks' ,
  SQLField('booktitle' , 'string', length=20),
  SQLField('cover', 'upload', uploadfield='coverblob'),
  SQLField('coverblob', 'blob')
)

 default.py  ==

def index():
  #
  #   select all books
  #
  recs = db().select(db.tbbooks.ALL,orderby=db.tbbooks.booktitle)
  return dict ( recs = recs )

def editrec():
  #
  #  edit record 1
  #
  form = SQLFORM( db.tbbooks, 1 )
  #
  if form.accepts(request.vars, session):
response.flash = 'Done!'
  #
  return dict ( form = form )

def insrec():
  #
  # insert a new record
  #
  form = SQLFORM( db.tbbooks )
  #
  if form.accepts(request.vars, session):
response.flash = 'Done!'
  #
  return dict ( form = form )

==


[web2py] Re: Sanitizer and strip()

2010-05-24 Thread mdipierro
I will take a patch to XML and sanitize that does this

On May 24, 10:42 am, howesc how...@umich.edu wrote:
 Hello,

 I have a spot on my site where i want a user to be able to input HTML
 formatted text, with limitations to accepted tags.  I would also like
 to use a WYSIWYG editor.  The trouble that I'm having is that users
 like to write the stuff in Microsoft Word and paste it into the
 editor.  When that happens all sorts of crap gets inserted into the
 HTML.  I want to remove this from the HTML completely.

 I was looking at gluon.sanitizer and found this:

     from gluon.sanitizer import sanitize
     request.vars.story = sanitize(request.vars.dedication)
     logging.info(cleaned dedication is: %s %
 request.vars.dedication)

 trouble is that it escapes the HTML that i don't want.  There is a
 method in sanitizer called strip(), but it really just escapes.  would
 it be bad to extend the functionality of sanitizer to provide an
 option to remove the dis-allowed items rather than escaping them?

 (i've tried to make both nicEdit and OpenWYSIWYG editors strip for me,
 but neither works well - nicEdit misses some formatting, and
 OpenWYSIWYG removes *all* formating, even permitted formatting)

 Thanks,

 Christian


[web2py] custom auth_user with avatar image, session cannot pickle

2010-05-24 Thread selecta
I am trying to customize auth with

auth_table = db.define_table( auth.settings.table_user_name,
Field('first_name', length=128, default='',requires =
IS_NOT_EMPTY(error_message=auth.messages.is_empty)),
Field('last_name', length=128, default='',requires =
IS_NOT_EMPTY(error_message=auth.messages.is_empty)),
Field('email', length=128, default='', unique=True,requires =
[ IS_EMAIL(error_message=auth.messages.invalid_email),
IS_NOT_IN_DB(db, auth.settings.table_user_name+.email)]),
#Field('password', 'password', length=256, readable=False,
label='Password',requires = [IS_STRONG(), CRYPT()]),
Field('password', 'password', length=256, readable=False,
label='Password',requires = CRYPT()),
Field('registration_key', length=128, default= '',
writable=False, readable=False),
Field('skype'),
Field('tel', requires = IS_EMPTY_OR(IS_MATCH('^\+\d{2} \d+ \d+
$', error_message='telephone number format: +XX XX* XX*'))),
Field('fax', requires = IS_EMPTY_OR(IS_MATCH('^\+\d{2} \d+ \d+
$', error_message='faxnumber number format: +XX XX* XX*'))),
Field('avatar', 'upload', requires = IS_IMAGE(), label = Your
Picture)
)

but when I upload an image I get

Traceback (most recent call last):
  File /home/select/Dev/web2py/gluon/main.py, line 407, in wsgibase
session._try_store_on_disk(request, response)
  File /home/select/Dev/web2py/gluon/globals.py, line 375, in
_try_store_on_disk
cPickle.dump(dict(self), response.session_file)
  File /usr/lib/python2.6/copy_reg.py, line 70, in _reduce_ex
raise TypeError, can't pickle %s objects % base.__name__
TypeError: can't pickle file objects

I think I saw an answer for that some time ago, but I cannot find it
would it be possible to modify the session so it does not try to store
upload fields from auth?


[web2py] crud question on multiple form layout

2010-05-24 Thread annet
I have the following layout:

!-- Layout 3 --
div class=ez-wr
  div class=ez-box.header./div
!-- Module 3A --
div class=ez-wr
  div class=ez-fl  ez-negmx ez-33
div class=ez-box.1./div
  /div
  div class=ez-fl ez-negmr ez-33
div class=ez-box.2./div
  /div
  div class=ez-last ez-oh
div class=ez-box.3./div
  /div
/div
  div class=ez-box.footer./div
/div

I my database header, .1, .2 , .3 and footer are fields of type text
and in web2py_ajax.html I enabled tinyMCE on textareas.

I would like to make an administrative view in which all five divs are
links to forms in which a user can perform crud actions on the
textareas and in return see the result of their actions. The problem
is I have no idea of how to implement this in web2py. I hope someone
could point me in the right direction.

Kind regards,

Annet.


[web2py] Re: Problem with inserting a text in a database field

2010-05-24 Thread Berti
Thanks, but db.commit() didnt help.


[web2py] Re: monetize web2py anybody?

2010-05-24 Thread greenpoise
Oops, dual licensing was retracted. It had dual licensing not anymore.
My bad. I have been using blender for a long time and really never
checked back again on that one.


dan

On May 24, 11:40 am, Jason Brower encomp...@gmail.com wrote:
 I certainly didn't know about a commercial licence for Blender.  Could
 you show me the link to that?
 Best Regards,
 Jason Brower

 On Mon, 2010-05-24 at 08:06 -0700, greenpoise wrote:
  by the way, I was referring to the idea of: To have a [level]
  Certificate, your campany needs fill some
  criterias... .

  Also, have you ever seen blender.org? They have good ideas themselves.
  One for example is to pay certain amount ($200) if not mistaken if you
  use blender for commercial purposes.

  Just a thought.

  dan

  On May 24, 10:06 am, greenpoise danel.sega...@gmail.com wrote:
   I think that rather than discriminating and hence giving competitive
   advantage to one company over another would defy the purpose of it
   all! I dont know what a good admission system would be like but I am
   all up for a filter type rather than giving some competitive advantage
   to ones more than others, that would be unfair.

   On May 24, 9:37 am, Leandro - ProfessionalIT lsever...@gmail.com
   wrote:

Massimo,

  Despite being a product and not a tool, the business plan of OpenERP
is very interesting.
  I think that Regional/Country Departments of the Association can
provide more global visibility to Web2Py.

  IMHO, a business plan to this association can have a certification
program with three levels: bronze, silver and gold, and companies
like mine for example, offer my services to customers presenting my
Web2Py certificate.

  To have a [level] Certificate, your campany needs fill some
criterias...

  what you think about this idea?

-- Leandro.


[web2py] Re: monetize web2py anybody?

2010-05-24 Thread GoldenTiger
Of course,  I discovered web2py 1 month ago , and I feel as when I
discovered python, thanks to web2py I'm more excited than ever in my
life, and I know this is all the framework I want.
Now I'd like creating all the ideas that I was always dreaming ^^
I think some day everybody will use web2py and new frameworks will be
inspired in web2py.
I would like showing people at spain that this framework means
I have thousands of ideas every day to write with web2py, and ideas to
improve it ^^
the more creative i am more happy i feel

thanks a lot ^^

Juan Martinez


[web2py] Re: before_filter / after_filter / around_filter in web2py

2010-05-24 Thread Yarko Tymciurak

On May 24, 8:22 am, Tex giates2...@gmail.com wrote:
 Hi,

 sorry for my poor english...

 I'm wondering how can I put controller code filters like rails
 (before_filter / after_filter / around_filter).

 Searching into user group posts I see many responses on activerecord
 callbacks (before_save / after_save) wrongly referred to question on
 before/after/around filter (controller filter).

 Now I know that in web2py I can put code into model /db.py) and that
 code is execute before globals and before controller code, my
 questions are:

 1. in rails I write before_filter only for given controllers and given
 actions, seems that in web2py if I write the code in db.py it is
 executed for all controllers and actions, is there a way to limit that
 code execution to given controllers and actions ? (I think that put
 too much code into db.py may slow the excution of requests, it'isnt ?)

 2. how can I write code execution that emulates after_filter or
 around_filter ala Rails ? (example: I want to track remote ip for all
 my controller/actions into database...),

I think this may be more a python question than a web2py question:
With python, you want to read up on decorators.For example:

@auth.requires_login()
def  mycontroller:
.

can be either  before, around, or after (although you can certainly do
before / after in other, simpler ways).

For example:

@before_decorator()
@around_decorator()
def myfunction:


For background, you could start with:
http://docs.python.org/reference/compound_stmts.html#function
http://www.artima.com/weblogs/viewpost.jsp?thread=240808
http://www.artima.com/weblogs/viewpost.jsp?thread=240845


 Many thanks in advance.

Regards,
- Yarko

 Tex


[web2py] Re: before_filter / after_filter / around_filter in web2py

2010-05-24 Thread mdipierro
web2py defines

response._caller = lambda f: f()

this function is in charge of calling the action. You can redefine it
in the controller or models

def mycaller(f):
  # before calling action
  r=f()
  # after calling action but before calling view
  if isinstance(r,dict):
  r=response.render(r)
  # after calling view before returning response
  try:
  return r
  finally:
  # after everything
  pass

response._caller=mycaller
On May 24, 12:58 pm, Yarko Tymciurak resultsinsoftw...@gmail.com
wrote:
 On May 24, 8:22 am, Tex giates2...@gmail.com wrote:



  Hi,

  sorry for my poor english...

  I'm wondering how can I put controller code filters like rails
  (before_filter / after_filter / around_filter).

  Searching into user group posts I see many responses on activerecord
  callbacks (before_save / after_save) wrongly referred to question on
  before/after/around filter (controller filter).

  Now I know that in web2py I can put code into model /db.py) and that
  code is execute before globals and before controller code, my
  questions are:

  1. in rails I write before_filter only for given controllers and given
  actions, seems that in web2py if I write the code in db.py it is
  executed for all controllers and actions, is there a way to limit that
  code execution to given controllers and actions ? (I think that put
  too much code into db.py may slow the excution of requests, it'isnt ?)

  2. how can I write code execution that emulates after_filter or
  around_filter ala Rails ? (example: I want to track remote ip for all
  my controller/actions into database...),

 I think this may be more a python question than a web2py question:
 With python, you want to read up on decorators.    For example:

 @auth.requires_login()
 def  mycontroller:
 .

 can be either  before, around, or after (although you can certainly do
 before / after in other, simpler ways).

 For example:

 @before_decorator()
 @around_decorator()
 def myfunction:
 

 For background, you could start 
 with:http://docs.python.org/reference/compound_stmts.html#functionhttp://www.artima.com/weblogs/viewpost.jsp?thread=240808http://www.artima.com/weblogs/viewpost.jsp?thread=240845



  Many thanks in advance.

 Regards,
 - Yarko



  Tex


[web2py] Re: crud problem

2010-05-24 Thread mdipierro
You can try replace

if not response.init_flash: response.init_flash='Insert tagline'

with

response.init_flash='Insert tagline'



On May 24, 3:46 am, annet annet.verm...@gmail.com wrote:
 Massimo,

 Thanks for pointing me in the right direction, I had to add the next
 argument to the crud.update() function to get the check to delete work
 properly. There's one small problem to solve, when the user logs in
 the flash reads: Logged in. Whereas, I would like it to read 'Insert
 tagline' or 'Update tagline'.

 The function:

 @auth.requires_login()
 def index():
     response.functionname='Basic account'

 record=db(db.tagline.bedrijf_id==auth.user.bedrijf_id).select().first()
     if record:
         if not response.init_flash: response.init_flash='Update
 tagline'
         message='Tagline updated'
     else:
         if not response.init_flash: response.init_flash='Insert
 tagline'
         message='Tagline inserted'
     db.tagline.bedrijf_id.default=auth.user.bedrijf_id

 form=crud.update(db.tagline,record,next=(URL(r=request,f='index')),message=message)
     return dict(form=form)

 The view:

 div id=oneColLayout
   div id=primarycontent
     {{if response.functionname:}}
       h2{{=response.functionname}}/h2
     {{pass}}
     {{if response.flash:}}
       div class=flash
         {{=response.flash}}
       /div !-- flash --
     {{else:}}
       div class=flash
         {{=response.init_flash}}
       /div !-- flash --
     {{pass}}
     {{if form:}}
       {{=form}}
     {{pass}}
   /div !-- primarycontent --
 /div !-- oneColLayout --

 Kind regards,

 Annet.


[web2py] Re: Custom registration form -- password_two

2010-05-24 Thread b00m_chef
I tried doing that you are trying to do and I never got it to work. I
just ended up copying the code from the AUTH.register() method that
update the session and DB, and putting it in my controller. So I
basically re-built my own AUTH.register() method, as the existing one
is very limited in terms of custimization for use with custom.widget.



On May 24, 7:30 am, weheh richard_gor...@verizon.net wrote:
 OK, this is still open. Sorry for the confusion.

 If passwords don't agree, I don't get any error message.


[web2py] Re: html unescape - if anyone needs it

2010-05-24 Thread mdipierro
I liked your suggestion and I used it to make
gluon.html.web2pyHTMLParser, take a look and let me know what you
think.

On May 23, 2:20 pm, RobertVa robert.valen...@gmail.com wrote:
 I did.

 It has xmlescape function, but reverse function (unescape) is not
 defined.

 On 23 maj, 20:59, Yarko Tymciurak resultsinsoftw...@gmail.com wrote:

  Have you looked at the XML()  helper?  
  http://www.web2py.com/book/default/section/5/2?search=XML

  On May 23, 1:41 pm, RobertVa robert.valen...@gmail.com wrote:

   Hi.

   I found function to unescape html data, which I believe would be very
   prudent to put into framework itself.

   from htmlentitydefs import name2codepoint
   def replace_entities(match):
       try:
           ent = match.group(1)
           if ent[0] == #:
               if ent[1] == 'x' or ent[1] == 'X':
                   return unichr(int(ent[2:], 16))
               else:
                   return unichr(int(ent[1:], 10))
           return unichr(name2codepoint[ent])
       except:
           return match.group()

   entity_re = re.compile(r'(#?[A-Za-z0-9]+?);')

   def html_unescape(data):
       return entity_re.sub(replace_entities, data)

   Tnx to author.http://blog.client9.com/2008/10/html-unescape-in-python.html


[web2py] Re: parsehtml

2010-05-24 Thread mdipierro
Good suggestion. Now you can do

 from gluon.html import web2pyHTMLParser
 tree = web2pyHTMLParser('hellodiv a=bworld/
div').tree
 tree.element(_a='b')
['_c']=5

str(tree)
'hellodiv a=b c=5world/div'

works great!



On May 24, 5:11 am, Iceberg iceb...@21cn.com wrote:
 I did not try but I assume the builtin python module HTMLParser
 already handle at least (1) tags like input /, not sure about (2)
 and (3).

 On May24, 4:32am, mdipierro mdipie...@cs.depaul.edu wrote:

  hmmm somehow I did not save comments in the file.

  This does not handle well:

  1) tags like input /
  2) attributes that contain  in quotes a onclick=if(ab)alert()
  3) attributes that contain escaped quotes a onclick=var a=\x\

  On May 23, 10:46 am, Massimo Di Pierro mdipie...@cs.depaul.edu
  wrote:

   Anybody interested in helping with this?

   It scrapes an html files and converts into a tree hierarchy of web2py  
   helpers

   'divxxx/div' - DIV('xxx')

   It kind of works but fails at three exceptions described in the file.

   Massimo

    parsehtml.py
   1KViewDownload


[web2py] Re: Custom registration form -- password_two

2010-05-24 Thread mdipierro
No becasue the object

INPUT(_type='password',name='password_two',_id='password_two'),

is not in the form object and therefore not processed by accept.
Moreover in your code I do not see the validation logic for password
too so I do not know where the error is.
My advice is use a
SQLFORM.factory(db.table,Field('password2','password',requires=...)))

On May 24, 9:30 am, weheh richard_gor...@verizon.net wrote:
 OK, this is still open. Sorry for the confusion.

 If passwords don't agree, I don't get any error message.


[web2py] Re: validation in forms, DAL and Database

2010-05-24 Thread mdipierro
The only problem is see is

Field('auth_user_id', unique=True, default = auth.user.id),

should be

Field('auth_user_id', unique=True, default =auth.user_id #
 requires=IS_NOT_IN_DB(db,'vendedor.auth_user_id')),

form can only manipuate errors from form validation, not database
errors. Even if you enforce uniqueness in database, you still need to
enforce it in forms.


On May 24, 6:59 am, puercoespin jzaragoza.puercoes...@gmail.com
wrote:
 In a db.py:

 db.define_table('vendedor',
                 Field('auth_user_id', unique=True, default =
 auth.user.id),
                 Field('direccion'),
                 Field('provincia'),
                 Field('coordenadas_gps'),
                 Field('email', requires=IS_EMPTY_OR(IS_EMAIL()),
 default = auth.user.email),
                 Field('telefono', 'integer'),
                 Field('profesional', 'boolean', default=True))

 In the admin app, raises an error when 'auth_user_id'  values is in
 database, but not in controller, allowing repeated values in
 'auth_user_id':

 default.py

 def registrovendedor():

 form = SQLFORM(db.vendedor)

     if form.accepts(request.vars, session):
         response.flash = T('Registo válido')
     elif form.errors:
         response.flash = T('Atención: Errores en los datos del
 formulario')
     else:
         response.flash = T('Por favor, rellene el formulario de
 registro')

     return dict(form=form)

 what's wrong? It's necessary to validate in all levels (DAL, Form and
 Database)? If you validate at low level (I think in database level),
 why you must to validate at form level?

 Thanks


[web2py] Re: display a stored .jpg during a record list or update

2010-05-24 Thread mdipierro
If you are looking for a preview of the uploaded images when editing a
record you can to do

form = SQLHTML(,upload=URL(r=request,f='download'))

On May 24, 10:52 am, NetAdmin mr.netad...@gmail.com wrote:
 I'm a bit confused.

 During an edit or listing of all books,
 how can I display the .jpg file that is
 stored in the field named coverblob ?

 I can only see the blob field contents
 when using appadmin.

 Thanks!

 ==   db.py  ==

 db.define_table( 'tbbooks' ,
   SQLField('booktitle' , 'string', length=20),
   SQLField('cover', 'upload', uploadfield='coverblob'),
   SQLField('coverblob', 'blob')
 )

  default.py  ==

 def index():
   #
   #   select all books
   #
   recs = db().select(db.tbbooks.ALL,orderby=db.tbbooks.booktitle)
   return dict ( recs = recs )

 def editrec():
   #
   #  edit record 1
   #
   form = SQLFORM( db.tbbooks, 1 )
   #
   if form.accepts(request.vars, session):
     response.flash = 'Done!'
   #
   return dict ( form = form )

 def insrec():
   #
   # insert a new record
   #
   form = SQLFORM( db.tbbooks )
   #
   if form.accepts(request.vars, session):
     response.flash = 'Done!'
   #
   return dict ( form = form )

 ==


[web2py] Re: custom auth_user with avatar image, session cannot pickle

2010-05-24 Thread mdipierro
May be a bug.  I will check.

Massimo

On May 24, 11:41 am, selecta gr...@delarue-berlin.de wrote:
 I am trying to customize auth with

 auth_table = db.define_table( auth.settings.table_user_name,
         Field('first_name', length=128, default='',requires =
 IS_NOT_EMPTY(error_message=auth.messages.is_empty)),
         Field('last_name', length=128, default='',requires =
 IS_NOT_EMPTY(error_message=auth.messages.is_empty)),
         Field('email', length=128, default='', unique=True,requires =
 [ IS_EMAIL(error_message=auth.messages.invalid_email),
 IS_NOT_IN_DB(db, auth.settings.table_user_name+.email)]),
         #Field('password', 'password', length=256, readable=False,
 label='Password',requires = [IS_STRONG(), CRYPT()]),
         Field('password', 'password', length=256, readable=False,
 label='Password',requires = CRYPT()),
         Field('registration_key', length=128, default= '',
 writable=False, readable=False),
         Field('skype'),
         Field('tel', requires = IS_EMPTY_OR(IS_MATCH('^\+\d{2} \d+ \d+
 $', error_message='telephone number format: +XX XX* XX*'))),
         Field('fax', requires = IS_EMPTY_OR(IS_MATCH('^\+\d{2} \d+ \d+
 $', error_message='faxnumber number format: +XX XX* XX*'))),
         Field('avatar', 'upload', requires = IS_IMAGE(), label = Your
 Picture)
         )

 but when I upload an image I get

 Traceback (most recent call last):
   File /home/select/Dev/web2py/gluon/main.py, line 407, in wsgibase
     session._try_store_on_disk(request, response)
   File /home/select/Dev/web2py/gluon/globals.py, line 375, in
 _try_store_on_disk
     cPickle.dump(dict(self), response.session_file)
   File /usr/lib/python2.6/copy_reg.py, line 70, in _reduce_ex
     raise TypeError, can't pickle %s objects % base.__name__
 TypeError: can't pickle file objects

 I think I saw an answer for that some time ago, but I cannot find it
 would it be possible to modify the session so it does not try to store
 upload fields from auth?


[web2py] URGENT help Needed !!! Register at T3 fails me in an urgent paid job for a website!

2010-05-24 Thread GoldenTiger
I have read the old thread titled:  t3 strange error on 1.71.0 
and i couldnt solve it

I was contracted to coding a website in a short time, and then I
discovered web2py
Last 2 weeks I have been reading web2py info alot of hours a day, Now
I am desperate!!

Description or the problem:
1- I have a Mac, a PC (win) and the web hosting I recommended to my
client is Webfaction, (yes, rocks)

2- The behaviour is the same at mi Leopard, XP or Webfaction:  I
register like admin and then set 'mail_administrator' = my email

3- The website requires email verification to users, so I set
settings.email_verification=True

4- I configure my gmail to try:
settings.email_server='smtp.gmail.com:587'
settings.email_auth= 'goldenboy.es:mygmailpass'

5- settings.host_url= 'http://www.website.com;
6- leaving update response as is
the email_text include a  'registration_key', but i dont find it at
any place of code of T3

  t2.messages.register_email_body=Click here +settings.host_url
+/+request.application+/default/verify?key=%(registration_key)s to
complete registration

7- Any attempt of registering show 2 errors

 in controllers/default.py, at lines  29 and 112
and :  -- NameError: global name 'uuid' is not defined

8 - I know that error ocurrs only when mail_verification is true, so
I figure out that if i can't see key in any place of code, then uuid-
py may be necesary to generate the universal unique id.

Questions:

*** Any of you can give a aproximate response?

 what diferences is bettwen changing a variable at db.py or at
models of T3, isit ok?

*** is there any variable to disable the necessity of
registration_key  variable?

Thanks alot of you !!!


[web2py] Re: URGENT help Needed !!! Register at T3 fails me in an urgent paid job for a website!

2010-05-24 Thread mdipierro
On top of the modules/t2.py try add

import uuid

On May 24, 3:41 pm, GoldenTiger goldenboy...@gmail.com wrote:
 I have read the old thread titled:  t3 strange error on 1.71.0 
 and i couldnt solve it

 I was contracted to coding a website in a short time, and then I
 discovered web2py
 Last 2 weeks I have been reading web2py info alot of hours a day, Now
 I am desperate!!

 Description or the problem:
 1- I have a Mac, a PC (win) and the web hosting I recommended to my
 client is Webfaction, (yes, rocks)

 2- The behaviour is the same at mi Leopard, XP or Webfaction:  I
 register like admin and then set 'mail_administrator' = my email

 3- The website requires email verification to users, so I set
 settings.email_verification=True

 4- I configure my gmail to try:
 settings.email_server='smtp.gmail.com:587'
 settings.email_auth= 'goldenboy.es:mygmailpass'

 5- settings.host_url= 'http://www.website.com;
 6- leaving update response as is
 the email_text include a  'registration_key', but i dont find it at
 any place of code of T3

   t2.messages.register_email_body=Click here +settings.host_url
 +/+request.application+/default/verify?key=%(registration_key)s to
 complete registration

 7- Any attempt of registering show 2 errors

  in controllers/default.py, at lines  29 and 112
 and :  -- NameError: global name 'uuid' is not defined

 8 - I know that error ocurrs only when mail_verification is true, so
 I figure out that if i can't see key in any place of code, then uuid-
 py may be necesary to generate the universal unique id.

 Questions:

 *** Any of you can give a aproximate response?

  what diferences is bettwen changing a variable at db.py or at
 models of T3, isit ok?

 *** is there any variable to disable the necessity of
 registration_key  variable?

 Thanks alot of you !!!


[web2py] Re: URGENT help Needed !!! Register at T3 fails me in an urgent paid job for a website!

2010-05-24 Thread mdipierro
Let me add a comment this is one of the reasons for the
association described here
http://groups.google.com/group/web2py/browse_thread/thread/7c61c52feb140e77/091e0170016fa394#091e0170016fa394

Some tools like T3 are not supported so you are on your own (although
other people and I will help anyway if I can) and take huge risks.
Other tools are supported better, like web2py core libraries. The
association can help make a distinction.

Eventually we'll have something replacing T3.


On May 24, 3:45 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 On top of the modules/t2.py try add

 import uuid

 On May 24, 3:41 pm, GoldenTiger goldenboy...@gmail.com wrote:

  I have read the old thread titled:  t3 strange error on 1.71.0 
  and i couldnt solve it

  I was contracted to coding a website in a short time, and then I
  discovered web2py
  Last 2 weeks I have been reading web2py info alot of hours a day, Now
  I am desperate!!

  Description or the problem:
  1- I have a Mac, a PC (win) and the web hosting I recommended to my
  client is Webfaction, (yes, rocks)

  2- The behaviour is the same at mi Leopard, XP or Webfaction:  I
  register like admin and then set 'mail_administrator' = my email

  3- The website requires email verification to users, so I set
  settings.email_verification=True

  4- I configure my gmail to try:
  settings.email_server='smtp.gmail.com:587'
  settings.email_auth= 'goldenboy.es:mygmailpass'

  5- settings.host_url= 'http://www.website.com;
  6- leaving update response as is
  the email_text include a  'registration_key', but i dont find it at
  any place of code of T3

    t2.messages.register_email_body=Click here +settings.host_url
  +/+request.application+/default/verify?key=%(registration_key)s to
  complete registration

  7- Any attempt of registering show 2 errors

   in controllers/default.py, at lines  29 and 112
  and :  -- NameError: global name 'uuid' is not defined

  8 - I know that error ocurrs only when mail_verification is true, so
  I figure out that if i can't see key in any place of code, then uuid-
  py may be necesary to generate the universal unique id.

  Questions:

  *** Any of you can give a aproximate response?

   what diferences is bettwen changing a variable at db.py or at
  models of T3, isit ok?

  *** is there any variable to disable the necessity of
  registration_key  variable?

  Thanks alot of you !!!


[web2py] Re: display a stored .jpg during a record list or update

2010-05-24 Thread NetAdmin
Whoa!  SQLHTML? I didn't even know that existed!

Thanks for the tip!



On May 24, 3:37 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 If you are looking for a preview of the uploaded images when editing a
 record you can to do

 form = SQLHTML(,upload=URL(r=request,f='download'))

 On May 24, 10:52 am, NetAdmin mr.netad...@gmail.com wrote:

  I'm a bit confused.

  During an edit or listing of all books,
  how can I display the .jpg file that is
  stored in the field named coverblob ?

  I can only see the blob field contents
  when using appadmin.

  Thanks!

  ==   db.py  ==

  db.define_table( 'tbbooks' ,
    SQLField('booktitle' , 'string', length=20),
    SQLField('cover', 'upload', uploadfield='coverblob'),
    SQLField('coverblob', 'blob')
  )

   default.py  ==

  def index():
    #
    #   select all books
    #
    recs = db().select(db.tbbooks.ALL,orderby=db.tbbooks.booktitle)
    return dict ( recs = recs )

  def editrec():
    #
    #  edit record 1
    #
    form = SQLFORM( db.tbbooks, 1 )
    #
    if form.accepts(request.vars, session):
      response.flash = 'Done!'
    #
    return dict ( form = form )

  def insrec():
    #
    # insert a new record
    #
    form = SQLFORM( db.tbbooks )
    #
    if form.accepts(request.vars, session):
      response.flash = 'Done!'
    #
    return dict ( form = form )

  ==


[web2py] Re: display a stored .jpg during a record list or update

2010-05-24 Thread NetAdmin
There IS NO SQLHTML :-)

I figure Massimo meant SQLFORM ... and the follow code works!

Thanks!  Thanks!  Thanks!

def editrec():
  #
  #  edit record 1
  #
  # form = SQLFORM( db.tbbooks, 1 )
  form = SQLFORM(db.tbbooks,1,
upload=URL(r=request,f='download') )
  return dict ( form = form )


On May 24, 3:53 pm, NetAdmin mr.netad...@gmail.com wrote:
 Whoa!  SQLHTML? I didn't even know that existed!

 Thanks for the tip!

 On May 24, 3:37 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  If you are looking for a preview of the uploaded images when editing a
  record you can to do

  form = SQLHTML(,upload=URL(r=request,f='download'))

  On May 24, 10:52 am, NetAdmin mr.netad...@gmail.com wrote:

   I'm a bit confused.

   During an edit or listing of all books,
   how can I display the .jpg file that is
   stored in the field named coverblob ?

   I can only see the blob field contents
   when using appadmin.

   Thanks!

   ==   db.py  ==

   db.define_table( 'tbbooks' ,
     SQLField('booktitle' , 'string', length=20),
     SQLField('cover', 'upload', uploadfield='coverblob'),
     SQLField('coverblob', 'blob')
   )

    default.py  ==

   def index():
     #
     #   select all books
     #
     recs = db().select(db.tbbooks.ALL,orderby=db.tbbooks.booktitle)
     return dict ( recs = recs )

   def editrec():
     #
     #  edit record 1
     #
     form = SQLFORM( db.tbbooks, 1 )
     #
     if form.accepts(request.vars, session):
       response.flash = 'Done!'
     #
     return dict ( form = form )

   def insrec():
     #
     # insert a new record
     #
     form = SQLFORM( db.tbbooks )
     #
     if form.accepts(request.vars, session):
       response.flash = 'Done!'
     #
     return dict ( form = form )

   ==


[web2py] Re: monetize web2py anybody?

2010-05-24 Thread yamandu
I am with you Massimo.
I am only on what can be don for this do not become a mess.
As it´s so innovative it´s natural that there be many doubts but also
many expectatives.

I am starting a small company, I am using web2py extensively.
So lets do it.
(handshake goes here)

On May 24, 2:54 pm, GoldenTiger goldenboy...@gmail.com wrote:
 Of course,  I discovered web2py 1 month ago , and I feel as when I
 discovered python, thanks to web2py I'm more excited than ever in my
 life, and I know this is all the framework I want.
 Now I'd like creating all the ideas that I was always dreaming ^^
 I think some day everybody will use web2py and new frameworks will be
 inspired in web2py.
 I would like showing people at spain that this framework means
 I have thousands of ideas every day to write with web2py, and ideas to
 improve it ^^
 the more creative i am more happy i feel

 thanks a lot ^^

 Juan Martinez


Re: [web2py] monetize web2py anybody?

2010-05-24 Thread Giuseppe Luca Scrofani
Count me in! This is a very good idea. How I can contribute in this
starting phase? It is possible to make a list of the first task
involved in the creation of this business? A dedicated wiki, maybe?

On Mon, May 24, 2010 at 1:18 AM, mdipierro mdipie...@cs.depaul.edu wrote:
 I have some problems:

 1) people ask me to contribute to more projects that I can handle.
 2) I am good at kicking off a project (20% of the work) but I am not
 the best person to bring it to production (the other 80%) of the work.
 3) I want to delegate some of these projects to users I trust. I need
 to better keep track of you, the users, your skills and interests.

 You and I have some problems in common:
 1)  you are an individual or you own a small consulting company and
 you find hard to compete for large projects
 2) you want to use web2py but you need to sell web2py before you can
 sell yoru services.
 3) you need legal help (sample non-disclosure agreement, sample
 contracts, etc.)
 4) for large projects you need to find people who can help you with
 development (you man need a designer, a coder, a system administrator,
 a GAE expert, etc).
 5) you want somebody else to handle advertising for you

 I want to help. I want to help you find development jobs, network, and
 compete for larger projects by providing some assistance.

 I am about to create something like an association of web2py
 professionals with a portal that provides web sites for members,
 repository of legal forms, job posting, progress tracking, feedback
 forms, etc. Here is the basic idea: we do not advertise web2py, we
 advertise the association and its members. you find a client? you keep
 all the money. You want to offer your client long term support or code
 review? the association will sell that to the client directly
 directly. You want to be listed as a member? Follow a code of conduct
 (basically use approved tools and ask your clients to review your work
 publicly). You already have a consulting company or an employer? You
 can have the company listed as an associate under some conditions.

 We can turn our group into a large international consulting
 organization overnight. There would be no contract between the
 association and you other than a code of conduct that you will have to
 follow to be listed and that I am about to wrote. You can continue to
 work as an individual or with your existing company. The association
 will just help when you need help.

 The association may also partner with some member to provide venture
 capital in the form of code development (and perhaps money but not
 immediately) for specific projects submitted to the association, in
 exchange of shares.

 I have already incorporated to do this. This will be independent and
 complementary form web2py itself and web2py would not be the only tool
 in the association approved toolkit.

 For now the toolkit will include: web2py, ubuntu, postgresql, jquery,
 and google app engine. You as an individual or a company can provide
 services based on other tools but the association will endorse these
 tools because we can easily find people skilled in them and you, as a
 member, will be required to endorse these tools as good tools and
 demonstrate your skills in some of them (not all of them).

 web2py is a tool. We will all outlive web2py. But we have created
 something important here. A community of skilled professional that
 share some experience. I want to see this grow with web2py and beyond
 web2py later. I want to see us compete with large consulting
 companies. I want to do it using a new business model in which there
 are no shareholders to take a cut of your work since they would not be
 providing any means of production to you (you already own a laptop and
 that is your office), yet I want to provide the other benefits that a
 large corporation can offer (a single image, consistency,
 reliability).

 Not sure if there should be an admission criteria. I could use your
 feedback about this.

 Comments? Thought? You do not have to commit to anything now but who
 is interested?

 Massimo



[web2py] Re: GAE, parents, and row objects.

2010-05-24 Thread Matt
Does web2py have a feature/request tracking system?

I'm really keen to see this added - if possible - as it's a core part
of GAE.

Matt

On Apr 25, 10:44 am, Matt mjwat...@gmail.com wrote:
 Yes it is.

 I'm happy to raise a feature request for this.

 Matt

 On Apr 21, 6:07 am, howesc how...@umich.edu wrote:

  isparentaGAEthing?

  if not, then wouldn'tparentbe setup as a reference to book (in this
  example), and
  db.review.insert(parent= book.id, text = 'The book was great) would
  work?

  cfh

  On Apr 18, 9:15 pm, Matt mjwat...@gmail.com wrote:

   Thanks Massimo.

   Matt

   On Apr 19, 1:53 pm, mdipierro mdipie...@cs.depaul.edu wrote:

No but there should. Will look into this. If anybody has come concrete
proposals, let me know.

Massimo

On Apr 18, 7:30 pm, Matt mjwat...@gmail.com wrote:

 Hi,

 Quick question when using web2py withGAE.

 I need to assign a model as theparentof another entity.

 How can I retrieve theGAEmodel instance from a web2py query...?

       book = db.book[request.args(0)]

       [The book is returned as a row]

       I'd like to do the following:

       db.review.insert(parent= book, text = 'The book was great)

       Is there an easy way to do this?

 Thanks in advance,
 Matt

 --
 Subscription 
 settings:http://groups.google.com/group/web2py/subscribe?hl=en


[web2py] Re: URGENT help Needed !!! Register at T3 fails me in an urgent paid job for a website!

2010-05-24 Thread GoldenTiger
Thanks a lot Massimo!

Yes I remember you said me something like that 2 weeks ago, I was
lucky.
Really the concept of T3 could englobe alot of websites, and the
default layout likes me, so simple and elegant

Thanks again!

On 24 mayo, 22:51, mdipierro mdipie...@cs.depaul.edu wrote:
 Let me add a comment this is one of the reasons for the
 association described 
 herehttp://groups.google.com/group/web2py/browse_thread/thread/7c61c52feb...

 Some tools like T3 are not supported so you are on your own (although
 other people and I will help anyway if I can) and take huge risks.
 Other tools are supported better, like web2py core libraries. The
 association can help make a distinction.

 Eventually we'll have something replacing T3.

 On May 24, 3:45 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  On top of the modules/t2.py try add

  import uuid

  On May 24, 3:41 pm, GoldenTiger goldenboy...@gmail.com wrote:

   I have read the old thread titled:  t3 strange error on 1.71.0 
   and i couldnt solve it

   I was contracted to coding a website in a short time, and then I
   discovered web2py
   Last 2 weeks I have been reading web2py info alot of hours a day, Now
   I am desperate!!

   Description or the problem:
   1- I have a Mac, a PC (win) and the web hosting I recommended to my
   client is Webfaction, (yes, rocks)

   2- The behaviour is the same at mi Leopard, XP or Webfaction:  I
   register like admin and then set 'mail_administrator' = my email

   3- The website requires email verification to users, so I set
   settings.email_verification=True

   4- I configure my gmail to try:
   settings.email_server='smtp.gmail.com:587'
   settings.email_auth= 'goldenboy.es:mygmailpass'

   5- settings.host_url= 'http://www.website.com;
   6- leaving update response as is
   the email_text include a  'registration_key', but i dont find it at
   any place of code of T3

     t2.messages.register_email_body=Click here +settings.host_url
   +/+request.application+/default/verify?key=%(registration_key)s to
   complete registration

   7- Any attempt of registering show 2 errors

    in controllers/default.py, at lines  29 and 112
   and :  -- NameError: global name 'uuid' is not defined

   8 - I know that error ocurrs only when mail_verification is true, so
   I figure out that if i can't see key in any place of code, then uuid-
   py may be necesary to generate the universal unique id.

   Questions:

   *** Any of you can give a aproximate response?

    what diferences is bettwen changing a variable at db.py or at
   models of T3, isit ok?

   *** is there any variable to disable the necessity of
   registration_key  variable?

   Thanks alot of you !!!


[web2py] Re: URGENT help Needed !!! Register at T3 fails me in an urgent paid job for a website!

2010-05-24 Thread GoldenTiger
one more dude, have to restart wev2py in webfaction now or when i add
a new T3?

On 25 mayo, 00:38, GoldenTiger goldenboy...@gmail.com wrote:
 Thanks a lot Massimo!

 Yes I remember you said me something like that 2 weeks ago, I was
 lucky.
 Really the concept of T3 could englobe alot of websites, and the
 default layout likes me, so simple and elegant

 Thanks again!

 On 24 mayo, 22:51, mdipierro mdipie...@cs.depaul.edu wrote:

  Let me add a comment this is one of the reasons for the
  association described 
  herehttp://groups.google.com/group/web2py/browse_thread/thread/7c61c52feb...

  Some tools like T3 are not supported so you are on your own (although
  other people and I will help anyway if I can) and take huge risks.
  Other tools are supported better, like web2py core libraries. The
  association can help make a distinction.

  Eventually we'll have something replacing T3.

  On May 24, 3:45 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   On top of the modules/t2.py try add

   import uuid

   On May 24, 3:41 pm, GoldenTiger goldenboy...@gmail.com wrote:

I have read the old thread titled:  t3 strange error on 1.71.0 
and i couldnt solve it

I was contracted to coding a website in a short time, and then I
discovered web2py
Last 2 weeks I have been reading web2py info alot of hours a day, Now
I am desperate!!

Description or the problem:
1- I have a Mac, a PC (win) and the web hosting I recommended to my
client is Webfaction, (yes, rocks)

2- The behaviour is the same at mi Leopard, XP or Webfaction:  I
register like admin and then set 'mail_administrator' = my email

3- The website requires email verification to users, so I set
settings.email_verification=True

4- I configure my gmail to try:
settings.email_server='smtp.gmail.com:587'
settings.email_auth= 'goldenboy.es:mygmailpass'

5- settings.host_url= 'http://www.website.com;
6- leaving update response as is
the email_text include a  'registration_key', but i dont find it at
any place of code of T3

  t2.messages.register_email_body=Click here +settings.host_url
+/+request.application+/default/verify?key=%(registration_key)s to
complete registration

7- Any attempt of registering show 2 errors

 in controllers/default.py, at lines  29 and 112
and :  -- NameError: global name 'uuid' is not defined

8 - I know that error ocurrs only when mail_verification is true, so
I figure out that if i can't see key in any place of code, then uuid-
py may be necesary to generate the universal unique id.

Questions:

*** Any of you can give a aproximate response?

 what diferences is bettwen changing a variable at db.py or at
models of T3, isit ok?

*** is there any variable to disable the necessity of
registration_key  variable?

Thanks alot of you !!!


[web2py] Re: URGENT help Needed !!! Register at T3 fails me in an urgent paid job for a website!

2010-05-24 Thread mdipierro
You have to restart web2py when you have modules, not when you edit
modles/views/controllers

On May 24, 5:55 pm, GoldenTiger goldenboy...@gmail.com wrote:
 one more dude, have to restart wev2py in webfaction now or when i add
 a new T3?

 On 25 mayo, 00:38, GoldenTiger goldenboy...@gmail.com wrote:

  Thanks a lot Massimo!

  Yes I remember you said me something like that 2 weeks ago, I was
  lucky.
  Really the concept of T3 could englobe alot of websites, and the
  default layout likes me, so simple and elegant

  Thanks again!

  On 24 mayo, 22:51, mdipierro mdipie...@cs.depaul.edu wrote:

   Let me add a comment this is one of the reasons for the
   association described 
   herehttp://groups.google.com/group/web2py/browse_thread/thread/7c61c52feb...

   Some tools like T3 are not supported so you are on your own (although
   other people and I will help anyway if I can) and take huge risks.
   Other tools are supported better, like web2py core libraries. The
   association can help make a distinction.

   Eventually we'll have something replacing T3.

   On May 24, 3:45 pm, mdipierro mdipie...@cs.depaul.edu wrote:

On top of the modules/t2.py try add

import uuid

On May 24, 3:41 pm, GoldenTiger goldenboy...@gmail.com wrote:

 I have read the old thread titled:  t3 strange error on 1.71.0 
 and i couldnt solve it

 I was contracted to coding a website in a short time, and then I
 discovered web2py
 Last 2 weeks I have been reading web2py info alot of hours a day, Now
 I am desperate!!

 Description or the problem:
 1- I have a Mac, a PC (win) and the web hosting I recommended to my
 client is Webfaction, (yes, rocks)

 2- The behaviour is the same at mi Leopard, XP or Webfaction:  I
 register like admin and then set 'mail_administrator' = my email

 3- The website requires email verification to users, so I set
 settings.email_verification=True

 4- I configure my gmail to try:
 settings.email_server='smtp.gmail.com:587'
 settings.email_auth= 'goldenboy.es:mygmailpass'

 5- settings.host_url= 'http://www.website.com;
 6- leaving update response as is
 the email_text include a  'registration_key', but i dont find it at
 any place of code of T3

   t2.messages.register_email_body=Click here +settings.host_url
 +/+request.application+/default/verify?key=%(registration_key)s to
 complete registration

 7- Any attempt of registering show 2 errors

  in controllers/default.py, at lines  29 and 112
 and :  -- NameError: global name 'uuid' is not defined

 8 - I know that error ocurrs only when mail_verification is true, so
 I figure out that if i can't see key in any place of code, then uuid-
 py may be necesary to generate the universal unique id.

 Questions:

 *** Any of you can give a aproximate response?

  what diferences is bettwen changing a variable at db.py or at
 models of T3, isit ok?

 *** is there any variable to disable the necessity of
 registration_key  variable?

 Thanks alot of you !!!


[web2py] Re: display a stored .jpg during a record list or update

2010-05-24 Thread mdipierro
oops... that was before I drunk my second daily espresso.

On May 24, 4:03 pm, NetAdmin mr.netad...@gmail.com wrote:
 There IS NO SQLHTML :-)

 I figure Massimo meant SQLFORM ... and the follow code works!

 Thanks!  Thanks!  Thanks!

 def editrec():
   #
   #  edit record 1
   #
   # form = SQLFORM( db.tbbooks, 1 )
   form = SQLFORM(db.tbbooks,1,
 upload=URL(r=request,f='download') )
   return dict ( form = form )

 On May 24, 3:53 pm, NetAdmin mr.netad...@gmail.com wrote:

  Whoa!  SQLHTML? I didn't even know that existed!

  Thanks for the tip!

  On May 24, 3:37 pm, mdipierro mdipie...@cs.depaul.edu wrote:

   If you are looking for a preview of the uploaded images when editing a
   record you can to do

   form = SQLHTML(,upload=URL(r=request,f='download'))

   On May 24, 10:52 am, NetAdmin mr.netad...@gmail.com wrote:

I'm a bit confused.

During an edit or listing of all books,
how can I display the .jpg file that is
stored in the field named coverblob ?

I can only see the blob field contents
when using appadmin.

Thanks!

==   db.py  ==

db.define_table( 'tbbooks' ,
  SQLField('booktitle' , 'string', length=20),
  SQLField('cover', 'upload', uploadfield='coverblob'),
  SQLField('coverblob', 'blob')
)

 default.py  ==

def index():
  #
  #   select all books
  #
  recs = db().select(db.tbbooks.ALL,orderby=db.tbbooks.booktitle)
  return dict ( recs = recs )

def editrec():
  #
  #  edit record 1
  #
  form = SQLFORM( db.tbbooks, 1 )
  #
  if form.accepts(request.vars, session):
    response.flash = 'Done!'
  #
  return dict ( form = form )

def insrec():
  #
  # insert a new record
  #
  form = SQLFORM( db.tbbooks )
  #
  if form.accepts(request.vars, session):
    response.flash = 'Done!'
  #
  return dict ( form = form )

==


[web2py] Re: problem (?) with SQLTABLE linkto

2010-05-24 Thread mdipierro
This is done on purpose. The fact is the record may reference more
than one tables. Since there is no machanism to pass multiple URLs,
the table name has to be an attribute. Sorry.

On May 24, 5:03 pm, infodoc rc...@juno.com wrote:
 Hello,

 web2py newbie here.  Am using SQLTABLE and linkto, and finding it adds
 an extra variable to the url when I click on a link it creates.
 Relevant files:

 menu.py (the following works fine  as a one entry in a longer list):
 …
 [T('Profession'), False, URL(request.application,'default',
 'profession')],
 …

 default.py:
 def profession():
     if request.args:
  response.view = 'default/crud.html'
        return dict(form = crud.update(
             db.profession,
             request.args[1],
             next = URL(r = request, f = 'profession')
         ))
     else:
         rows = db().select(db.profession.ALL)
         response.view = 'default/table.html'
         return dict(table = SQLTABLE(
             rows,
 linkto = URL(r=request)
         ))

 Entering

 http://127.0.0.1:8000/conted/default/profession

 works great – returns a page with a nice table.  Clicking on an id 1
 as hyperlink in the table creates

 http://127.0.0.1:8000/conted/default/profession/profession/1

 This returns a form to edit the record.  However, see how ‘profession’
 has been duplicated?  What I would prefer instead is

 http://127.0.0.1:8000/conted/default/profession/1

 Is what I want possible (or even desirable?).  I may be approaching
 this completely wrong.  If so, would appreciate a hint in the right
 direction.

 Thanks in advance,

 R


[web2py] help with auth.requires_login()

2010-05-24 Thread Massimo Di Pierro

It would be nice to be able to pass the following arguments to

@auth.requires_login(next=URL(...),message=T(...))

where next is the url to redirect to in case of no login. message is  
the message to be displayed.
If somebody has time and wants to take a crack at it, let me know. It  
should be possible by modifying only the requires_login method.
The problem is passing the arguments from the decorator to the  
function being returned.


Once the problem is solved we can add the feature to  
requires_membership and requires_permissions.


Massimo


[web2py] Re: URGENT help Needed !!! Register at T3 fails me in an urgent paid job for a website!

2010-05-24 Thread GoldenTiger
Done and working on mac,windows and webaction

and requires deleting t2.pyc (or cleaning from web2py)


[web2py] web2py hosting - least intervention required

2010-05-24 Thread greenpoise
I am looking for web2py hosting. I have seen most posts of webfaction.
I just want to make sure that what I pick requires the least of my
intervention to get it going. Leads?


THanks in Advance



[web2py] Re: web2py hosting - least intervention required

2010-05-24 Thread mdipierro
I use vps.net and I am very happy with it.

On May 24, 7:10 pm, greenpoise danel.sega...@gmail.com wrote:
 I am looking for web2py hosting. I have seen most posts of webfaction.
 I just want to make sure that what I pick requires the least of my
 intervention to get it going. Leads?

 THanks in Advance


[web2py] Re: [off-topic] UI frameworks like: ExtJs, Pivot

2010-05-24 Thread Richard
JqueryUI/ExtJS has great widgets for individual tasks (datepicker,
etc) but I find myself creating a lot of custom CSS and JavaScript for
larger apps.
I'm hoping one of these AJAX frameworks will be my silver bullet for
the front-end, like web2py is for the backend.

Would be interested to hear feedback from others who appreciate
web2py.

Vasile: Is it practical to develop Flex apps on Linux without
purchasing anything from Adobe?

Richard


On May 24, 11:48 am, Vasile Ermicioi elff...@gmail.com wrote:
 You are quite informed about web 2.0 frameworks,

 but I can't understand what is less than ExtJS (for e.g) and jquery don't
 have ?

 here is a list to look at

 http://jqueryui.com/demos/http://flowplayer.org/tools/index.htmlhttp://plugins.jquery.com/


[web2py] python 2.4 support

2010-05-24 Thread Cory Coager
I'm looking at a web host that uses python 2.4.  I'm wondering what
the compatibility is with python 2.4?  Is there any caveats?  Should I
just move on and find another host that uses python 2.5?


[web2py] Re: Custom registration form -- password_two

2010-05-24 Thread weheh
@mdp: It isn't obvious to me how to mix the auth code with
SQLFORM.factory and accept. The problem is that auth is such a black
box that I don't know where to break into the flow of it.

I believe this issue has come up enough times and been such a
consistent stumbling block that I suggest you or someone else spell it
out concretely (show the model, controller, and view) and put it
either in the doc or in Alterego or somewhere findable. I can't
imagine it's more than 20 or 30 lines of code total and would save
loads of time and effort in the long run.


Re: [web2py] help with auth.requires_login()

2010-05-24 Thread Álvaro Justen
On Mon, May 24, 2010 at 20:07, Massimo Di Pierro
mdipie...@cs.depaul.edu wrote:
 It would be nice to be able to pass the following arguments to

 @auth.requires_login(next=URL(...),message=T(...))

 where next is the url to redirect to in case of no login. message is the
 message to be displayed.
 If somebody has time and wants to take a crack at it, let me know. It should
 be possible by modifying only the requires_login method.
 The problem is passing the arguments from the decorator to the function
 being returned.

 Once the problem is solved we can add the feature to requires_membership and
 requires_permissions.

What about using the Google Code issue system?
Really, I like BitBucket's more. :-)

-- 
Álvaro Justen - Turicas
 http://blog.justen.eng.br/
 21 9898-0141


[web2py] Re: python 2.4 support

2010-05-24 Thread mdipierro
The only caveats are that you need hashlib and pysqlite. You can
install with virtualenv. I think it goes something like this but I did
not try mywself

# install virtualenv
easy_install virtualenv
python virtualenv.py w2env
# install missing modules
w2env/bin/easy_install -U pysqlite hashlib
# donwload web2py and unpack
wget http://web2py.com/examples/static/web2py_src.zip
unzip web2py_src.zip
cd web2py
# start web2py using command-line script
../w2env/bin/python web2py.py -i 0.0.0.0 -p 8123 -a 'adminpasswd'



On May 24, 7:25 pm, Cory Coager ccoa...@gmail.com wrote:
 I'm looking at a web host that uses python 2.4.  I'm wondering what
 the compatibility is with python 2.4?  Is there any caveats?  Should I
 just move on and find another host that uses python 2.5?


[web2py] Re: python 2.4 support

2010-05-24 Thread Cory Coager
Is this possible without root permissions?


[web2py] Re: GAE, parents, and row objects.

2010-05-24 Thread Yarko Tymciurak

On May 24, 5:32 pm, Matt mjwat...@gmail.com wrote:
 Does web2py have a feature/request tracking system?

Technically,  google code has bugtracking;

Practically, Massimo's always just answered questions here, and made
updates from posts here.
In the past, trying to do _both_ for web2py just turned out to be
extra work, no real extra benefit (at this point).

- Yarko


 I'm really keen to see this added - if possible - as it's a core part
 of GAE.

 Matt

 On Apr 25, 10:44 am, Matt mjwat...@gmail.com wrote:



  Yes it is.

  I'm happy to raise a feature request for this.

  Matt

  On Apr 21, 6:07 am, howesc how...@umich.edu wrote:

   isparentaGAEthing?

   if not, then wouldn'tparentbe setup as a reference to book (in this
   example), and
   db.review.insert(parent= book.id, text = 'The book was great) would
   work?

   cfh

   On Apr 18, 9:15 pm, Matt mjwat...@gmail.com wrote:

Thanks Massimo.

Matt

On Apr 19, 1:53 pm, mdipierro mdipie...@cs.depaul.edu wrote:

 No but there should. Will look into this. If anybody has come concrete
 proposals, let me know.

 Massimo

 On Apr 18, 7:30 pm, Matt mjwat...@gmail.com wrote:

  Hi,

  Quick question when using web2py withGAE.

  I need to assign a model as theparentof another entity.

  How can I retrieve theGAEmodel instance from a web2py query...?

        book = db.book[request.args(0)]

        [The book is returned as a row]

        I'd like to do the following:

        db.review.insert(parent= book, text = 'The book was great)

        Is there an easy way to do this?

  Thanks in advance,
  Matt

  --
  Subscription 
  settings:http://groups.google.com/group/web2py/subscribe?hl=en


[web2py] Re: web2py hosting - least intervention required

2010-05-24 Thread Yarko Tymciurak
webfaction - shared hosting - means all you need to worry about is
your application.
If your traffic is realtively low, this is really easy.

VPS is cloud hosting, so not sure what the setup is - but you can
probably expect to be root on your own linux slice.
Massimo will be able to say if he had to configure Apache, or how far
it came preconfigured.

It does look like the sweet deal for entering the cloud.   And your
responsiveness will be noticeably better.

- Yarko

On May 24, 7:12 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 I use vps.net and I am very happy with it.

 On May 24, 7:10 pm, greenpoise danel.sega...@gmail.com wrote:



  I am looking for web2py hosting. I have seen most posts of webfaction.
  I just want to make sure that what I pick requires the least of my
  intervention to get it going. Leads?

  THanks in Advance


[web2py] Re: python 2.4 support

2010-05-24 Thread mdipierro
from

http://www.logilab.org/blogentry/22498

I actually recommend creating a virtualenv environment without any
kind of installation.  Grab this file: 
http://bitbucket.org/ianb/virtualenv/raw/tip/virtualenv.py
-- and you can run it like python virtualenv.py new-environment/
This installs Setuptools (or Distribute if you pass it a --distribute
flag) and pip, and virtualenv doesn't need any installation itself.
Also you don't need any root access on the machine.  Also you can
download and unpack the tarball and run the virtualenv.py script from
within there (the tarball comes with all the source code for
Setuptools, Distribute, and pip, so creating new environments then
doesn't require downloading anything additional).


On May 24, 8:49 pm, Cory Coager ccoa...@gmail.com wrote:
 Is this possible without root permissions?


[web2py] Re: web2py hosting - least intervention required

2010-05-24 Thread mdipierro
VPS just gives you a Virtual Private Server for $25/month (including
daily, weakly and monthly backups). You can install one of the many
images they provide (like Ubuntu or any of the TurnKeyLinux
appliances). On Ubuntu installing and configuring a full apache/
postresql/postfix/web2py just requires running /web2py/scripts/setup-
web2py-ubuntu.sh

They have a slider on the admin web site that lets you change the size
of the virtual machine. They have API that allows you partition it and
spawn more instances.I did not use these features.

It is similar to Amazon but simpler (not S3, no SimpleDB) and much
faster to deploy/administer.

Massimo

On May 24, 9:02 pm, Yarko Tymciurak resultsinsoftw...@gmail.com
wrote:
 webfaction - shared hosting - means all you need to worry about is
 your application.
 If your traffic is realtively low, this is really easy.

 VPS is cloud hosting, so not sure what the setup is - but you can
 probably expect to be root on your own linux slice.
 Massimo will be able to say if he had to configure Apache, or how far
 it came preconfigured.

 It does look like the sweet deal for entering the cloud.   And your
 responsiveness will be noticeably better.

 - Yarko

 On May 24, 7:12 pm, mdipierro mdipie...@cs.depaul.edu wrote:

  I use vps.net and I am very happy with it.

  On May 24, 7:10 pm, greenpoise danel.sega...@gmail.com wrote:

   I am looking for web2py hosting. I have seen most posts of webfaction.
   I just want to make sure that what I pick requires the least of my
   intervention to get it going. Leads?

   THanks in Advance


[web2py] Re: problem (?) with SQLTABLE linkto

2010-05-24 Thread infodoc
Thanks for the quick response.  No need to apologize.
Great job on web2py.  I love its straight-forwardness.  Thanks for
that as well!

R


On May 24, 4:03 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 This is done on purpose. The fact is the record may reference more
 than one tables. Since there is no machanism to pass multiple URLs,
 the table name has to be an attribute. Sorry.

 On May 24, 5:03 pm, infodoc rc...@juno.com wrote:

  Hello,

  web2py newbie here.  Am using SQLTABLE and linkto, and finding it adds
  an extra variable to the url when I click on a link it creates.
  Relevant files:

  menu.py (the following works fine  as a one entry in a longer list):
  …
  [T('Profession'), False, URL(request.application,'default',
  'profession')],
  …

  default.py:
  def profession():
      if request.args:
   response.view = 'default/crud.html'
         return dict(form = crud.update(
              db.profession,
              request.args[1],
              next = URL(r = request, f = 'profession')
          ))
      else:
          rows = db().select(db.profession.ALL)
          response.view = 'default/table.html'
          return dict(table = SQLTABLE(
              rows,
  linkto = URL(r=request)
          ))

  Entering

 http://127.0.0.1:8000/conted/default/profession

  works great – returns a page with a nice table.  Clicking on an id 1
  as hyperlink in the table creates

 http://127.0.0.1:8000/conted/default/profession/profession/1

  This returns a form to edit the record.  However, see how ‘profession’
  has been duplicated?  What I would prefer instead is

 http://127.0.0.1:8000/conted/default/profession/1

  Is what I want possible (or even desirable?).  I may be approaching
  this completely wrong.  If so, would appreciate a hint in the right
  direction.

  Thanks in advance,

  R


[web2py] Re: Production releases

2010-05-24 Thread GoldenTiger
Great!! really I 've already planned doing it because i have personal
projects that I decided doing it with web2py, instead of django.
so for my part I feel better being gratefull with you by all
knowledge, by now i got a good paid job by urgent webs, and web2py do
it easy anf funny

My friend's company is a group of 12 hackers about 30 years old , who
really enjoy with this. I think theirs strengths are remote testing of
linux servers and web applications, the company is on Madrid (Spain),
but generally they spends most of his time along auditing systems in
another sites of Europe

I 'll talk with them soon, and I say you
you could for example prepare a dedicated server with web2py and
probing diferrent server, os, bd, or apps .
you goes coding and you want to test. You should be say the level at
you want web2py be tested. net level? bruteforce alowed? local access?
transport level? application?  if you use ubuntu, you could want
testing web2py at ubuntu, or web2py at ubuntu and cherry, and decide
if you are included or not in that

The other way I know of testing an app is undestanding how components
are conected, and undestanding the consistency of the logic . Really
this is my preffered one ^^ It's not necessary to hack, just imagine




On 22 mayo, 16:31, mdipierro mdipie...@cs.depaul.edu wrote:
 I am very much interested in this. We may even find a couple of $100
 to pay for some security testing of web2py. Let me know what we need
 to do.

 Massimo

 On May 22, 8:53 am, GoldenTiger goldenboy...@gmail.com wrote:

  Well, I have been working for years as security auditor and etichal
  hacking. Last years I decided focusing at more creative works and I
  started personal projects.
  I can do tests against web2py, no problem, but first I want to
  understand the framework as well as possible.
  a friend of mine who auditsbanksweb and networks is interested in
  python frameworks as I said him, so they could be a good help
  In my opinion, the most important thing in secure software is the
  design and the logic, ( microsoft declared some windows desing flaws
  as a not possible solution)
  since web2py was designed 100% before implemention, I can say that
  web2py is probably one of the most consistent frameworks today
  :D


[web2py] Re: Production releases

2010-05-24 Thread mdipierro
I do not know the answer to those questions. I can only say that at
least you should test the features we claim (sql injection protection,
xss protection, cross site request forgery protection, and the auth
mechanism). The rest really depends on the tools and time you have
available. Perhaps other users have more to say. I appreciate your
interest in this.

Massimo

On May 24, 10:19 pm, GoldenTiger goldenboy...@gmail.com wrote:
 Great!! really I 've already planned doing it because i have personal
 projects that I decided doing it with web2py, instead of django.
 so for my part I feel better being gratefull with you by all
 knowledge, by now i got a good paid job by urgent webs, and web2py do
 it easy anf funny

 My friend's company is a group of 12 hackers about 30 years old , who
 really enjoy with this. I think theirs strengths are remote testing of
 linux servers and web applications, the company is on Madrid (Spain),
 but generally they spends most of his time along auditing systems in
 another sites of Europe

 I 'll talk with them soon, and I say you
 you could for example prepare a dedicated server with web2py and
 probing diferrent server, os, bd, or apps .
 you goes coding and you want to test. You should be say the level at
 you want web2py be tested. net level? bruteforce alowed? local access?
 transport level? application?  if you use ubuntu, you could want
 testing web2py at ubuntu, or web2py at ubuntu and cherry, and decide
 if you are included or not in that

 The other way I know of testing an app is undestanding how components
 are conected, and undestanding the consistency of the logic . Really
 this is my preffered one ^^ It's not necessary to hack, just imagine

 On 22 mayo, 16:31, mdipierro mdipie...@cs.depaul.edu wrote:

  I am very much interested in this. We may even find a couple of $100
  to pay for some security testing of web2py. Let me know what we need
  to do.

  Massimo

  On May 22, 8:53 am, GoldenTiger goldenboy...@gmail.com wrote:

   Well, I have been working for years as security auditor and etichal
   hacking. Last years I decided focusing at more creative works and I
   started personal projects.
   I can do tests against web2py, no problem, but first I want to
   understand the framework as well as possible.
   a friend of mine who auditsbanksweb and networks is interested in
   python frameworks as I said him, so they could be a good help
   In my opinion, the most important thing in secure software is the
   design and the logic, ( microsoft declared some windows desing flaws
   as a not possible solution)
   since web2py was designed 100% before implemention, I can say that
   web2py is probably one of the most consistent frameworks today
   :D


Re: [web2py] Re: Custom registration form -- password_two

2010-05-24 Thread Thadeus Burgess
Stick the following code in a controller


import copy

user_table = [copy.copy(f) for f in db.auth_user]
form = SQLFORM.factory(
*user_table,
Field('password2', 'password', length=512,
requires=db.auth_user.password.requires),
)

if form.accepts(request.vars, session):
if form.vars.password == form.vars.password2:
user = db.auth_user.insert(
first_name = form.vars.first_name,
last_name = form.vars.last_name,
username = form.vars.username,
password = form.vars.password,
registration_key = web2py_uuid(),
)

if auth.settings.create_user_groups:
group_id = auth.create_group(user_%s user.id)

# etc etc for sending mail

# to auto log them in
session.auth = Storage(user = user, last_visit = request.now,
expiration = auth.settings.expiration)
else:
form.errors.password = form.errors.password2 = Passwords do not match

Of course, you lose some of the finer things such as sending emails,
which could be added by looking at tools.py

--
Thadeus





On Mon, May 24, 2010 at 7:39 PM, weheh richard_gor...@verizon.net wrote:
 @mdp: It isn't obvious to me how to mix the auth code with
 SQLFORM.factory and accept. The problem is that auth is such a black
 box that I don't know where to break into the flow of it.

 I believe this issue has come up enough times and been such a
 consistent stumbling block that I suggest you or someone else spell it
 out concretely (show the model, controller, and view) and put it
 either in the doc or in Alterego or somewhere findable. I can't
 imagine it's more than 20 or 30 lines of code total and would save
 loads of time and effort in the long run.



Re: [web2py] Re: Custom registration form -- password_two

2010-05-24 Thread Thadeus Burgess
Wait... Doesn't web2py already have this built in?

Maybe I don't understand the question...

Using a plain vanilla `form = auth()` You get a register form...

http://thadeusb.com/admin/user/register

--
Thadeus





On Mon, May 24, 2010 at 10:57 PM, Thadeus Burgess thade...@thadeusb.com wrote:
 Stick the following code in a controller


 import copy

 user_table = [copy.copy(f) for f in db.auth_user]
 form = SQLFORM.factory(
    *user_table,
    Field('password2', 'password', length=512,
 requires=db.auth_user.password.requires),
 )

 if form.accepts(request.vars, session):
    if form.vars.password == form.vars.password2:
        user = db.auth_user.insert(
            first_name = form.vars.first_name,
            last_name = form.vars.last_name,
            username = form.vars.username,
            password = form.vars.password,
            registration_key = web2py_uuid(),
        )

        if auth.settings.create_user_groups:
            group_id = auth.create_group(user_%s user.id)

        # etc etc for sending mail

        # to auto log them in
        session.auth = Storage(user = user, last_visit = request.now,
                expiration = auth.settings.expiration)
    else:
        form.errors.password = form.errors.password2 = Passwords do not match

 Of course, you lose some of the finer things such as sending emails,
 which could be added by looking at tools.py

 --
 Thadeus





 On Mon, May 24, 2010 at 7:39 PM, weheh richard_gor...@verizon.net wrote:
 @mdp: It isn't obvious to me how to mix the auth code with
 SQLFORM.factory and accept. The problem is that auth is such a black
 box that I don't know where to break into the flow of it.

 I believe this issue has come up enough times and been such a
 consistent stumbling block that I suggest you or someone else spell it
 out concretely (show the model, controller, and view) and put it
 either in the doc or in Alterego or somewhere findable. I can't
 imagine it's more than 20 or 30 lines of code total and would save
 loads of time and effort in the long run.




Re: [web2py] Re: Custom registration form -- password_two

2010-05-24 Thread Thadeus Burgess
This may be a stupid question but...

Why are you not using form.custom ?


{{form.custom.start}}

fieldset{{form.custom.email.widget}}/fieldset
--
Thadeus





On Mon, May 24, 2010 at 11:15 PM, Thadeus Burgess thade...@thadeusb.com wrote:
 Wait... Doesn't web2py already have this built in?

 Maybe I don't understand the question...

 Using a plain vanilla `form = auth()` You get a register form...

 http://thadeusb.com/admin/user/register

 --
 Thadeus





 On Mon, May 24, 2010 at 10:57 PM, Thadeus Burgess thade...@thadeusb.com 
 wrote:
 Stick the following code in a controller


 import copy

 user_table = [copy.copy(f) for f in db.auth_user]
 form = SQLFORM.factory(
    *user_table,
    Field('password2', 'password', length=512,
 requires=db.auth_user.password.requires),
 )

 if form.accepts(request.vars, session):
    if form.vars.password == form.vars.password2:
        user = db.auth_user.insert(
            first_name = form.vars.first_name,
            last_name = form.vars.last_name,
            username = form.vars.username,
            password = form.vars.password,
            registration_key = web2py_uuid(),
        )

        if auth.settings.create_user_groups:
            group_id = auth.create_group(user_%s user.id)

        # etc etc for sending mail

        # to auto log them in
        session.auth = Storage(user = user, last_visit = request.now,
                expiration = auth.settings.expiration)
    else:
        form.errors.password = form.errors.password2 = Passwords do not 
 match

 Of course, you lose some of the finer things such as sending emails,
 which could be added by looking at tools.py

 --
 Thadeus





 On Mon, May 24, 2010 at 7:39 PM, weheh richard_gor...@verizon.net wrote:
 @mdp: It isn't obvious to me how to mix the auth code with
 SQLFORM.factory and accept. The problem is that auth is such a black
 box that I don't know where to break into the flow of it.

 I believe this issue has come up enough times and been such a
 consistent stumbling block that I suggest you or someone else spell it
 out concretely (show the model, controller, and view) and put it
 either in the doc or in Alterego or somewhere findable. I can't
 imagine it's more than 20 or 30 lines of code total and would save
 loads of time and effort in the long run.





[web2py] in trunk - scraping utils

2010-05-24 Thread mdipierro
New in trunk. Screen scraping capabilities.

Example:
 import re
 from gluon.html import web2pyHTMLParser
 from urllib import urlopen
 html=urlopen('http://nobelprize.org/nobel_prizes/physics/laureates/1921/einstein-bio.html').read()
 tree=web2pyHTMLParser(html).tree  ### NEW!!
 elements=tree.elements('div') # search by tag type
 elements=tree.elements(_id=Einstein) # search by attribute value (id for 
 example)
 elements=tree.elements(find='Einstein') # text search NEW!!
 elements=tree.elements(find=re.compile('Einstein')) # search via regex NEW!!
 print elements[0]
titleAlbert Einstein - Biography/title
 print elements[0][0]
Albert Einstein - Biography
 elements[0].append(SPAN(' modified'))
titleAlbert Einstein - Biographyspanmodified/span/title
 print tree
html lang=en xml:lang=en xmlns=http://www.w3.org/1999/xhtml;
head
  titleAlbert Einstein - Biographyspanmodifiedspan/title
...


[web2py] Re: Custom registration form -- password_two [CLOSED (for now)]

2010-05-24 Thread weheh
@Thadeus: Thanks buddy. Appreciate it. As I suspected, it's got some
complexity behind it and the total solution, including emailing, etc.
takes a little doing.

I'm going to rethink how I'm approaching this. I think the right thing
to do is to leverage the underlying web2py infrastructure for doing
the whole user-account creation, validation, login, password
retrieval, etc. I've built this kind of stuff from scratch before and
it's a pain. So piggy-backing on web2py without modification is a big
win. But, I need to skin it to make it belong to my website. I suspect
the path I'm taking is making it a lot more complicated than it needs
to be. So for the time being, it's back to the drawing board.


[web2py] Re: in trunk - scraping utils

2010-05-24 Thread Kevin Bowling
Hmm, I wonder if this is worth the possible maintenance cost?  It also
transcends the role of a web framework and now you are getting into
network programming.

I have a currently deployed screen scraping app and found PyQuery to
be more than adequate.  There is also lxml directly, or Beautiful
Soup.  A simple import away and they integrate with web2py or anything
else just fine.  So why our own?

Regards,
Kevin

On May 24, 9:35 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 New in trunk. Screen scraping capabilities.

 Example: import re
  from gluon.html import web2pyHTMLParser
  from urllib import urlopen
  html=urlopen('http://nobelprize.org/nobel_prizes/physics/laureates/1921/einstein-bi...()
  tree=web2pyHTMLParser(html).tree  ### NEW!!
  elements=tree.elements('div') # search by tag type
  elements=tree.elements(_id=Einstein) # search by attribute value (id 
  for example)
  elements=tree.elements(find='Einstein') # text search NEW!!
  elements=tree.elements(find=re.compile('Einstein')) # search via regex 
  NEW!!
  print elements[0]

 titleAlbert Einstein - Biography/title print elements[0][0]

 Albert Einstein - Biography elements[0].append(SPAN(' modified'))

 titleAlbert Einstein - Biographyspanmodified/span/title print tree

 html lang=en xml:lang=en xmlns=http://www.w3.org/1999/xhtml;
 head
   titleAlbert Einstein - Biographyspanmodifiedspan/title
 ...


Re: [web2py] Re: Custom registration form -- password_two [CLOSED (for now)]

2010-05-24 Thread Thadeus Burgess
http://web2pyslices.com/main/default/user/register

Ok here is a link working since I disabled it on my blog.

This is just built into Auth class.

You can do custom styling with

{{form.custom.password_two.widget}}

And add by hand your fieldsets and etc.

Unless you are looking for more than just verify of the password, I
think this is the way to go.

--
Thadeus





On Mon, May 24, 2010 at 11:37 PM, weheh richard_gor...@verizon.net wrote:
 @Thadeus: Thanks buddy. Appreciate it. As I suspected, it's got some
 complexity behind it and the total solution, including emailing, etc.
 takes a little doing.

 I'm going to rethink how I'm approaching this. I think the right thing
 to do is to leverage the underlying web2py infrastructure for doing
 the whole user-account creation, validation, login, password
 retrieval, etc. I've built this kind of stuff from scratch before and
 it's a pain. So piggy-backing on web2py without modification is a big
 win. But, I need to skin it to make it belong to my website. I suspect
 the path I'm taking is making it a lot more complicated than it needs
 to be. So for the time being, it's back to the drawing board.



Re: [web2py] Re: in trunk - scraping utils

2010-05-24 Thread Thadeus Burgess
 So why our own?

Because it converts it into web2py helpers.

And you don't have to deal with installing anything other than web2py.

--
Thadeus





On Tue, May 25, 2010 at 12:14 AM, Kevin Bowling kevin.bowl...@gmail.com wrote:
 Hmm, I wonder if this is worth the possible maintenance cost?  It also
 transcends the role of a web framework and now you are getting into
 network programming.

 I have a currently deployed screen scraping app and found PyQuery to
 be more than adequate.  There is also lxml directly, or Beautiful
 Soup.  A simple import away and they integrate with web2py or anything
 else just fine.  So why our own?

 Regards,
 Kevin

 On May 24, 9:35 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 New in trunk. Screen scraping capabilities.

 Example: import re
  from gluon.html import web2pyHTMLParser
  from urllib import urlopen
  html=urlopen('http://nobelprize.org/nobel_prizes/physics/laureates/1921/einstein-bi...()
  tree=web2pyHTMLParser(html).tree  ### NEW!!
  elements=tree.elements('div') # search by tag type
  elements=tree.elements(_id=Einstein) # search by attribute value (id 
  for example)
  elements=tree.elements(find='Einstein') # text search NEW!!
  elements=tree.elements(find=re.compile('Einstein')) # search via regex 
  NEW!!
  print elements[0]

 titleAlbert Einstein - Biography/title print elements[0][0]

 Albert Einstein - Biography elements[0].append(SPAN(' modified'))

 titleAlbert Einstein - Biographyspanmodified/span/title print tree

 html lang=en xml:lang=en xmlns=http://www.w3.org/1999/xhtml;
 head
   titleAlbert Einstein - Biographyspanmodifiedspan/title
 ...