Re: [web2py] Multiple forms grouped as one (django formset equivalent) with jquery plugin allowing clients to add and remove forms on the client-side

2011-03-08 Thread Tom Atkins
The SheepIt jQuery plugin looks excellent - thanks for the link.  I'll need
to make this work with web2py sometime in the next couple of months.
 Hopefully someone else (not mentioning any names ;-) ) will provide some
example code before then!

On 9 March 2011 04:18, Dr Schmulge  wrote:

>
> Hi, Chris
> This is a briljant Jquery  plugin, to clone form elements dynamically.
> http://www.mdelrosso.com/sheepit/index.php?lng=en_GB&sec=home
>  I hope it's useful to you.
>  Regards,
> Janis
>


Re: [web2py] routes on GAE

2011-03-08 Thread Jonathan Lundell
On Mar 8, 2011, at 7:35 PM, Richard Baron Penman wrote:
> yes also worked for me.
> 
> People will need to change the application name, so should this be included 
> in app.yaml but commented out?

I think that app.yaml needs to become app.example.yaml (along the lines of 
routes.example.py and logging.example.conf), partly for that reason and partly 
so app.yaml doesn't get overwritten during an upgrade.

Too bad YAML doesn't support variable substitution.

> 
> 
> 
> On Wed, Mar 9, 2011 at 2:03 PM, Jonathan Lundell  wrote:
> On Mar 8, 2011, at 6:36 PM, Plumo wrote:
> > thanks John, that makes sense.
> 
> I tested it on the stock welcome app, and it seems to work fine. I'll send 
> Massimo a patch for the example app.yaml, since this is a fairly common 
> requirement.




[web2py] Re: Oracle DB - Select into an existing table DAL problem.

2011-03-08 Thread cjrh
On Mar 8, 9:26 pm, Pivert  wrote:
> - My first problem was a major typo in the documentation. For oracle
> connector, the username and password are not separated by : but by /,
> to the oracle connection string is : 
> oracle://username/password@DBNameInTnsnamesFile'

Fixed, thank you.


[web2py] Re: IS_NOT_IN_DB () Bypass the capital letters during validation

2011-03-08 Thread Yannick
Oh cool thanks... Haven't think about that. Thanks

On Mar 7, 5:40 am, Bernd Rothert  wrote:
> Hi Yannick,
>
> On 6 Mrz., 20:07, Yannick  wrote:
>
> > Hello mate,
>
> > A value is saved in the DB as lower case and we put this validation
> > "IS_NOT_IN_DB()". If for that field the user enter a Capital letter of
> > the same value saved the application will validate the entry.
>
> > This is not really good. Is there a way to avoid this in Web2py
> > without a need to build a customize validation method ?
>
> not exactly - but you can chain validators and use something as simple
> as:
>
> db.person.name.requires= [
>     lambda s: (s and s.lower(), None),
>     IS_NOT_IN_DB(db, db.person.name),
>     ]
>
> > Please let me know if you have an idea.
>
> > Cheers,
>
> Cheers
> Bernd


Re: [web2py] Multiple forms grouped as one (django formset equivalent) with jquery plugin allowing clients to add and remove forms on the client-side

2011-03-08 Thread Dr Schmulge
2011/3/4 ChrisT :
> Hello everyone,
>
> I am in the process of evaluating web2py and django to decide which
> one I am going to use for a project of mine.
> I am new to both frameworks and web frameworks in general (although I
> did experiment with Ruby on Rails a while back)
> I must say I am learning web2py much faster than Django which has a
> much steeper learning curve I think.
> For the past few days however I am trying to figure out the best way
> to do a (relatively) simple thing with both frameworks that I guess
> many people did before me.
> I wanted to have multiple forms grouped as one on a sigle page and a
> jquery plugin allowing clients to add and remove forms on the client-
> side.
> This would be very useful in many situations in my application.
> One example would be:
>   * Creating an invoice (table invoice with fields such as
> reference_no , issue_date, customer_name, etc.) with multiple invoice
> lines (table invoice_line with fields such as description, amount,
> etc.)
> So I need to create a single form for the invoice creation and the
> client must be able to add or remove from the form as many
> invoice_lines as needed each time.
> The fact is that I was able to figure the best way to do it in Django
> would be using formsets:
> http://docs.djangoproject.com/en/dev/topics/forms/formsets/
> and this: http://code.google.com/p/django-dynamic-formset/ jQuery
> pluging
> I am troubled I didn't find anything similar implemented in web2py, I
> am sure many people before me did the same thing using both
> frameworks. I found some pieces of code here and there that enabled me
> to come close to doing it using web2py but I consider my efforts a
> hack (and an incomplete one so far :-))
> I would like to know your opinions on how this should be done in
> web2py or how someone already did this.
> Please forgive my ignorance if I am missing the obvious here as I am
> new to all this. In fact this is my first post so go easy on me...
>
> Regards,
> ChrisT
Hi, Chris
This is a briljant Jquery  plugin, to clone form elements dynamically.
http://www.mdelrosso.com/sheepit/index.php?lng=en_GB&sec=home
 I hope it's useful to you.
 Regards,
Janis


[web2py] Re: advanced form question

2011-03-08 Thread DenesL

That is called cascaded fields.
One example: http://groups.google.com/group/web2py/msg/b2d536d444001565

Use the advanced group search
http://groups.google.com/groups/advanced_search?safe=off&q=group:web2py
to find more entries with "cascaded"
(type the word in the form where it says "all these words:").


On Mar 8, 5:09 am, Manuele Pesenti  wrote:
> Dear all,
> I need to construct a form with some fields that has to be choosen
> within a different set depending on another fields value... is there
> some examples on line to get inspiration from?
>
> I try to be a little more clear...
>
> if I have a field like that:
>
> Field('a', 'integer', requires=IS_IN_SET([1, 2, 3]))
>
> and a second field 'b' that has to choosen in different sets, for
> examples ['a', 'b'], ['c', 'd'], ['e', 'f', 'g'], depending on the
> choosen value of the field 'a'
>
> any idea?
>
> Thank you
>
>      Manuele


Re: [web2py] routes on GAE

2011-03-08 Thread Richard Baron Penman
yes also worked for me.

People will need to change the application name, so should this be included
in app.yaml but commented out?



On Wed, Mar 9, 2011 at 2:03 PM, Jonathan Lundell  wrote:

> On Mar 8, 2011, at 6:36 PM, Plumo wrote:
> > thanks John, that makes sense.
>
> I tested it on the stock welcome app, and it seems to work fine. I'll send
> Massimo a patch for the example app.yaml, since this is a fairly common
> requirement.
>
>


[web2py] Re: How to catch values from CRUD.CREATE and validate?

2011-03-08 Thread DenesL
To allow multiple room booking I would change the tables as follows:

db.define_table('room',
   Field('name','string'),
   Field('ubication','string'),
   format='%(name)s'
)

db.define_table('booking',
Field('room','list:reference room'),
Field('host','string'),
Field('approved','boolean',default=False)
)

then in validate you have to select the bookings that have approval
pending for processing.

In your index function set
db.booking.approved.writable = False
to avoid it being changed there, or even
db.booking.approved.readable = False

Also it is not clear who host can be. Another table?.
A user that is logged in?.
You can use the one included by default
and decorate booking with
@auth.requires_login()
.



On Mar 7, 7:09 pm, Ialejandro  wrote:
> Hi again! Playing again with my hotel booking sys I have a new
> doubt...
>
> I have this model:
>
> db.define_table('room',
>    Field('name','string),
>    Field('ubication','string'))
>
> db.define_table('booking',
>     Field('room',db.room),
>     Field('host','string'))
>
> So I have this controller:
>
> def index():
>      form = crud.create(db.booking, next = URL('validate'))
>     return dict(form=form)
>
> def validate():
>
>    return dict()
>
> def view():
>
> #here I have all the code to show the made bookings in powertable
>
>    return dict(table=table)
>
> And this is what I'd like to do:
>
> - A user gets into ~/index and can make a book of MULTIPLE rooms
> (currently with the above code I can only book one room at a time).
>
> - When a user clicks on the submit button, I need to sent an email to
> a room manager, so he can validate  the booking.  If it proceeds it
> will be saved and shown in powertable, if not, nothing is saved. How
> could I do it?? Do I need to catch the data before saving it?
>
> (I think I need something like this
> auth.settings.registration_requires_approval = True, in fact how could
> I do this???)
>
> Thanks!!!
>
> (sorry if there are too many questions)


[web2py] auth_event, unknown userid

2011-03-08 Thread kawate
Hello all

I found an unknown user id in auth_event.
Does anybody has same experience?
system is running on GAE with janrain.



Re: [web2py] routes on GAE

2011-03-08 Thread Jonathan Lundell
On Mar 8, 2011, at 6:36 PM, Plumo wrote:
> thanks John, that makes sense.

I tested it on the stock welcome app, and it seems to work fine. I'll send 
Massimo a patch for the example app.yaml, since this is a fairly common 
requirement.



Re: [web2py] routes on GAE

2011-03-08 Thread Plumo
thanks John, that makes sense.
 


[web2py] Re: custom registration form problem

2011-03-08 Thread Plumo
awesome - previously I had to hack some custom HTML together to support this

[web2py] Re: Is web2py's controllers for storing strings

2011-03-08 Thread pbreit
What you are doing is fine for the most part. What you will probably see 
more often is something like this:

=== controller ==
def quotes():
quotes = ['this is quote 1', 'this is quote 2']
return dict(quotes=quotes)

=== view ===
{{for quote in quotes:}}
  {{=quote}}
{{pass}}


[web2py] Re: Is web2py's controllers for storing strings

2011-03-08 Thread DenesL

The function in the controller returns either the page content
directly as a string (no view is used) or a dictionary with the
key:value pairs to be used in the corresponding view.

Usually each function in a controller returns only a bunch of
variables, far from a gazillion.

> def index():
>return dict(quote1="this is quote1", quote2="this is quote2")
>
> # CANT DO THIS
> # def index():
> #return dict(quote1="this is quote1")
> #return dict(quote2="this is quote2")

In Python (and all languages I know) a function ends when it executes
a return statement, the second return is never executed, so all
variables to be returned must be inside the same return.






On Mar 8, 3:38 pm, Jamboo  wrote:
> Hello,
>
> Based off the web2py book in the start, I was getting the idea that
> the controller would store the strings versus writing them directly
> into the view.  From my understanding you can do that and have a mix
> in the view but what is the best practice for this?  This is what I
> have started with.  I am guessing its not normal/good idea to have 1
> dictionary with a gazillion strings?http://www.pastie.org/1648453
> Thanks!


[web2py] Sending Email with Amazon Simple Email Service

2011-03-08 Thread pbreit
I was able to get Amazon's Simple Email Service working relatively easily 
using the "Boto" library. I tried to write up a slice but couldn't figure 
out how to format it 
properly: http://web2pyslices.com/main/slices/take_slice/123

1. Sign up for Amazon Web Services: http://aws.amazon.com

2. Enable "Simple Email Service": http://aws.amazon.com/ses/

3. Install Boto in your Web2py "site-packages" folder: 
https://github.com/boto/boto

4. Obtain your Amazon AWS-KEY and AWS-SECRET-KEY: 
https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&action=access-key

5. Before you get "production" access to Amazon's mail servers, you have to 
pre-register every sender and recipient email address you want to use (up to 
100). This is OK for development and testing but of course would not work in 
production. To register an email address, execute the following code, 
replacing AWS-KEY and AWS-SECRET-KEY with your own keys and 
myem...@address.com with the email address you want to register:

from boto.ses.connection import SESConnection
def verify_email_address():
conn = SESConnection('', '')
m = conn.verify_email_address('myem...@address.com')

6. Now you are ready to send an email:

from boto.ses.connection import SESConnection

aws_key = ''
aws_secret_key = ''

def send_ses(params):
conn = SESConnection(aws_key, aws_secret_key)
return conn.send_email(source='myem...@address.com',
subject='Subject',
body='Body.',
to_addresses='recipi...@email.com',
cc_addresses=None,
bcc_addresses=None,
format='text',
reply_addresses=None,
return_path=None)


[web2py] Re: A question from a web2py newcomer

2011-03-08 Thread Tom
Oh,I made a stupid mistake,I defined my tables under controllers.Now
it's correct. Thanks.

On 3月8日, 下午8时41分, villas  wrote:
> Does everything seem ok using the admin interface?http://127.0.0.1:8000/admin
>
> Try editing and running the app from there.
> You should see your code correctly in db.py
> The app should either run or you get a ticket or something.
>
> Regards,
> David
>
> On Mar 8, 8:43 am, Tom  wrote:
>
>
>
>
>
>
>
> > Hi,I am a newcomer of web2py, I am learning it by following this guide
> > The Official (3rd Ed.)web2py Book(http://web2py.com/book/default/
> > chapter/03)
>
> > At the step of creating db, after I created db.py, In this 
> > pagehttp://127.0.0.1:8000/ImageBlog/appadmin/index, I couldn't see my
> > tables:image and comments
>
> > Please help me.


[web2py] Re: python tutorial video

2011-03-08 Thread mart
dah . dah . dadah..dadadah...!!! yes please!! A definite must,
agreed!!! :) Alright, now I know I should have IM'ed in sick (although
I work remotely from home, but still), cranked up the volume, and just
floated away... Now, I love my ipod touch again :)


On Mar 8, 5:10 pm, Stefaan Himpe  wrote:
>   My suggestion ->  Konstantin Scherbakov, maybe
>
> >> Liszt's transcriptions of Beethoven symphonies for the Piano
>
> His Lyapunov etudes are well worth listening to as well :)



[web2py] Re: 1.93.2 broken update_record!

2011-03-08 Thread Clayton
Please note that this bug silently causes corrupt data to be written
to the database! Please, please release an update pronto...

Clayton

On Mar 8, 2:41 pm, Vasile Ermicioi  wrote:
> I think web2py needs regression tests, at least for core functionality


Re: [web2py] How to catch values from CRUD.CREATE and validate?

2011-03-08 Thread Ismael Alejandro
Anybody??? Please??

On Mon, Mar 7, 2011 at 6:09 PM, Ialejandro  wrote:

> Hi again! Playing again with my hotel booking sys I have a new
> doubt...
>
> I have this model:
>
>
> db.define_table('room',
>   Field('name','string),
>   Field('ubication','string'))
>
> db.define_table('booking',
>Field('room',db.room),
>Field('host','string'))
>
> So I have this controller:
>
> def index():
> form = crud.create(db.booking, next = URL('validate'))
>return dict(form=form)
>
> def validate():
>
>   return dict()
>
> def view():
>
> #here I have all the code to show the made bookings in powertable
>
>   return dict(table=table)
>
>
> And this is what I'd like to do:
>
> - A user gets into ~/index and can make a book of MULTIPLE rooms
> (currently with the above code I can only book one room at a time).
>
> - When a user clicks on the submit button, I need to sent an email to
> a room manager, so he can validate  the booking.  If it proceeds it
> will be saved and shown in powertable, if not, nothing is saved. How
> could I do it?? Do I need to catch the data before saving it?
>
>
> (I think I need something like this
> auth.settings.registration_requires_approval = True, in fact how could
> I do this???)
>
>
> Thanks!!!
>
> (sorry if there are too many questions)


[web2py] Web2py license question

2011-03-08 Thread kverdecia
Hi,

Can I include the web2py template module in my desktop application
without affecting the license of my application?


[web2py] Re: Difference between IS_HTTP_URL and IS_URL?

2011-03-08 Thread Chris
Oh, great. That accounts for why only IS_URL is immediately
accessible. Thanks.



On Mar 6, 1:24 am, Jonathan Lundell  wrote:
> On Mar 5, 2011, at 10:09 PM, Chris wrote:
>
>
>
> > Is there a substantive difference between IS_HTTP_URL and IS_URL?
>
> IS_URL is a front end to IS_HTTP_URL or IS_GENERIC_URL, and also handles 
> unicode input.


[web2py] Re: Error messaging improvements

2011-03-08 Thread pbreit
I guess so. I pretty much never see anything listed under "Variable". The 
"Inspect Attributes" are always objects which I'm not sure what to do with. 
Occasionally the Function Argument List is helpful.

Now that I see "Context", that looks like what I'd like. This may be a false 
alarm. I think I'm just really used to seeing the data.


Re: [web2py] Re: redirection to /default/user/profile

2011-03-08 Thread Jonathan Lundell
On Mar 8, 2011, at 2:20 PM, Jonathan Lundell wrote:
> 
> On Mar 8, 2011, at 2:00 PM, DenesL wrote:
>> 
>> I mean curl --trace-ascii
>> 
>> On Mar 8, 4:37 pm, DenesL  wrote:
>>> On Mar 8, 1:06 pm, Jonathan Lundell  wrote:
>>> 
 Try making the requests with curl -I and see if there's a chain of 
 redirects that might offer a clue.
>>> 
>>> Maybe you meant curl -1 (minus one),
>>> using this option I get the default layout with the two forms, no
>>> redirection (?).
> 
> Just curl -I should show you any redirects. If curl is following the 
> redirects (I don't think it does by default) you can use --max-redirs 1.

For example, I have the stock welcome app deployed at GAE. Here's a sample curl 
request that results in a redirect:

~ $ curl -I http://jkl-web2py-welcome.appspot.com/welcome/default/user
HTTP/1.1 303 See Other
Set-Cookie: session_id_welcome="3002:826f594f-996f-4e22-9026-81b62e34ff57"; 
Path=/
Content-Type: text/html; charset=UTF-8
Location: /welcome/default/user/login
Date: Tue, 08 Mar 2011 22:22:38 GMT
Server: Google Frontend
Cache-Control: private, x-gzip-ok=""
Transfer-Encoding: chunked


Notice that curl doesn't follow the redirect; I think you have to use 
--location for that to happen.



Re: [web2py] Re: redirection to /default/user/profile

2011-03-08 Thread Jonathan Lundell
On Mar 8, 2011, at 2:00 PM, DenesL wrote:
> 
> I mean curl --trace-ascii
> 
> On Mar 8, 4:37 pm, DenesL  wrote:
>> On Mar 8, 1:06 pm, Jonathan Lundell  wrote:
>> 
>>> Try making the requests with curl -I and see if there's a chain of 
>>> redirects that might offer a clue.
>> 
>> Maybe you meant curl -1 (minus one),
>> using this option I get the default layout with the two forms, no
>> redirection (?).

Just curl -I should show you any redirects. If curl is following the redirects 
(I don't think it does by default) you can use --max-redirs 1.



[web2py] Re: Error messaging improvements

2011-03-08 Thread Anthony
On Tuesday, March 8, 2011 1:26:48 PM UTC-5, pbreit wrote: 
>
> I saw a post on web2py-developers about error messaging. I love the 
> ticketing system but one thing that always surprises me is that it never 
> seems to include any of the current variables or environmental info. Would 
> it make sense to add information like that or am I missing it? This is 
> especially maddening with the "KeyError" errors which it seems would be 
> simple to resolve if I could just see the variables.

 
Are you talking about something other than what's available clicking the 
"arguments" and "variables" buttons in the "Frames" section, or the 
"locals", "request", "session", and "response" buttons in the "Context" 
section of the ticket?


[web2py] Re: python tutorial video

2011-03-08 Thread Stefaan Himpe

 My suggestion ->  Konstantin Scherbakov, maybe

Liszt's transcriptions of Beethoven symphonies for the Piano




His Lyapunov etudes are well worth listening to as well :)





Re: [web2py] Re: redirection to /default/user/profile

2011-03-08 Thread Jonathan Lundell
On Mar 8, 2011, at 1:37 PM, DenesL wrote:
> 
> On Mar 8, 1:06 pm, Jonathan Lundell  wrote:
>> Try making the requests with curl -I and see if there's a chain of redirects 
>> that might offer a clue.
> 
> Maybe you meant curl -1 (minus one),
> using this option I get the default layout with the two forms, no
> redirection (?).

-I shows the headers. -1 is a TLS option.

After you get the two forms, fetch the logout URL and see if that gives you a 
redirect to user/profile. I took a look over the code and it wasn't at all 
obvious how that would happen. Normally, the only case where you go silently to 
user/profile is when a logged-in user goes to user/register, which makes sense.

[web2py] Re: redirection to /default/user/profile

2011-03-08 Thread DenesL
I mean curl --trace-ascii

On Mar 8, 4:37 pm, DenesL  wrote:
> On Mar 8, 1:06 pm, Jonathan Lundell  wrote:
>
> > Try making the requests with curl -I and see if there's a chain of 
> > redirects that might offer a clue.
>
> Maybe you meant curl -1 (minus one),
> using this option I get the default layout with the two forms, no
> redirection (?).


[web2py] Re: Oracle DB - Select into an existing table DAL problem.

2011-03-08 Thread pbreit
Most likely you are going to need to somehow retrieve the schema of the 
Oracle db and then hand-code your models to match. There are scripts that 
can help for MySQL and Postgres but I don't think that's going to work for 
you:
http://code.google.com/p/web2py/source/browse/#hg%2Fscripts

You also need to pay special attention to "id" fields:
http://web2py.com/book/default/chapter/06#Legacy-Databases-and-Keyed-Tables


[web2py] Re: redirection to /default/user/profile

2011-03-08 Thread DenesL


On Mar 8, 1:06 pm, Jonathan Lundell  wrote:
> Try making the requests with curl -I and see if there's a chain of redirects 
> that might offer a clue.

Maybe you meant curl -1 (minus one),
using this option I get the default layout with the two forms, no
redirection (?).


[web2py] Re: redirection to /default/user/profile

2011-03-08 Thread pbreit
OK, thanks.

I can't emphasize enough to try and use the basic functionality provided by 
Web2py. It's perfect for when you are just starting out a project. You can 
always customize it later. But it's really nice being able to focus on your 
app from the beginning.


[web2py] Re: custom registration form problem

2011-03-08 Thread pbreit
password_two doesn't seem to be working for me still.

My user() function is the default and this is in my user.html view but I 
still get "None" for the password_two widget. I am using Mac 
download Version 1.93.2 (2011-03-04 23:48:59).

{{=form.custom.begin}}
Email: {{=form.custom.widget.email}}
Password: {{=form.custom.widget.password}}
Repeat Password: {{=form.custom.widget.password_two}}
{{=form.custom.submit}}
{{=form.custom.end}}



Email: 
Password: 
Repeat Password: None





[web2py] Re: DAL tutorial video

2011-03-08 Thread pbreit
Nice. Would the text of the terminal session be available?

Re: [web2py] Re: DAL tutorial video

2011-03-08 Thread danto
I posted the video in tinyogg.com (html5)

http://tinyogg.com/watch/B4JmP/

2011/3/8 mikech 

> Great video, thanks!


[web2py] Re: DAL tutorial video

2011-03-08 Thread mikech
Great video, thanks!

Re: [web2py] Customizing Login

2011-03-08 Thread contatogilson...@gmail.com
I go testing. Thank you!
_
*Gilson Filho*
*Web Developer
http://gilsondev.com*



2011/3/8 Richard Vézina 

> Oops auth.sett... ;-)
>
> Richard
>
>
> On Tue, Mar 8, 2011 at 3:21 PM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>>
>> Those line don't get you what you want if you place them in your user 
>> function?
>>
>>
>>
>> crud.settings.formstyle = 'table3cols' or 'table2cols' or 'divs' or 'ul'
>>
>> crud.messages.submit_button = 'Submit'
>>
>>
>> Richard
>>
>> On Tue, Mar 8, 2011 at 3:03 PM, contatogilson...@gmail.com <
>> contatogilson...@gmail.com> wrote:
>>
>>> Change formstyle, fields e text button.
>>>
>>> _
>>> *Gilson Filho*
>>> *Web Developer
>>> http://gilsondev.com*
>>>
>>>
>>>
>>> 2011/3/8 Richard Vézina 
>>>
>>>  What do you want to customize?

 Appearance or the fields?

 Richard


 On Tue, Mar 8, 2011 at 1:37 PM, contatogilson...@gmail.com <
 contatogilson...@gmail.com> wrote:

> How customizing login form?
> _
> *Gilson Filho*
> *Web Developer
> http://gilsondev.com*
>
>

>>>
>>
>


Re: [web2py] Customizing Login

2011-03-08 Thread Richard Vézina
Oops auth.sett... ;-)

Richard

On Tue, Mar 8, 2011 at 3:21 PM, Richard Vézina
wrote:

> Those line don't get you what you want if you place them in your user 
> function?
>
>
> crud.settings.formstyle = 'table3cols' or 'table2cols' or 'divs' or 'ul'
>
> crud.messages.submit_button = 'Submit'
>
>
> Richard
>
> On Tue, Mar 8, 2011 at 3:03 PM, contatogilson...@gmail.com <
> contatogilson...@gmail.com> wrote:
>
>> Change formstyle, fields e text button.
>>
>> _
>> *Gilson Filho*
>> *Web Developer
>> http://gilsondev.com*
>>
>>
>>
>> 2011/3/8 Richard Vézina 
>>
>>  What do you want to customize?
>>>
>>> Appearance or the fields?
>>>
>>> Richard
>>>
>>>
>>> On Tue, Mar 8, 2011 at 1:37 PM, contatogilson...@gmail.com <
>>> contatogilson...@gmail.com> wrote:
>>>
 How customizing login form?
 _
 *Gilson Filho*
 *Web Developer
 http://gilsondev.com*


>>>
>>
>


[web2py] Is web2py's controllers for storing strings

2011-03-08 Thread Jamboo
Hello,

Based off the web2py book in the start, I was getting the idea that
the controller would store the strings versus writing them directly
into the view.  From my understanding you can do that and have a mix
in the view but what is the best practice for this?  This is what I
have started with.  I am guessing its not normal/good idea to have 1
dictionary with a gazillion strings? http://www.pastie.org/1648453
Thanks!


[web2py] Oracle DB - Select into an existing table DAL problem.

2011-03-08 Thread Pivert
Hi,

I'm giving a try to Web2Py, but I'm still unable to just get data out
of an existing table in Oracle.
As I only have a read-only account on this DB, I use a second
connection identifier called db2, and leave the db untouched.

- My first problem was a major typo in the documentation. For oracle
connector, the username and password are not separated by : but by /,
to the oracle connection string is : 
oracle://username/password@DBNameInTnsnamesFile'

- Then, when I try to list tables, I have nothing (print db2.tables).
So, I suppose I must first define them, even if they are already
defined/existing in my DB. But then, I only get error "DatabaseError:
ORA-01031: insufficient privileges", even if I use the parameter
migrate=False.

So, this code does not work :
db2.define_table('ExistingTableName', migrate=False)

How should I tell web2py about the existence of my existing Oracle
table ?? Which syntax ??

Of course, I can query it when I use the raw SQL : print
db2.executesql('..'), but I want to use the DAL.

Regards,


[web2py] Re: python tutorial video

2011-03-08 Thread DenesL


On Mar 8, 10:38 am, mart  wrote:
>
> Music: I agree with DenesL (i think the twins were still humming the
> tune this morning) My suggestion -> Konstantin Scherbakov, maybe
> Liszt's transcriptions of Beethoven symphonies for the Piano (He did
> all 9, does not miss a thing and are on all fronts, perfect.) - its
> the analogy: not well known, yet a master's opus! ;)

Excellent choices.


[web2py] Re: Customizing Login

2011-03-08 Thread villas
On Mar 8, 6:37 pm, "contatogilson...@gmail.com"
 wrote:
> How customizing login form?

Try this:
auth.settings.formstyle='divs'

Before:
form=auth()


[web2py] Re: maintaining references while importing records from multiple tables

2011-03-08 Thread Philip
problem solved - my error.  There was a second reference field that
had a broken reference in it.

On Mar 7, 5:43 pm, Philip  wrote:
> I am importing data into an existing web2py application.  The tables
> are connected - I'll pretend for the moment that they are the owners
> and dogs tables from the web2py book.  I used the shell and typed in
> the following commands (based on an example previously posted by
> Massimo):
>
> map = {}
> db.owners.import_from_csv_file(open('/owners.csv','r'),map)
> db.dogs.import_from_csv_file(open('/dogs.csv','r'),map)
>
> The owners appeared correctly in the table, but when I tried to view
> the dogs (through the admin database interface), I got an error that
> the references were broken.  I had manually ensured that all dogs in
> the dogs table had references to owners that were in the owners table
> (i.e. no broken references in the data I uploaded), so the failure
> occurred on the translation of ids on the upload.
>
> Any ideas what I am doing wrong?  Has anyone successfully used the
> this feature of the import_from_csv_file?
>
> Thanks in advance for any ideas.


Re: [web2py] Customizing Login

2011-03-08 Thread Richard Vézina
Those line don't get you what you want if you place them in your user function?


crud.settings.formstyle = 'table3cols' or 'table2cols' or 'divs' or 'ul'

crud.messages.submit_button = 'Submit'


Richard

On Tue, Mar 8, 2011 at 3:03 PM, contatogilson...@gmail.com <
contatogilson...@gmail.com> wrote:

> Change formstyle, fields e text button.
>
> _
> *Gilson Filho*
> *Web Developer
> http://gilsondev.com*
>
>
>
> 2011/3/8 Richard Vézina 
>
> What do you want to customize?
>>
>> Appearance or the fields?
>>
>> Richard
>>
>>
>> On Tue, Mar 8, 2011 at 1:37 PM, contatogilson...@gmail.com <
>> contatogilson...@gmail.com> wrote:
>>
>>> How customizing login form?
>>> _
>>> *Gilson Filho*
>>> *Web Developer
>>> http://gilsondev.com*
>>>
>>>
>>
>


Re: [web2py] Customizing Login

2011-03-08 Thread contatogilson...@gmail.com
Change formstyle, fields e text button.
_
*Gilson Filho*
*Web Developer
http://gilsondev.com*



2011/3/8 Richard Vézina 

> What do you want to customize?
>
> Appearance or the fields?
>
> Richard
>
>
> On Tue, Mar 8, 2011 at 1:37 PM, contatogilson...@gmail.com <
> contatogilson...@gmail.com> wrote:
>
>> How customizing login form?
>> _
>> *Gilson Filho*
>> *Web Developer
>> http://gilsondev.com*
>>
>>
>


Re: [web2py] Re: 1.93.2 broken update_record!

2011-03-08 Thread Vasile Ermicioi
I think web2py needs regression tests, at least for core functionality


[web2py] Re: some functionality to mix html and {{python expression}} is broken since 1.92.3, even back to 1.91.6

2011-03-08 Thread dlypka

I will try to reduce it to a small example. From the call stack it
looks like web2py is confused between python code and html.  It seems
to be executing the html thinking it is python.

On Mar 8, 12:57 pm, pbreit  wrote:
> We cannot confirm that it is broken unless we are able to re-produce which
> we are not. We would need a specific code example from you that does not
> work to have any chance of fixing something that is broken.


[web2py] Re: redirection to /default/user/profile

2011-03-08 Thread pk
ok now it works, i think this was the problem:

def user():
 loginform=auth.login()
 registerform=auth.register()
 return dict(loginform=loginform, registerform=registerform)

i changed it to just using return dict(form=auth())

thanks for your help!

On 8 Mrz., 19:06, Jonathan Lundell  wrote:
> On Mar 8, 2011, at 9:45 AM, DenesL wrote:
>
>
>
>
>
>
>
>
>
>
>
> > On Mar 8, 6:03 am, pk  wrote:
> >> hi massimo,
>
> >> the problem is if i click the link logout, i get redirected to the
> >> link: ...user/profile
> >> but this is wrong! i will redirected to the index page
>
> >> On 8 Mrz., 00:15, Massimo Di Pierro 
> >> wrote:
>
> >>> Hello pk,
>
> >>> I do not fully understand the problem. I understand the code but not
> >>> your workflow. Can you exaplain what you click on and what you expect
> >>> and what you get?
>
> >>> On Mar 7, 4:59 am, pk  wrote:
>
>  hi together,
>
>  i have a problem with a redirection. i will not redirected to this
>  link!
>  in my view i have this: logout
>
>  my main-controller:
>  @auth.requires_login()
>  def index():
>      return dict(message="main/index")
>
>  default-controller:
>  def index():
>      if auth.is_logged_in():
>          redirect(URL(r=request, c='main', f='index'))
>      return dict(message="index")
>
> > next action should be just:
>
> > def user():
> >  return dict(form=auth())
>
> > but I don't understand how your change causes it
> > to redirect to /default/user/profile
> > which it does indeed (tested).
>
> Try making the requests with curl -I and see if there's a chain of redirects 
> that might offer a clue.
>
>
>
>
>
>
>
>
>
>  def user():
>      loginform=auth.login()
>      registerform=auth.register()
>      return dict(loginform=loginform, registerform=registerform)
>
>  but always after clicking the link i get this redirection!
>  hope somebody of you can help me?!?
>
>  thanks peter


[web2py] Re: redirection to /default/user/profile

2011-03-08 Thread pk
here is my app: http://www.hs-augsburg.de/~pk/web2py/Kundenportal.zip
i have no idea what the problem is... :(
i hope somebody can help me badly...

On 8 Mrz., 19:06, Jonathan Lundell  wrote:
> On Mar 8, 2011, at 9:45 AM, DenesL wrote:
>
>
>
>
>
>
>
>
>
>
>
> > On Mar 8, 6:03 am, pk  wrote:
> >> hi massimo,
>
> >> the problem is if i click the link logout, i get redirected to the
> >> link: ...user/profile
> >> but this is wrong! i will redirected to the index page
>
> >> On 8 Mrz., 00:15, Massimo Di Pierro 
> >> wrote:
>
> >>> Hello pk,
>
> >>> I do not fully understand the problem. I understand the code but not
> >>> your workflow. Can you exaplain what you click on and what you expect
> >>> and what you get?
>
> >>> On Mar 7, 4:59 am, pk  wrote:
>
>  hi together,
>
>  i have a problem with a redirection. i will not redirected to this
>  link!
>  in my view i have this: logout
>
>  my main-controller:
>  @auth.requires_login()
>  def index():
>      return dict(message="main/index")
>
>  default-controller:
>  def index():
>      if auth.is_logged_in():
>          redirect(URL(r=request, c='main', f='index'))
>      return dict(message="index")
>
> > next action should be just:
>
> > def user():
> >  return dict(form=auth())
>
> > but I don't understand how your change causes it
> > to redirect to /default/user/profile
> > which it does indeed (tested).
>
> Try making the requests with curl -I and see if there's a chain of redirects 
> that might offer a clue.
>
>
>
>
>
>
>
>
>
>  def user():
>      loginform=auth.login()
>      registerform=auth.register()
>      return dict(loginform=loginform, registerform=registerform)
>
>  but always after clicking the link i get this redirection!
>  hope somebody of you can help me?!?
>
>  thanks peter


[web2py] Documentation for lazy virtual fields incorrect in some cases

2011-03-08 Thread Chris
The docs for lazy virtual fields (http://web2py.com/book/default/
chapter/06#Virtual-Fields) give incorrect results; the virtual field
is incorrectly mapped to the last row selected in certain cases.

Here's a sample:

class table_story_titleAsSlug(object):
def titleAsSlug(self):
def lazy(self=self):
return urls.convert_to_slug(self.story.title)
return lazy
db.story.virtualfields.append(table_story_titleAsSlug())

titleAsSlug() will always return the value for the last row selected
from stories. While this may not apply in all cases, I've found a fix:

class table_story_titleAsSlug(object):
def titleAsSlug(self):
def lazy(title=self.story.title):
return urls.convert_to_slug(title)
return lazy
db.story.virtualfields.append(table_story_titleAsSlug())

Notes: In the debugger, the second self always refers to one instance
of table_story_titleAsSlug, which explains why self.story.title gets
overwritten. Are virtual field objects like table_story_titleAsSlug
only instantiated once?


[web2py] Re: 1.93.2 broken update_record!

2011-03-08 Thread Massimo Di Pierro
fixed in trunk.

On Mar 8, 12:49 pm, Bernardo Botella Corbí  wrote:
> Ok,
>
> On line 4776 should appear the following:
>
> colset[k] = v
>
> kind regards,
> Bernardo
>
> 2011/3/8 Bernardo Botella Corbí 
>
>
>
>
>
>
>
> > Hi Clayton,
>
> > How did you fix it?
>
> > Thanks for your help,
> > Bernardo
>
> > 2011/3/7 Clayton 
>
> > Issue 210:      Typo in gluon.dal.update_record
>
> >> Patched it manually to get my app up and running.
>
> >> This breaks a lot of apps; how soon can a new release get out?
>
> >> Clayton
>
> >> On Mar 7, 4:11 pm, Clayton  wrote:
> >> > sess.update_record(lockedby=request.vars.client) used to set the field
> >> > "lockedby" in the database to the value of request.vars.client
>
> >> > As of 1.93.2, it sets the field "lockedby" to the value
> >> > "lockedby" (the string!). This is with sqlite.
>
> >> > Crashes my app. Was I using it wrong to begin with?
>
> >> > Clayton


[web2py] Re: DAL tutorial video

2011-03-08 Thread Massimo Di Pierro
In principle some more optimizations are possible under the hood in
DAL...

On Mar 8, 10:45 am, LightOfMooN  wrote:
> Thanks for this video.
> One question:
> lines 97 and 100:
> 'name' = 'name'?
>
> it's often need to get new info of updated record.
>
> For example, in controller:
> row = db(db.products.id==123).select().first()
> row.update_record(name='helloworld')
>
> so if I want to show new updated record with id==123 in the view, I
> need one more query
> row = db(db.products.id==123).select().first() again to get it updated
> (or I'm missing something?)
> It could be better if I can do smth like updated_row =
> row.update_record(name='helloworld'), but it's impossible.
> Thx
>
> On 8 ÍÁÒ, 06:02, Massimo Di Pierro  wrote:
>
>
>
>
>
>
>
> >http://vimeo.com/20760298


Re: [web2py] Customizing Login

2011-03-08 Thread Richard Vézina
What do you want to customize?

Appearance or the fields?

Richard

On Tue, Mar 8, 2011 at 1:37 PM, contatogilson...@gmail.com <
contatogilson...@gmail.com> wrote:

> How customizing login form?
> _
> *Gilson Filho*
> *Web Developer
> http://gilsondev.com*
>
>


Re: [web2py] Re: 1.93.2 broken update_record!

2011-03-08 Thread Bernardo Botella Corbí
Ok,

On line 4776 should appear the following:

colset[k] = v

kind regards,
Bernardo

2011/3/8 Bernardo Botella Corbí 

> Hi Clayton,
>
> How did you fix it?
>
> Thanks for your help,
> Bernardo
>
> 2011/3/7 Clayton 
>
> Issue 210:  Typo in gluon.dal.update_record
>>
>> Patched it manually to get my app up and running.
>>
>> This breaks a lot of apps; how soon can a new release get out?
>>
>> Clayton
>>
>> On Mar 7, 4:11 pm, Clayton  wrote:
>> > sess.update_record(lockedby=request.vars.client) used to set the field
>> > "lockedby" in the database to the value of request.vars.client
>> >
>> > As of 1.93.2, it sets the field "lockedby" to the value
>> > "lockedby" (the string!). This is with sqlite.
>> >
>> > Crashes my app. Was I using it wrong to begin with?
>> >
>> > Clayton
>>
>
>


[web2py] Customizing Login

2011-03-08 Thread contatogilson...@gmail.com
How customizing login form?
_
*Gilson Filho*
*Web Developer
http://gilsondev.com*


[web2py] Error messaging improvements

2011-03-08 Thread pbreit
I saw a post on web2py-developers about error messaging. I love the 
ticketing system but one thing that always surprises me is that it never 
seems to include any of the current variables or environmental info. Would 
it make sense to add information like that or am I missing it? This is 
especially maddening with the "KeyError" errors which it seems would be 
simple to resolve if I could just see the variables.

[web2py] Re: Recommendation for web application literature

2011-03-08 Thread pbreit
It's tough, I know what you mean. While there is a lot of reference 
material, there is less about how to apply it in practice. Or at least, that 
information is scattered about in a million different blog posts.

Some great, although not free, teaching material can be found at these 
sites:
http://peepcode.com/
http://thinkvitamin.com/
http://www.lynda.com/

A friend of mine just started this educational site. If enough people 
request Web2py, I have a hunch Massimo would be willing to lead a course:
http://codelesson.com/courses/view_list


Re: [web2py] Re: redirection to /default/user/profile

2011-03-08 Thread Jonathan Lundell
On Mar 8, 2011, at 9:45 AM, DenesL wrote:
> 
> 
> 
> On Mar 8, 6:03 am, pk  wrote:
>> hi massimo,
>> 
>> the problem is if i click the link logout, i get redirected to the
>> link: ...user/profile
>> but this is wrong! i will redirected to the index page
>> 
>> On 8 Mrz., 00:15, Massimo Di Pierro 
>> wrote:
>> 
>>> Hello pk,
>> 
>>> I do not fully understand the problem. I understand the code but not
>>> your workflow. Can you exaplain what you click on and what you expect
>>> and what you get?
>> 
>>> On Mar 7, 4:59 am, pk  wrote:
>> 
 hi together,
>> 
 i have a problem with a redirection. i will not redirected to this
 link!
 in my view i have this: logout
>> 
 my main-controller:
 @auth.requires_login()
 def index():
 return dict(message="main/index")
>> 
 default-controller:
 def index():
 if auth.is_logged_in():
 redirect(URL(r=request, c='main', f='index'))
 return dict(message="index")
> 
> next action should be just:
> 
> def user():
>  return dict(form=auth())
> 
> but I don't understand how your change causes it
> to redirect to /default/user/profile
> which it does indeed (tested).

Try making the requests with curl -I and see if there's a chain of redirects 
that might offer a clue.

> 
 def user():
 loginform=auth.login()
 registerform=auth.register()
 return dict(loginform=loginform, registerform=registerform)
>> 
 but always after clicking the link i get this redirection!
 hope somebody of you can help me?!?
>> 
 thanks peter
>> 
>> 




[web2py] Re: some functionality to mix html and {{python expression}} is broken since 1.92.3, even back to 1.91.6

2011-03-08 Thread pbreit
We cannot confirm that it is broken unless we are able to re-produce which 
we are not. We would need a specific code example from you that does not 
work to have any chance of fixing something that is broken.

[web2py] Re: redirection to /default/user/profile

2011-03-08 Thread pbreit
Did you change a setting?

http://web2py.com/book/default/chapter/08?search=logout_next


Re: [web2py] Re: 1.93.2 broken update_record!

2011-03-08 Thread Bernardo Botella Corbí
Hi Clayton,

How did you fix it?

Thanks for your help,
Bernardo

2011/3/7 Clayton 

> Issue 210:  Typo in gluon.dal.update_record
>
> Patched it manually to get my app up and running.
>
> This breaks a lot of apps; how soon can a new release get out?
>
> Clayton
>
> On Mar 7, 4:11 pm, Clayton  wrote:
> > sess.update_record(lockedby=request.vars.client) used to set the field
> > "lockedby" in the database to the value of request.vars.client
> >
> > As of 1.93.2, it sets the field "lockedby" to the value
> > "lockedby" (the string!). This is with sqlite.
> >
> > Crashes my app. Was I using it wrong to begin with?
> >
> > Clayton
>


[web2py] Re: redirection to /default/user/profile

2011-03-08 Thread DenesL


On Mar 8, 6:03 am, pk  wrote:
> hi massimo,
>
> the problem is if i click the link logout, i get redirected to the
> link: ...user/profile
> but this is wrong! i will redirected to the index page
>
> On 8 Mrz., 00:15, Massimo Di Pierro 
> wrote:
>
> > Hello pk,
>
> > I do not fully understand the problem. I understand the code but not
> > your workflow. Can you exaplain what you click on and what you expect
> > and what you get?
>
> > On Mar 7, 4:59 am, pk  wrote:
>
> > > hi together,
>
> > > i have a problem with a redirection. i will not redirected to this
> > > link!
> > > in my view i have this: logout
>
> > > my main-controller:
> > > @auth.requires_login()
> > > def index():
> > >     return dict(message="main/index")
>
> > > default-controller:
> > > def index():
> > >     if auth.is_logged_in():
> > >         redirect(URL(r=request, c='main', f='index'))
> > >     return dict(message="index")

next action should be just:

def user():
  return dict(form=auth())

but I don't understand how your change causes it
to redirect to /default/user/profile
which it does indeed (tested).

> > > def user():
> > >     loginform=auth.login()
> > >     registerform=auth.register()
> > >     return dict(loginform=loginform, registerform=registerform)
>
> > > but always after clicking the link i get this redirection!
> > > hope somebody of you can help me?!?
>
> > > thanks peter
>
>


Re: [web2py] Re: DAL new syntax RFC

2011-03-08 Thread Luis Díaz
add shortcuts and much more magic.
distance of the system of philosophy python

Python is clean, easy to read.
You can love the language and can devote
time reading, that is understandable, allowing you to learn more easily

web2py is easy, because it's python, not have to learn new and complicated
abbreviations.
Unlike other frameworks you have to learn a large list of commands and how
to do things.

my language is Spanish.
my English is technical.
I do not want to be learning new things as shortcuts that only apply in the
context ...


Díaz Luis
http://www.facebook.com/diazluis2007
TSU Analisis de Sistemas
Universidad de Carabobo
Facultad de 
Odontología





2011/3/8 contatogilson...@gmail.com 

> URL (f = 'default ', c = 'home')
>
> This is desnecessary. I'm not used. Buy like this:
>
> URL('default','home')
>
> This is clean.
> _
> *Gilson Filho*
> *Web Developer
> http://gilsondev.com*
>
>
>
> 2011/3/8 villas 
>
> Ideally there should just be one clear and convenient way of doing
>> something, otherwise we can confused.
>>
>> Everytime we introduce a synonym we raise numerous questions on the
>> list and add a paragraph to the book.  Ascribing a special meaning to
>> a period is totally against the clarity of the code.  I believe we
>> should avoid synonyms and short-cuts wherever possible.
>>
>> IMO if there is a clearer and more convenient way of doing something,
>> we should clearly deprecate the old way and introduce and promote the
>> new syntax. Maybe this will make us think carefully about introducing
>> changes.
>>
>> -D
>
>
>


[web2py] Re: some functionality to mix html and {{python expression}} is broken since 1.92.3, even back to 1.91.6

2011-03-08 Thread dlypka
sorry I dropped a bracket abbreviating for this posting. The live code
has correct syntax and I   did a workaround to make it run. Looks like
html.py is broken in this regard. The workaround is to replace outer
ul tag by ul html helper call.

On Mar 7, 7:18 pm, Brian M  wrote:
> Well you're missing a closing ) in this line - the A() is closed but the LI(
> is not:
> {{  myli = LI(A(myrow['strRegionNameRendered'], _href="#") }}
>
> Why not simplify your template down a bit - Having your LI's inside a DIV
> seems a bit odd.
>
> {{myUL = UL(_id="dhtmlgoodies_tree", _class="dhtmlgoodies_tree")}}
> {{for row in sortedfolderlist:}}
>     {{myrow = row[1]}}
>     {{myUL.append(A(myrow['strRegionNameRendered'], _href="#")) }}
> {{pass}}
> {{=myUL}}


[web2py] Re: DAL tutorial video

2011-03-08 Thread LightOfMooN
Thanks for this video.
One question:
lines 97 and 100:
'name' = 'name'?

it's often need to get new info of updated record.

For example, in controller:
row = db(db.products.id==123).select().first()
row.update_record(name='helloworld')

so if I want to show new updated record with id==123 in the view, I
need one more query
row = db(db.products.id==123).select().first() again to get it updated
(or I'm missing something?)
It could be better if I can do smth like updated_row =
row.update_record(name='helloworld'), but it's impossible.
Thx


On 8 мар, 06:02, Massimo Di Pierro  wrote:
> http://vimeo.com/20760298


Re: [web2py] routes on GAE

2011-03-08 Thread Jonathan Lundell
On Mar 7, 2011, at 11:33 PM, Plumo wrote:
> I have the following listing in routes:
> ('/robots.txt', '/cms/static/robots.txt')
> 
> This lets me access /robots.txt on my local computer, but returns "invalid 
> request" when I upload this to GAE. Are there meant to be any differences 
> when using routes on GAE?
> 
> I can access /cms/static/robots.txt on both local and GAE.

GAE serves static files directly, and I don't think they end up in the location 
that web2py expects. So the path that routes generates ends up being wrong. 
When you access /cms/static/robots.txt, GAE is fetching it for you.

You need to add something like this to your app.yaml:

- url: /favicon.ico
  static_files: applications/cms/static/favicon.ico
  upload: applications/cms/static/favicon.ico

- url: /robots.txt
  static_files: applications/cms/static/robots.txt
  upload: applications/cms/static/robots.txt



[web2py] Re: web2py and ispcp (or any other contol panel)

2011-03-08 Thread Haros
There isn't a python module for ispcp. It has fcgi though (if that
helps).


On 8 Μαρ, 01:17, Massimo Di Pierro  wrote:
> I have never used this. Is there a python module for ispcp?
>
> On Mar 7, 1:59 pm, Haros  wrote:
>
>
>
> > Hello,
>
> > I am trying to make web2py work with ispcp but I fail. Google doesn't
> > provide any tutorial or hint and I guess it's beyond my knowledge to
> > make it work without help...
>
> > So, is there anyone that made web2py work with ispcp? I could also
> > accept web2py with webmin but there is not much info for that too :P
>
> > I would be glad if anyone could help.
>
> > Thanks.


[web2py] Re: python tutorial video

2011-03-08 Thread mart
That is so cool! something like text-to-speech, but with purpose! If I
can guess, you take a script, comments get read and typed out
(displayed differently, different color maybe) while code gets
exec'ed? Or what ever you are using, its Ingenious! I was just
thinking "now that guy has to be the best typer ever!" or "how'd he
get Say to do that?" ;) Kind to have to wonder how great and so much
less painful it would be to do code reviews this way ;)

Then the next step, speech-to-text? Can almost see plugin_wiki getting
in the game! Something like Dictate or DNS, but versions that
understand and use Markmin & keywords and color codes (to mark the
difference between code & text, etc) ;)

like:

'RECORD' GREEN_USE_HEADER1 # My Title | BLUE_USE_TEXT blablablabla |
PINK_USE_CODE_PYTHON OPEN_CRAZY_QUOTE `` OPEN_WEB2PY_BRACKETS {{say
some code... CLOSE_WEB2PY_BRACKETS }} CLOSE_CRAZY_QUOTES `` |
GREEN_USE_HEADER2 ## another title | PURPLE_USE_WIDGET_SELECT, etc

I'd like to see those 2 products try to do something like that ;) LOL

Music: I agree with DenesL (i think the twins were still humming the
tune this morning) My suggestion -> Konstantin Scherbakov, maybe
Liszt's transcriptions of Beethoven symphonies for the Piano (He did
all 9, does not miss a thing and are on all fronts, perfect.) - its
the analogy: not well known, yet a master's opus! ;)

On Mar 8, 9:32 am, Massimo Di Pierro 
wrote:
> Something like that. Actually the typing speed is random.
>
> It is a tool I am working out, trying to automate my teaching job.
>
> It is inspired by this:http://code.google.com/p/playerpiano/
> but not related and does more stuff.
>
> Once I am done I will release it.
>
> Massimo
>
> On Mar 8, 6:33 am, Stefaan Himpe  wrote:
>
>
>
>
>
>
>
> > >http://vimeo.com/20743963
>
> > I'm a bit intrigued by how the screencasts are made.
> > Given that they show no typos and constant typing speed, I assume you
> > made (or found) a system that takes a text file as input and renders it
> > to a screencast automatically?


Re: [web2py] Re: DAL tutorial video

2011-03-08 Thread contatogilson...@gmail.com
Cool! Congratulations! Submited by Twitter :)
_
*Gilson Filho*
*Web Developer
http://gilsondev.com*



2011/3/8 mart 

> That' great thanks ! :)
>
> On Mar 8, 3:01 am, Massimo Di Pierro 
> wrote:
> > I will post that and more after the PyCon tutorial.
> > Tomorrow I am traveling and I am still catching up with work. :-(
> >
> > On Mar 7, 10:25 pm, mart  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Massimo, this is great! context is everything and nothing like audio
> > > to accompany the visual!
> >
> > > Thanks for that! :)
> >
> > > if possible, would you to see the output of those 200 and some lines
> > > to a text file or something? There were a few parts (well, maybe more
> > > than a few) in there that I really found interesting and that
> > > triggered an idea or 2 which I would love to look at closer but I can
> > > hardly see the code being printed to the screen... yeah, my eyes
> > > aren't very good. i would just like to blow up the font size to
> > > something familiar (like 24 + :( ) and read that while listening (if
> > > its ok to ask).
> >
> > > Anyways, really enjoyed it, thanks :)
> >
> > > On Mar 7, 8:02 pm, Massimo Di Pierro 
> > > wrote:
> >
> > > >http://vimeo.com/20760298
>


[web2py] Re: DAL tutorial video

2011-03-08 Thread mart
That' great thanks ! :)

On Mar 8, 3:01 am, Massimo Di Pierro 
wrote:
> I will post that and more after the PyCon tutorial.
> Tomorrow I am traveling and I am still catching up with work. :-(
>
> On Mar 7, 10:25 pm, mart  wrote:
>
>
>
>
>
>
>
> > Massimo, this is great! context is everything and nothing like audio
> > to accompany the visual!
>
> > Thanks for that! :)
>
> > if possible, would you to see the output of those 200 and some lines
> > to a text file or something? There were a few parts (well, maybe more
> > than a few) in there that I really found interesting and that
> > triggered an idea or 2 which I would love to look at closer but I can
> > hardly see the code being printed to the screen... yeah, my eyes
> > aren't very good. i would just like to blow up the font size to
> > something familiar (like 24 + :( ) and read that while listening (if
> > its ok to ask).
>
> > Anyways, really enjoyed it, thanks :)
>
> > On Mar 7, 8:02 pm, Massimo Di Pierro 
> > wrote:
>
> > >http://vimeo.com/20760298


Re: [web2py] Re: DAL new syntax RFC

2011-03-08 Thread contatogilson...@gmail.com
URL (f = 'default ', c = 'home')

This is desnecessary. I'm not used. Buy like this:

URL('default','home')

This is clean.
_
*Gilson Filho*
*Web Developer
http://gilsondev.com*



2011/3/8 villas 

> Ideally there should just be one clear and convenient way of doing
> something, otherwise we can confused.
>
> Everytime we introduce a synonym we raise numerous questions on the
> list and add a paragraph to the book.  Ascribing a special meaning to
> a period is totally against the clarity of the code.  I believe we
> should avoid synonyms and short-cuts wherever possible.
>
> IMO if there is a clearer and more convenient way of doing something,
> we should clearly deprecate the old way and introduce and promote the
> new syntax. Maybe this will make us think carefully about introducing
> changes.
>
> -D


[web2py] Re: python tutorial video

2011-03-08 Thread Massimo Di Pierro
Something like that. Actually the typing speed is random.

It is a tool I am working out, trying to automate my teaching job.

It is inspired by this:
http://code.google.com/p/playerpiano/
but not related and does more stuff.

Once I am done I will release it.

Massimo


On Mar 8, 6:33 am, Stefaan Himpe  wrote:
> >http://vimeo.com/20743963
>
> I'm a bit intrigued by how the screencasts are made.
> Given that they show no typos and constant typing speed, I assume you
> made (or found) a system that takes a text file as input and renders it
> to a screencast automatically?


[web2py] Re: python tutorial video

2011-03-08 Thread DenesL

Sorry for the nit picking on a good overview of Python showing
important concepts, but I caught a few typos:

Line 156 (around 13:30)
  Python programmers prefer using 'self' instead of 'self'
should obviously be
  Python programmers prefer using 'self' instead of 'this'

around 18:00
190> print D(sin,x)
x is never initialized to the value of 1 mentioned in the comments
  print D(sin,1)

194> print D(lambda y: f(7,y),1)
should be
  print D(lambda y: g(7,y),1)
g being the function previously defined.

and at the very end:
233> # you can redistrubute this video freely
233> # you can redistribute this video freely

Note: I did not check the statistical functions defined around 23:00.

And, Massimo please don't use that short looped background music.


[web2py] Recommendation for web application literature

2011-03-08 Thread StUStD
What's a good, comprehensive and web2py-like literature source to
learn about web application development from the top down. I've
developed a python application, built the databases and rudimentary
web interface but I feel I'm constantly working too much from the
bottom up. E.g. session management is important, yet as a
mathematician I lack the knowledge to see things in an integrated way.
I study the web2py manual intensively, understand more and more of
it's underlying technology but feel I'm lacking the comprehensive
view. Anyone some suggestions? Thanks!


[web2py] Ubuntu 10.10 install fix

2011-03-08 Thread Brian Will
After running http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
on ubuntu 10.10 and setting up a postgres db for an app, I was getting
"global name 'psycopg2' is not defined". Fixed it with:

apt-get install python-psycopg2
sudo /etc/init.d/apache2 restart

For 10.10, the line

apt-get -y install python2.5-psycopg2

...should read:

apt-get -y install python-psycopg2


[web2py] Re: A question from a web2py newcomer

2011-03-08 Thread villas
Does everything seem ok using the admin interface?
http://127.0.0.1:8000/admin

Try editing and running the app from there.
You should see your code correctly in db.py
The app should either run or you get a ticket or something.

Regards,
David


On Mar 8, 8:43 am, Tom  wrote:
> Hi,I am a newcomer of web2py, I am learning it by following this guide
> The Official (3rd Ed.)web2py Book(http://web2py.com/book/default/
> chapter/03)
>
> At the step of creating db, after I created db.py, In this 
> pagehttp://127.0.0.1:8000/ImageBlog/appadmin/index, I couldn't see my
> tables:image and comments
>
> Please help me.


[web2py] Re: python tutorial video

2011-03-08 Thread Stefaan Himpe

http://vimeo.com/20743963


I'm a bit intrigued by how the screencasts are made.
Given that they show no typos and constant typing speed, I assume you
made (or found) a system that takes a text file as input and renders it 
to a screencast automatically?







[web2py] Re: DAL new syntax RFC

2011-03-08 Thread villas
Ideally there should just be one clear and convenient way of doing
something, otherwise we can confused.

Everytime we introduce a synonym we raise numerous questions on the
list and add a paragraph to the book.  Ascribing a special meaning to
a period is totally against the clarity of the code.  I believe we
should avoid synonyms and short-cuts wherever possible.

IMO if there is a clearer and more convenient way of doing something,
we should clearly deprecate the old way and introduce and promote the
new syntax. Maybe this will make us think carefully about introducing
changes.

-D


[web2py] Re: redirection to /default/user/profile

2011-03-08 Thread pk
hi massimo,

the problem is if i click the link logout, i get redirected to the
link: ...user/profile
but this is wrong! i will redirected to the index page

On 8 Mrz., 00:15, Massimo Di Pierro 
wrote:
> Hello pk,
>
> I do not fully understand the problem. I understand the code but not
> your workflow. Can you exaplain what you click on and what you expect
> and what you get?
>
> On Mar 7, 4:59 am, pk  wrote:
>
>
>
>
>
>
>
> > hi together,
>
> > i have a problem with a redirection. i will not redirected to this
> > link!
> > in my view i have this: logout
>
> > my main-controller:
> > @auth.requires_login()
> > def index():
> >     return dict(message="main/index")
>
> > default-controller:
> > def index():
> >     if auth.is_logged_in():
> >         redirect(URL(r=request, c='main', f='index'))
> >     return dict(message="index")
>
> > def user():
> >     loginform=auth.login()
> >     registerform=auth.register()
> >     return dict(loginform=loginform, registerform=registerform)
>
> > but always after clicking the link i get this redirection!
> > hope somebody of you can help me?!?
>
> > thanks peter


[web2py] advanced form question

2011-03-08 Thread Manuele Pesenti

Dear all,
I need to construct a form with some fields that has to be choosen 
within a different set depending on another fields value... is there 
some examples on line to get inspiration from?


I try to be a little more clear...

if I have a field like that:

Field('a', 'integer', requires=IS_IN_SET([1, 2, 3]))

and a second field 'b' that has to choosen in different sets, for 
examples ['a', 'b'], ['c', 'd'], ['e', 'f', 'g'], depending on the 
choosen value of the field 'a'


any idea?

Thank you

Manuele


[web2py] A question from a web2py newcomer

2011-03-08 Thread Tom
Hi,I am a newcomer of web2py, I am learning it by following this guide
The Official (3rd Ed.)web2py Book(http://web2py.com/book/default/
chapter/03)

At the step of creating db, after I created db.py, In this page
http://127.0.0.1:8000/ImageBlog/appadmin/index, I couldn't see my
tables:image and comments

Please help me.


[web2py] Re: DAL tutorial video

2011-03-08 Thread Massimo Di Pierro
I will post that and more after the PyCon tutorial.
Tomorrow I am traveling and I am still catching up with work. :-(

On Mar 7, 10:25 pm, mart  wrote:
> Massimo, this is great! context is everything and nothing like audio
> to accompany the visual!
>
> Thanks for that! :)
>
> if possible, would you to see the output of those 200 and some lines
> to a text file or something? There were a few parts (well, maybe more
> than a few) in there that I really found interesting and that
> triggered an idea or 2 which I would love to look at closer but I can
> hardly see the code being printed to the screen... yeah, my eyes
> aren't very good. i would just like to blow up the font size to
> something familiar (like 24 + :( ) and read that while listening (if
> its ok to ask).
>
> Anyways, really enjoyed it, thanks :)
>
> On Mar 7, 8:02 pm, Massimo Di Pierro 
> wrote:
>
>
>
>
>
>
>
> >http://vimeo.com/20760298