[web2py:20231] Re: Referring url

2009-04-22 Thread TeamBlack

Yea I understand the point you're making. After testing it out for a
few hours I saw that in some cases the value for http_referer was
"None". I wondered if it was a quirk of some browsers. When I was
testing it I was using firefox. What's the alternative to using
http_referer, if there is one?

On Apr 21, 3:53 pm, mdipierro  wrote:
> Mind that in using http_referrer you are trusting that the browser is
> putting it there.
>
> On 21 Apr, 09:27, TeamBlack  wrote:
>
> > Ah, yes, I understand now. It wasn't clear to me at first from looking
> > at the example. I've got it working now, thank you for your help
> > Yarko.
>
> > TeamBlack
>
> > On Apr 20, 11:31 pm, Yarko Tymciurak  wrote:
>
> > > sorry - I was "too swift" in typing (but you can see it in the link):
>
> > > You want request.env.http_referrer
>
> > > On Mon, Apr 20, 2009 at 2:46 PM, TeamBlack 
> > > wrote:
>
> > > > HI Again,
>
> > > > OK, I found request.http_referer, but I don't think understand how to
> > > > use it. I thought I could use it in a similar way to request.client,
> > > > but I did a simple test to output whatever data is in
> > > > request.http_referer, but I got nothing back.
>
> > > > Could you possibly give me a basic example of how I would use it?
>
> > > > Thanks
>
> > > > On Apr 20, 8:04 pm, TeamBlack  wrote:
> > > > > Thanks Yarko,
>
> > > > > I'll take a look. Appreciate the swift response :o)
>
> > > > > On Apr 20, 7:39 pm, Yarko Tymciurak  wrote:
>
> > > > > > On Mon, Apr 20, 2009 at 1:09 PM, TeamBlack 
> > > > > >  > > > >wrote:
>
> > > > > > > Hi,
>
> > > > > > > I did search but didn't find what I was looking for. Using web2py
> > > > > > > 1.56, is it possible to find out thereferringurlwhen someone
> > > > visits
> > > > > > > your web2py site? Just to put it in plain terms, an example would 
> > > > > > > be
> > > > > > > if someone visited my site by clicking on a link on some myspace,
> > > > > > > would I be able to  "grab" thaturl(e.g. "http://www.myspace.com/
> > > > > > > somemyspaceuserspage") so that it can be stored and viewed later? 
> > > > > > > The
> > > > > > > purpose of this would simply be for some basic reporting and 
> > > > > > > stats. I
> > > > > > > know there are pieces of software one can obtain, but I'm 
> > > > > > > interested
> > > > > > > to know if it can be done without having to introduce foreign code
> > > > > > > into my apps.
>
> > > > > > > Any help would be greatly appreciated.
>
> > > > > > Have a look athttp://
> > > >www.web2py.com/examples/default/examplessepcificallyhttp://www...
>
> > > > > > you'll see request.http_referer
>
> > > > > > > Thanks!
>
> > > > > > > TeamBlack
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20232] New Ubuntu Release

2009-04-22 Thread Yarko Tymciurak
FYI - Ubuntu 9.04rc  is distributed w/ Python 2.6.2

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



[web2py:20233] Re: default values for request.vars

2009-04-22 Thread desfrenes

ok! Being influenced by other frameworks I was expecting something
like this:

myvalue = request.vars.offset.defaults('some default value')

where defaults() would either return the actual value or the default
value (as seen in ZF: $myvalue = $request->getParam('offset', 'some
default value');).

But I understand the gain is not worth the pain since the python "if"
statement is explicit and already pretty short.

On Apr 21, 10:58 pm, mdipierro  wrote:
> This is elegant.
>
> On 21 Apr, 14:57, desfrenes  wrote:
>
> > Hi !
>
> > I was looking for a way to set default values to request.vars. I use
> > this:
>
> > if request.vars.offset == None: request.vars.offset = 0
>
> > But maybe there is a more elegant solution ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20234] Re: Issues about cron

2009-04-22 Thread Iceberg

On Apr17, 3:44am, AchipA  wrote:
> Linux definitely works, all crom modes, I have it in production in all
> three modes. Had no Mac reports so don't know about those.

Achipa, to upset you again, today I deploy my app on Linux for my
first time, and find that similar problem on my Windows XP still
happening on Linux too. :-/  Again, since I have kind of workaround,
so that is fine for me, just posting here to let you know.

I am using:
  ubuntu server LTS 8.04 (Linux datacenter 2.6.24-19-generic #1 SMP
Wed Aug 20 22:56:21 UTC 2008 i686 GNU/Linux)
  python 2.5.2
  web2py_src.zip 1.61.3

I started a single web2py by:
  python web2py.py -i 0.0.0.0 -p 8081 -a1 -D0
but get no cron feature.

If I replace the cron.py 0.1.1 in web2py_src.zip by the cron.py 0.1.0
from web2py 1.56.4, ok, the hardcron works.

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



[web2py:20235] Re: site wide-plugins

2009-04-22 Thread Timmie

OKI, this applys to controller and maybe model code.

But where and how to locate view documents to make them available
either in widget form or full pages to all applications?

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



[web2py:20236] Re: site wide-plugins

2009-04-22 Thread Iceberg

On Apr22, 4:18pm, Timmie  wrote:
> OKI, this applys to controller and maybe model code.
>
> But where and how to locate view documents to make them available
> either in widget form or full pages to all applications?
>

I did this before. Maybe it can help you too.

There are some "resources" need to be shared among many of my apps.
These resources include public documents (*.html, *.pdf, *.swf, *.js,
even modules/mylib.py etc). I wrapped them inside an dedicated app
named "share", so that in my other app I can refer to those resources
by "share". For example, in app foo I can do:

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



[web2py:20237] Re: Issues about cron

2009-04-22 Thread AchipA

Woo, now you got me blinking (I have over a dozen linux boxen running
various cron modes). Can you package me a sample app that demonstrated
this so we're literally looking at the same thing ? If you use
extcron, make sure to include your system crontab.

On Apr 22, 10:03 am, Iceberg  wrote:
> On Apr17, 3:44am, AchipA  wrote:
>
> > Linux definitely works, all crom modes, I have it in production in all
> > three modes. Had no Mac reports so don't know about those.
>
> Achipa, to upset you again, today I deploy my app on Linux for my
> first time, and find that similar problem on my Windows XP still
> happening on Linux too. :-/  Again, since I have kind of workaround,
> so that is fine for me, just posting here to let you know.
>
> I am using:
>   ubuntu server LTS 8.04 (Linux datacenter 2.6.24-19-generic #1 SMP
> Wed Aug 20 22:56:21 UTC 2008 i686 GNU/Linux)
>   python 2.5.2
>   web2py_src.zip 1.61.3
>
> I started a single web2py by:
>   python web2py.py -i 0.0.0.0 -p 8081 -a1 -D0
> but get no cron feature.
>
> If I replace the cron.py 0.1.1 in web2py_src.zip by the cron.py 0.1.0
> from web2py 1.56.4, ok, the hardcron works.
>
> //shrug
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20238] Re: Issues about cron

2009-04-22 Thread AchipA

I'll comission an appliance to make checks easier (as this is
something not easily doctestable). I can check windows and linux, I
need volunteers for Mac. You'd have to download the latest web2by, the
appliance and start a script I'll provide that goes through the cron
modes and reports any oddities.

On Apr 22, 10:03 am, Iceberg  wrote:
> On Apr17, 3:44am, AchipA  wrote:
>
> > Linux definitely works, all crom modes, I have it in production in all
> > three modes. Had no Mac reports so don't know about those.
>
> Achipa, to upset you again, today I deploy my app on Linux for my
> first time, and find that similar problem on my Windows XP still
> happening on Linux too. :-/  Again, since I have kind of workaround,
> so that is fine for me, just posting here to let you know.
>
> I am using:
>   ubuntu server LTS 8.04 (Linux datacenter 2.6.24-19-generic #1 SMP
> Wed Aug 20 22:56:21 UTC 2008 i686 GNU/Linux)
>   python 2.5.2
>   web2py_src.zip 1.61.3
>
> I started a single web2py by:
>   python web2py.py -i 0.0.0.0 -p 8081 -a1 -D0
> but get no cron feature.
>
> If I replace the cron.py 0.1.1 in web2py_src.zip by the cron.py 0.1.0
> from web2py 1.56.4, ok, the hardcron works.
>
> //shrug
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20239] ENUM field

2009-04-22 Thread Álvaro Justen [Turicas]

Is there a way to create ENUM() fields in database or I have to create
a string field and do some verification?

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

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



[web2py:20241] Re: ENUM field

2009-04-22 Thread Álvaro Justen [Turicas]

On Wed, Apr 22, 2009 at 9:20 AM, Michal Jursa  wrote:
> Just use:
>
> SQLField('field_name', requires = IS_IN_SET(['val1', 'val2'])

Ok, I'm doing this way, but my doubt is: how web2py will handle this?
Will it be a 'string' field with validation made by web2py or will it
be a ENUM() field (example, in MySQL)?

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

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



[web2py:20242] Re: ENUM field

2009-04-22 Thread Michal Jursa

Validation is done by web2py and database field is string as you've 
said. This is so due to database compatibility i think. Not every 
database supported by web2py provides ENUM type.

Michal

Álvaro Justen [Turicas] wrote:
> On Wed, Apr 22, 2009 at 9:20 AM, Michal Jursa  wrote:
>> Just use:
>>
>> SQLField('field_name', requires = IS_IN_SET(['val1', 'val2'])
> 
> Ok, I'm doing this way, but my doubt is: how web2py will handle this?
> Will it be a 'string' field with validation made by web2py or will it
> be a ENUM() field (example, in MySQL)?
> 

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



[web2py:20243] Re: site wide-plugins

2009-04-22 Thread Timmie

This is exactly what I am looking for!

How would you import / reuse the "modules/mylib.py"?

many thanks & regards,
Timmie

On 22 Apr., 10:49, Iceberg  wrote:
> On Apr22, 4:18pm, Timmie  wrote:
>
> > OKI, this applys to controller and maybe model code.
>
> > But where and how to locate view documents to make them available
> > either in widget form or full pages to all applications?
>
> I did this before. Maybe it can help you too.
>
> There are some "resources" need to be shared among many of my apps.
> These resources include public documents (*.html, *.pdf, *.swf, *.js,
> even modules/mylib.py etc). I wrapped them inside an dedicated app
> named "share", so that in my other app I can refer to those resources
> by "share". For example, in app foo I can do:
>
> index.html
>    type="text/javascript">
>   About Us
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20240] Re: ENUM field

2009-04-22 Thread Michal Jursa

Just use:

SQLField('field_name', requires = IS_IN_SET(['val1', 'val2'])

Michal

Álvaro Justen [Turicas] wrote:
> Is there a way to create ENUM() fields in database or I have to create
> a string field and do some verification?
> 

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



[web2py:20244] Re: site wide-plugins

2009-04-22 Thread Iceberg

Just as usual, in your whatever app's controllers/default.py, you can
do:

  import applications.share.modules.mylib

On Apr22, 8:27pm, Timmie  wrote:
> This is exactly what I am looking for!
>
> How would you import / reuse the "modules/mylib.py"?
>
> many thanks & regards,
> Timmie
>
> On 22 Apr., 10:49, Iceberg  wrote:
>
> > I did this before. Maybe it can help you too.
>
> > There are some "resources" need to be shared among many of my apps.
> > These resources include public documents (*.html, *.pdf, *.swf, *.js,
> > even modules/mylib.py etc). I wrapped them inside an dedicated app
> > named "share", so that in my other app I can refer to those resources
> > by "share". For example, in app foo I can do:
>
> > index.html
> >    > type="text/javascript">
> >   About Us


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



[web2py:20245] Re: Auth - disable registration

2009-04-22 Thread vihang

how can I decorate the register function in the tools.Auth from the
application?

Thanks

On Apr 21, 3:08 pm, AchipA  wrote:
> You can call the decorator directly, or just wrap it in an internal
> func.
>
> On Apr 21, 11:06 am, vihang  wrote:
>
> > Even better would be to be able to use decorators on it, like
> > @auth.requires_permission on register(). This may be asking too much,
> > but just wanted to see how much the auth module can be stretched
> > before one has to start tweaking the auth code...
>
> > On Apr 21, 12:58 pm, vihang  wrote:
>
> > > I had a look at the auth code, but could not find any flags to disable
> > > registration. Is there a way I can do it my have something like
> > > auth.settings.register flag in the model with other settings??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20246] Re: Form for adding db line does not work; input text instead of select

2009-04-22 Thread DenesL

Drop downs are only created for non-list requires, e.g.

 db.person.country.requires = [IS_IN_DB
(db,'country.id','country.name')]

should be

 db.person.country.requires = IS_IN_DB
(db,'country.id','country.name')

Denes.

On Apr 22, 1:57 am, dvid  wrote:
> Massimo,
>
> thank you for a blitz reply, the problem with insertion has been
> solved.  :)
>
> Please, have you any recommendation regarding the second thing - text
> input field instead of select box for foreign key?
>
> David
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20247] Re: Auth - disable registration

2009-04-22 Thread AchipA

Hm, off the top of my head, if I understand correctly what you're
asking:

def user():
  @decorator
  def myreg():
return dict(form=auth())

  if 'register' in request.args:
return myreg()

  return dict(fom=auth())


On Apr 22, 2:51 pm, vihang  wrote:
> how can I decorate the register function in the tools.Auth from the
> application?
>
> Thanks
>
> On Apr 21, 3:08 pm, AchipA  wrote:
>
> > You can call the decorator directly, or just wrap it in an internal
> > func.
>
> > On Apr 21, 11:06 am, vihang  wrote:
>
> > > Even better would be to be able to use decorators on it, like
> > > @auth.requires_permission on register(). This may be asking too much,
> > > but just wanted to see how much the auth module can be stretched
> > > before one has to start tweaking the auth code...
>
> > > On Apr 21, 12:58 pm, vihang  wrote:
>
> > > > I had a look at the auth code, but could not find any flags to disable
> > > > registration. Is there a way I can do it my have something like
> > > > auth.settings.register flag in the model with other settings??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20249] Re: Compliments

2009-04-22 Thread Fran

On Apr 21, 8:59 pm, Omar Munk  wrote:
> Windows isn't much used in the "Web-Framework-Scene":(

Several people develop using Web2Py on Windows - I'm 1 :)

F

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



[web2py:20250] SQLFORM

2009-04-22 Thread annet

I wonder whether it is possible in SQLFORM to mark the fields that are
required with an asterisk. Now the visitor finds out whether a field
is allowed to be empty after validation, which is a bit awkward.

Furthermore, I wonder whether it is possible to add a reset and a
cancel button to my forms, and if so, how do I code the buttons?


Best regards,

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



[web2py:20251] Re: Compliments

2009-04-22 Thread Pynthon Pynthon
I also use WIndows. What is btw T1 and T2 *shame*?

2009/4/22 Fran 

>
> On Apr 21, 8:59 pm, Omar Munk  wrote:
> > Windows isn't much used in the "Web-Framework-Scene":(
>
> Several people develop using Web2Py on Windows - I'm 1 :)
>
> F
>
> >
>

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



[web2py:20252] Re: SQLFORM

2009-04-22 Thread Pynthon

You mean somehting like a "*" for this is required? I've not tried
WebPy but maybe in your views?

On 22 apr, 16:05, annet  wrote:
> I wonder whether it is possible in SQLFORM to mark the fields that are
> required with an asterisk. Now the visitor finds out whether a field
> is allowed to be empty after validation, which is a bit awkward.
>
> Furthermore, I wonder whether it is possible to add a reset and a
> cancel button to my forms, and if so, how do I code the buttons?
>
> Best regards,
>
> Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20253] Re: default values for request.vars

2009-04-22 Thread mdipierro

you can do

myvalue=request.vars.get('offset','somedefaultvalue')

or, which I like better

myvalue=request.vars.offset or 'somedefaultvalue'





On 22 Apr, 02:32, desfrenes  wrote:
> ok! Being influenced by other frameworks I was expecting something
> like this:
>
> myvalue = request.vars.offset.defaults('some default value')
>
> where defaults() would either return the actual value or the default
> value (as seen in ZF: $myvalue = $request->getParam('offset', 'some
> default value');).
>
> But I understand the gain is not worth the pain since the python "if"
> statement is explicit and already pretty short.
>
> On Apr 21, 10:58 pm, mdipierro  wrote:
>
> > This is elegant.
>
> > On 21 Apr, 14:57, desfrenes  wrote:
>
> > > Hi !
>
> > > I was looking for a way to set default values to request.vars. I use
> > > this:
>
> > > if request.vars.offset == None: request.vars.offset = 0
>
> > > But maybe there is a more elegant solution ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20254] Re: ENUM field

2009-04-22 Thread mdipierro

You can make the field integer and then do

db.mytable.myfield.requires=IS_IN_SET(range(3),('dog','cat','mouse'))

This would be a enum.

Massimo

On 22 Apr, 07:27, Michal Jursa  wrote:
> Validation is done by web2py and database field is string as you've
> said. This is so due to database compatibility i think. Not every
> database supported by web2py provides ENUM type.
>
> Michal
>
> Álvaro Justen [Turicas] wrote:
> > On Wed, Apr 22, 2009 at 9:20 AM, Michal Jursa  wrote:
> >> Just use:
>
> >> SQLField('field_name', requires = IS_IN_SET(['val1', 'val2'])
>
> > Ok, I'm doing this way, but my doubt is: how web2py will handle this?
> > Will it be a 'string' field with validation made by web2py or will it
> > be a ENUM() field (example, in MySQL)?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20255] Re: site wide-plugins

2009-04-22 Thread mdipierro

Or for more portability

exec('import applications.%s.modules.mylib as mylib' %
request.application)

Massimo

On 22 Apr, 07:41, Iceberg  wrote:
> Just as usual, in your whatever app's controllers/default.py, you can
> do:
>
>   import applications.share.modules.mylib
>
> On Apr22, 8:27pm, Timmie  wrote:
>
> > This is exactly what I am looking for!
>
> > How would you import / reuse the "modules/mylib.py"?
>
> > many thanks & regards,
> > Timmie
>
> > On 22 Apr., 10:49, Iceberg  wrote:
>
> > > I did this before. Maybe it can help you too.
>
> > > There are some "resources" need to be shared among many of my apps.
> > > These resources include public documents (*.html, *.pdf, *.swf, *.js,
> > > even modules/mylib.py etc). I wrapped them inside an dedicated app
> > > named "share", so that in my other app I can refer to those resources
> > > by "share". For example, in app foo I can do:
>
> > > index.html
> > >    > > type="text/javascript">
> > >   About Us
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20256] Re: Form for adding db line does not work; input text instead of select

2009-04-22 Thread mdipierro

This still requires that you insert the id and not the name. If you
want a text field where you insert the "name" and that stores the id
into the field, assuming the name is unique you must define your own
validator for example

class IS_IN_TABLE_NAME:
def __init__(self,table,error_message="name not in country.name'):
 self.error_message=error_message
 self.table=table
def __call__(self,name):
 db=self.table._db
 rows=db(self.table.name==name).select(self.table.id)
 if not rows: return (name, self.error_message)
 return rows[0].id
def formatter(self,id):
 return self.table[id].name

db.mytable.myfield.requires=IS_IN_TABLE_NAME(db.country)

On 22 Apr, 08:12, DenesL  wrote:
> Drop downs are only created for non-list requires, e.g.
>
>  db.person.country.requires = [IS_IN_DB
> (db,'country.id','country.name')]
>
> should be
>
>  db.person.country.requires = IS_IN_DB
> (db,'country.id','country.name')
>
> Denes.
>
> On Apr 22, 1:57 am, dvid  wrote:
>
> > Massimo,
>
> > thank you for a blitz reply, the problem with insertion has been
> > solved.  :)
>
> > Please, have you any recommendation regarding the second thing - text
> > input field instead of select box for foreign key?
>
> > David
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20257] Re: SQLFORM

2009-04-22 Thread mdipierro

SQLFORM tables an argument called col3

col3 is a dictionary of comments. So you can do:

SQLFORM(...,col3=dict(field1='*',field4='*'))

Massimo


On 22 Apr, 09:17, Pynthon  wrote:
> You mean somehting like a "*" for this is required? I've not tried
> WebPy but maybe in your views?
>
> On 22 apr, 16:05, annet  wrote:
>
> > I wonder whether it is possible in SQLFORM to mark the fields that are
> > required with an asterisk. Now the visitor finds out whether a field
> > is allowed to be empty after validation, which is a bit awkward.
>
> > Furthermore, I wonder whether it is possible to add a reset and a
> > cancel button to my forms, and if so, how do I code the buttons?
>
> > Best regards,
>
> > Annet.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20258] Re: Compliments

2009-04-22 Thread mdipierro

T1 does not exist.

T2 is a deprecated web2py tier 2
http://www.web2py.com/examples/statis/plugin_t2.pdf

T3 is the evolution of T2 and still evolving... it includes T2.
http://web2py.appspot.com/t3

This will merge with this
http://www.web2py.com/events/default/index
+ KPAX + eStore

to make a kick ass development platform.

Sorry no timetable yet.

Massimo

On 22 Apr, 09:11, Pynthon Pynthon  wrote:
> I also use WIndows. What is btw T1 and T2 *shame*?
>
> 2009/4/22 Fran 
>
>
>
> > On Apr 21, 8:59 pm, Omar Munk  wrote:
> > > Windows isn't much used in the "Web-Framework-Scene":(
>
> > Several people develop using Web2Py on Windows - I'm 1 :)
>
> > F
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20259] Problems with web2py behind Proxy and mod_proxy_html

2009-04-22 Thread Bernd das Brot

Hi web2py fans !

I want to use web2py (current production version 1.61.1) behind an
apache proxy, alongside other applications.
Therefore I need a unique URL-Prefix to guide mod_proxy to the
(standalone) web2py-Server
(Application "cookbook": https://server:port/prefix/cookbook/...)

1) I followed the instructions in the FAQs using "mod_proxy_html" and
it kind-of-works:
it rewrites URLs like "" BUT
in Javascript it does not understand things like

jQuery(document).ready(function(){ setTimeout("keepalive('/admin/
default/keepalive')",1); });

   and therefore does not rewrite it. Result: no editor-Keepalive, but
(after 10 seconds) an red text
   "Communication Error".

  How can I fix this in mod_proxy_html (No, I do not want to hardcode
it into the framework) ?

2) Can somebody with deeper knowledge of web2py explain, why I need
mod_proxy_html anyway ?

IMHO the use of mod_proxy_html is a workaround for something a
decent framework should do.
"route.py" does "half" of it but "breaks your application" (!):
The "URL()" function does not use the variables from "route.py",
so the absolute URLs
(in page code and in javascript) are not proxy-aware (but could be
- I don't think that this is
too hard).

Thanks for any replies, Bernd

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



[web2py:20260] Re: ENUM field

2009-04-22 Thread Álvaro Justen [Turicas]

On Wed, Apr 22, 2009 at 11:19 AM, mdipierro  wrote:
>
> You can make the field integer and then do
>
> db.mytable.myfield.requires=IS_IN_SET(range(3),('dog','cat','mouse'))
>
> This would be a enum.

Ok, but with this I can't add this way:
db.mytable.insert(myfield='cat')

So, what I have to do?

I think:

myvalues = {'dog': 0, 'cat': 1, 'mouse': 2}
mylist = map(lambda x:x, myvalues)
db.mytable.myfield.requires = IS_IN_SET(range(mylist), mylist)

and

db.mytable.insert(myfield=myvalues['cat'])

But if this field is "ENUM", I think web2py have to handle this, not I
(with dicts and lists above).

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

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



[web2py:20261] Re: ENUM field

2009-04-22 Thread mdipierro

It is our philosophy that web2py DAL should not implement structures
that are supported by the backend database engine.

If you make the field an int, you need to store an int in it. Your map
makes this explicit and I think it is fine.

Massimo


On 22 Apr, 09:41, Álvaro Justen [Turicas] 
wrote:
> On Wed, Apr 22, 2009 at 11:19 AM, mdipierro  wrote:
>
> > You can make the field integer and then do
>
> > db.mytable.myfield.requires=IS_IN_SET(range(3),('dog','cat','mouse'))
>
> > This would be a enum.
>
> Ok, but with this I can't add this way:
> db.mytable.insert(myfield='cat')
>
> So, what I have to do?
>
> I think:
>
> myvalues = {'dog': 0, 'cat': 1, 'mouse': 2}
> mylist = map(lambda x:x, myvalues)
> db.mytable.myfield.requires = IS_IN_SET(range(mylist), mylist)
>
> and
>
> db.mytable.insert(myfield=myvalues['cat'])
>
> But if this field is "ENUM", I think web2py have to handle this, not I
> (with dicts and lists above).
>
> --
>  Álvaro Justen
>  Peta5 - Telecomunicações e Software Livre
>  21 3021-6001 / 9898-0141
>  http://www.peta5.com.br/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20262] Re: site wide-plugins

2009-04-22 Thread Iceberg

Thanks! This trick is what I am looking for, for a long time. :-)

On Apr22, 10:20pm, mdipierro  wrote:
> Or for more portability
>
> exec('import applications.%s.modules.mylib as mylib' %
> request.application)
>
> Massimo

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



[web2py:20263] Re: Compliments

2009-04-22 Thread Pynthon Pynthon
So also a web-framework :$?

2009/4/22 mdipierro 

>
> T1 does not exist.
>
> T2 is a deprecated web2py tier 2
> http://www.web2py.com/examples/statis/plugin_t2.pdf
>
> T3 is the evolution of T2 and still evolving... it includes T2.
> http://web2py.appspot.com/t3
>
> This will merge with this
> http://www.web2py.com/events/default/index
> + KPAX + eStore
>
> to make a kick ass development platform.
>
> Sorry no timetable yet.
>
> Massimo
>
> On 22 Apr, 09:11, Pynthon Pynthon  wrote:
> > I also use WIndows. What is btw T1 and T2 *shame*?
> >
> > 2009/4/22 Fran 
> >
> >
> >
> > > On Apr 21, 8:59 pm, Omar Munk  wrote:
> > > > Windows isn't much used in the "Web-Framework-Scene":(
> >
> > > Several people develop using Web2Py on Windows - I'm 1 :)
> >
> > > F
> >
>

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



[web2py:20264] Re: default values for request.vars

2009-04-22 Thread desfrenes

well, I didn't know about the "or" construction. Now that's
elegant ! :-)

Learning Python with web2py is a pleasure. Thank you.

On Apr 22, 4:18 pm, mdipierro  wrote:
> you can do
>
>     myvalue=request.vars.get('offset','somedefaultvalue')
>
> or, which I like better
>
>     myvalue=request.vars.offset or 'somedefaultvalue'
>
> On 22 Apr, 02:32, desfrenes  wrote:
>
> > ok! Being influenced by other frameworks I was expecting something
> > like this:
>
> > myvalue = request.vars.offset.defaults('some default value')
>
> > where defaults() would either return the actual value or the default
> > value (as seen in ZF: $myvalue = $request->getParam('offset', 'some
> > default value');).
>
> > But I understand the gain is not worth the pain since the python "if"
> > statement is explicit and already pretty short.
>
> > On Apr 21, 10:58 pm, mdipierro  wrote:
>
> > > This is elegant.
>
> > > On 21 Apr, 14:57, desfrenes  wrote:
>
> > > > Hi !
>
> > > > I was looking for a way to set default values to request.vars. I use
> > > > this:
>
> > > > if request.vars.offset == None: request.vars.offset = 0
>
> > > > But maybe there is a more elegant solution ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20265] Re: Compliments

2009-04-22 Thread JohnMc

I will give PHP one kudo -- They have wrapped themselves a fantastic
suite of prebuilt componentry. Just go over to phpclasses.org and take
a look. If you can't find a piece of code to use or morph then maybe
PHP can't do it.

Web2py has as a framework  the mechanism to do the same. Even has
working examples with items like KPAX and CAS. Need more. It would be
great to see code components for everyday problems faced in the
development environment.

On Apr 22, 9:51 am, Pynthon Pynthon  wrote:
> So also a web-framework :$?
>
> 2009/4/22 mdipierro 
>

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



[web2py:20266] Re: Issues about cron

2009-04-22 Thread AchipA

Could you try my web2py branch from 
https://code.launchpad.net/~achipa/web2py/cron
? This is 1.61.4 merged back to my cron branch.

On Apr 22, 3:36 pm, Iceberg  wrote:
> Achipa, I do not use extcron. In my usage, it should be a hardcron.
>
> In this mail I attach the crontest app. All the trick is in cron/*.*, and one 
> action in controllers/default.py.  This mail is copied to all, so that any 
> volunteer can have a test also. (Mind that you need to unzip it before using.)
>
> So far, there is no significant behaviour you can notice, but if cron does 
> work, you should be able to see this line appended into httpserver.log in 
> every minute:
>
>   127.0.0.1, 2009-04-22 21:31:01, GET, /crontest/default/trigger, HTTP/1.0, 
> 200, 0.008107
>
> Feel free to tell what more I can do for you.
>
> Best regards,
>                             Iceberg, 2009-Apr-22, 21:25(PM), Wed
>
> --- Original Message ---
> From:    AchipA 
> To:      web2py Web Framework 
> Date:    Wed, 22 Apr 2009 04:28:19 -0700 (PDT)
> Subject: Re: Issues about cron
>
> ---
>
> > Woo, now you got me blinking (I have over a dozen linux boxen running
> > various cron modes). Can you package me a sample app that demonstrated
> > this so we're literally looking at the same thing ? If you use
> > extcron, make sure to include your system crontab.
>
> > On Apr 22, 10:03am, Iceberg  wrote:
> > > On Apr17, 3:44am, AchipA  wrote:
>
> > > > Linux definitely works, all crom modes, I have it in production in all
> > > > three modes. Had no Mac reports so don't know about those.
>
> > > Achipa, to upset you again, today I deploy my app on Linux for my
> > > first time, and find that similar problem on my Windows XP still
> > > happening on Linux too. :-/  Again, since I have kind of workaround,
> > > so that is fine for me, just posting here to let you know.
>
> > > I am using:
> > >   ubuntu server LTS 8.04 (Linux datacenter 2.6.24-19-generic #1 SMP
> > > Wed Aug 20 22:56:21 UTC 2008 i686 GNU/Linux)
> > >   python 2.5.2
> > >   web2py_src.zip 1.61.3
>
> > > I started a single web2py by:
> > >   python web2py.py -i 0.0.0.0 -p 8081 -a1 -D0
> > > but get no cron feature.
>
> > > If I replace the cron.py 0.1.1 in web2py_src.zip by the cron.py 0.1.0
> > > from web2py 1.56.4, ok, the hardcron works.
>
>
>
>  web2py.app.crontest.zip
> 75KViewDownload
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20267] Re: SQLFORM

2009-04-22 Thread DenesL



On Apr 22, 10:05 am, annet  wrote:
> I wonder whether it is possible in SQLFORM to mark the fields that are
> required with an asterisk. Now the visitor finds out whether a field
> is allowed to be empty after validation, which is a bit awkward.

You can use CSS to highlight the field or the label too.
>
> Furthermore, I wonder whether it is possible to add a reset and a
> cancel button to my forms, and if so, how do I code the buttons?

Strictly speaking only reset is valid HTML.
But you can create any button you want.
How? it depends on what do you want to do with it.
In your case, what is "Cancel" going to do?.

To add a reset button:
form[0].append(TR(TD(),TD(INPUT(_type="reset",_value="Reset form")))

form[0] is the table that defines the layout in the standard SQLFORM.

>
> Best regards,
>
> Annet.

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



[web2py:20268] total of two time fields

2009-04-22 Thread Wes James

I have a db with two time fields - start_time, end_time.

With db.table.represent = lambda row: TABLE(.)

it will ouput the rows in a table.

What I need to do is in the last column show end_time - start_time

I'm trying to do this with represent, but I don't see a way.  Is there
a way other than in a standard iteration

for row in table:
   TR(field1, field2, , end_time-start_time)


In actuality I'll need to do et=datetime(date and time stuff),
st=datetime(date and time stuff) and then

 res=(st-dt).seconds
 hours=res/60/60
minutes =res/60-hours*60

unless anyone knows some better time math ways to do this.

thx,

-wj

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



[web2py:20269] Re: Compliments

2009-04-22 Thread Pynthon Pynthon
I did not try W2P yet but I want to make something like this:

Content system with categories (add pages and categories etc.)
News system with categories (add news and categories etc.)
Menu Manager
Poll system

That can be done easily done with W2P right? In PHP this takes weeks!

2009/4/22 JohnMc 

>
> I will give PHP one kudo -- They have wrapped themselves a fantastic
> suite of prebuilt componentry. Just go over to phpclasses.org and take
> a look. If you can't find a piece of code to use or morph then maybe
> PHP can't do it.
>
> Web2py has as a framework  the mechanism to do the same. Even has
> working examples with items like KPAX and CAS. Need more. It would be
> great to see code components for everyday problems faced in the
> development environment.
>
> On Apr 22, 9:51 am, Pynthon Pynthon  wrote:
> > So also a web-framework :$?
> >
> > 2009/4/22 mdipierro 
> >
>
> >
>

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



[web2py:20270] Script using DAL: references don't work

2009-04-22 Thread Álvaro Justen [Turicas]

Hello,
I'm creating a script to do some database verifications. This is
called script.py and is in web2py root directory.
To script.py works find I have to modify
applications/myapp/models/db.py, adding in start:

if __name__ != '__builtin__':
from gluon.sql import *
from gluon.validators import *

In script.py I have:

from applications.myapp.models.db import *

print 'All values in table X:'
print db().select(db.X.ALL)

It works fine when I have simple tables but when I have a table X that
has a reference field to table Y, this script fails:

alv...@jurujuba:~/Desktop/web2py$ ./script.py
Traceback (most recent call last):
  File "./script.py", line 4, in 
from applications.myapp.models.db import *
  File "/home/alvaro/Desktop/web2py/applications/myapp/models/db.py",
line 19, in 
SQLField('y_field', db.Y)
  File "/home/alvaro/Desktop/web2py/gluon/sql.py", line 938, in define_table
raise e
sqlite3.OperationalError: no such table: X

Am I missing to import anything?

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

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



[web2py:20271] Re: total of two time fields

2009-04-22 Thread mdipierro

You can try to do

rows = db(...).select(,db.table.end_time-
db.table.start_time,)

and the result should be in

rows[0]._extra[db.table.end_time-db.table.start_time]

but I would not trust it because it becomes dependent on the database
backend.

I suggest you use the standard iteration instead.

Massimo

On Apr 22, 10:32 am, Wes James  wrote:
> I have a db with two time fields - start_time, end_time.
>
> With db.table.represent = lambda row: TABLE(.)
>
> it will ouput the rows in a table.
>
> What I need to do is in the last column show end_time - start_time
>
> I'm trying to do this with represent, but I don't see a way.  Is there
> a way other than in a standard iteration
>
> for row in table:
>TR(field1, field2, , end_time-start_time)
>
> In actuality I'll need to do et=datetime(date and time stuff),
> st=datetime(date and time stuff) and then
>
>  res=(st-dt).seconds
>  hours=res/60/60
> minutes =res/60-hours*60
>
> unless anyone knows some better time math ways to do this.
>
> thx,
>
> -wj
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20272] Re: Script using DAL: references don't work

2009-04-22 Thread mdipierro

web2py already has a mechanism for running scripts that see models.

Did you look into

python web2py.py -S yourapp -M -R script.py

Try

python web2py.py -h

Massimo

On Apr 22, 10:49 am, Álvaro Justen [Turicas] 
wrote:
> Hello,
> I'm creating a script to do some database verifications. This is
> called script.py and is in web2py root directory.
> To script.py works find I have to modify
> applications/myapp/models/db.py, adding in start:
>
> if __name__ != '__builtin__':
> from gluon.sql import *
> from gluon.validators import *
>
> In script.py I have:
>
> from applications.myapp.models.db import *
>
> print 'All values in table X:'
> print db().select(db.X.ALL)
>
> It works fine when I have simple tables but when I have a table X that
> has a reference field to table Y, this script fails:
>
> alv...@jurujuba:~/Desktop/web2py$ ./script.py
> Traceback (most recent call last):
>   File "./script.py", line 4, in 
> from applications.myapp.models.db import *
>   File "/home/alvaro/Desktop/web2py/applications/myapp/models/db.py",
> line 19, in 
> SQLField('y_field', db.Y)
>   File "/home/alvaro/Desktop/web2py/gluon/sql.py", line 938, in define_table
> raise e
> sqlite3.OperationalError: no such table: X
>
> Am I missing to import anything?
>
> --
>  Álvaro Justen
>  Peta5 - Telecomunicações e Software Livre
>  21 3021-6001 / 9898-0141
>  http://www.peta5.com.br/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20273] Re: Problems with web2py behind Proxy and mod_proxy_html

2009-04-22 Thread mdipierro

I am not sure I understand so I apologize if the answer is incomplete.

I do not know what mdp_proxy_html does vs mod_proxy.

mod_proxy is required if you want to have another database server run
as a proxy, but its job is not to rewrite URL, although you can do
that.

You can also have web2py rewrite URL using routes.py (an example in
routes.example.py).

routes supports both url mapping (routes_in) and reverse url mapping
(routes_out) and if they match there is no problem. routes.py does not
parse the generated for urls. So you should not do this:

  jQuery(document).ready(function(){ setTimeout("keepalive('/yourapp/
default/action')",1); });

You should do this instead

  jQuery(document).ready(function(){ setTimeout("keepalive('{{=URL
('yourapp','default','action')}})'",1); });

Anyway I have a feeling you know about this more than I do. If you can
propose any impeovement to the current mechanism, please let us know.

Massimo

On Apr 22, 5:41 am, Bernd das Brot  wrote:
> Hi web2py fans !
>
> I want to use web2py (current production version 1.61.1) behind an
> apache proxy, alongside other applications.
> Therefore I need a unique URL-Prefix to guide mod_proxy to the
> (standalone) web2py-Server
> (Application "cookbook":https://server:port/prefix/cookbook/...)
>
> 1) I followed the instructions in the FAQs using "mod_proxy_html" and
> it kind-of-works:
> it rewrites URLs like "" BUT
> in Javascript it does not understand things like
>
> jQuery(document).ready(function(){ setTimeout("keepalive('/admin/
> default/keepalive')",1); });
>
>and therefore does not rewrite it. Result: no editor-Keepalive, but
> (after 10 seconds) an red text
>"Communication Error".
>
>   How can I fix this in mod_proxy_html (No, I do not want to hardcode
> it into the framework) ?
>
> 2) Can somebody with deeper knowledge of web2py explain, why I need
> mod_proxy_html anyway ?
>
> IMHO the use of mod_proxy_html is a workaround for something a
> decent framework should do.
> "route.py" does "half" of it but "breaks your application" (!):
> The "URL()" function does not use the variables from "route.py",
> so the absolute URLs
> (in page code and in javascript) are not proxy-aware (but could be
> - I don't think that this is
> too hard).
>
> Thanks for any replies, Bernd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20274] Scalability

2009-04-22 Thread Pynthon

Hello

Ruby on Rails is sometimes hard to scale I heard. How is this with
W2P?

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



[web2py:20275] Re: Scalability

2009-04-22 Thread mdipierro

If you store everything in the database the only bottleneck is the
database. The web2py DAL does not add a significative overhead. You
can have as many servers you need under a load balancer. Those web
server can work independently (other than for the database) thus
providing scalability.


You cannot separate the issue of scalability from the issue of speed.

- web2py is much faster than rails. If you try them both you will feel
the difference.
- web2py supports connection pools
- You can improve web2py speed by storing uploaded files in a upload
folder (the default) and make it a shared folder. This will reduce
database load but does not necessarily reduce network load.
- You can improve speed by not using sessions.
- You can improve speed by caching page in ram or memcache.

I am sure other uses will have experiences to share.

Massimo



On Apr 22, 11:43 am, Pynthon  wrote:
> Hello
>
> Ruby on Rails is sometimes hard to scale I heard. How is this with
> W2P?
>
> Thanks
> Pynthon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20276] Using external libraries?

2009-04-22 Thread Michael

Hey guys,

   I've been messing around with the twitter library for python from
the command line. Is it possible to use this in web2py? It has a JSON
library dependency.

  Also, if i have it in web2py how do i 'install' it? from the command
line, i know to just do;

  python setup.py install

  But how do i go about installing libraries into web2py so I can
access them the same way:

  import twitter

  def tweet():

  client = twitter.Api(username='test', password='test')
  update = client.PostUpdate('hello from python!')


etc...

thanks!

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



[web2py:20278] Re: Compliments

2009-04-22 Thread Yarko Tymciurak
We built a news system in 2 hours in PyCon, at a web2py code dojo.
I'll try to find the link to the slides.

On Wed, Apr 22, 2009 at 10:47 AM, Pynthon Pynthon wrote:

> I did not try W2P yet but I want to make something like this:
>
> Content system with categories (add pages and categories etc.)
> News system with categories (add news and categories etc.)
> Menu Manager
> Poll system
>
> That can be done easily done with W2P right? In PHP this takes weeks!
>
> 2009/4/22 JohnMc 
>
>
>> I will give PHP one kudo -- They have wrapped themselves a fantastic
>> suite of prebuilt componentry. Just go over to phpclasses.org and take
>> a look. If you can't find a piece of code to use or morph then maybe
>> PHP can't do it.
>>
>> Web2py has as a framework  the mechanism to do the same. Even has
>> working examples with items like KPAX and CAS. Need more. It would be
>> great to see code components for everyday problems faced in the
>> development environment.
>>
>> On Apr 22, 9:51 am, Pynthon Pynthon  wrote:
>> > So also a web-framework :$?
>> >
>> > 2009/4/22 mdipierro 
>> >
>>
>>
>>
>
> >
>

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



[web2py:20277] Re: Scalability

2009-04-22 Thread Pynthon

And the cache function is that easy to do? Is W2P also faster then
Django?

On 22 apr, 19:01, mdipierro  wrote:
> If you store everything in the database the only bottleneck is the
> database. The web2py DAL does not add a significative overhead. You
> can have as many servers you need under a load balancer. Those web
> server can work independently (other than for the database) thus
> providing scalability.
>
> You cannot separate the issue of scalability from the issue of speed.
>
> - web2py is much faster than rails. If you try them both you will feel
> the difference.
> - web2py supports connection pools
> - You can improve web2py speed by storing uploaded files in a upload
> folder (the default) and make it a shared folder. This will reduce
> database load but does not necessarily reduce network load.
> - You can improve speed by not using sessions.
> - You can improve speed by caching page in ram or memcache.
>
> I am sure other uses will have experiences to share.
>
> Massimo
>
> On Apr 22, 11:43 am, Pynthon  wrote:
>
> > Hello
>
> > Ruby on Rails is sometimes hard to scale I heard. How is this with
> > W2P?
>
> > Thanks
> > Pynthon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20279] Re: Compliments

2009-04-22 Thread Yarko Tymciurak
http://www.web2py.com/examples/static/dojo.pdf

On Wed, Apr 22, 2009 at 12:15 PM, Yarko Tymciurak  wrote:

> We built a news system in 2 hours in PyCon, at a web2py code dojo.
> I'll try to find the link to the slides.
>
>
> On Wed, Apr 22, 2009 at 10:47 AM, Pynthon Pynthon wrote:
>
>> I did not try W2P yet but I want to make something like this:
>>
>> Content system with categories (add pages and categories etc.)
>> News system with categories (add news and categories etc.)
>> Menu Manager
>> Poll system
>>
>> That can be done easily done with W2P right? In PHP this takes weeks!
>>
>> 2009/4/22 JohnMc 
>>
>>
>>> I will give PHP one kudo -- They have wrapped themselves a fantastic
>>> suite of prebuilt componentry. Just go over to phpclasses.org and take
>>> a look. If you can't find a piece of code to use or morph then maybe
>>> PHP can't do it.
>>>
>>> Web2py has as a framework  the mechanism to do the same. Even has
>>> working examples with items like KPAX and CAS. Need more. It would be
>>> great to see code components for everyday problems faced in the
>>> development environment.
>>>
>>> On Apr 22, 9:51 am, Pynthon Pynthon  wrote:
>>> > So also a web-framework :$?
>>> >
>>> > 2009/4/22 mdipierro 
>>> >
>>>
>>>
>>>
>>
>> >>
>>
>

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



[web2py:20280] Re: Compliments

2009-04-22 Thread Yarko Tymciurak
Overview of the dojo is here:
http://us.pycon.org/2009/openspace/web2py_dojo/

On Wed, Apr 22, 2009 at 12:17 PM, Yarko Tymciurak  wrote:

> http://www.web2py.com/examples/static/dojo.pdf
>
>
> On Wed, Apr 22, 2009 at 12:15 PM, Yarko Tymciurak wrote:
>
>> We built a news system in 2 hours in PyCon, at a web2py code dojo.
>> I'll try to find the link to the slides.
>>
>>
>> On Wed, Apr 22, 2009 at 10:47 AM, Pynthon Pynthon wrote:
>>
>>> I did not try W2P yet but I want to make something like this:
>>>
>>> Content system with categories (add pages and categories etc.)
>>> News system with categories (add news and categories etc.)
>>> Menu Manager
>>> Poll system
>>>
>>> That can be done easily done with W2P right? In PHP this takes weeks!
>>>
>>> 2009/4/22 JohnMc 
>>>
>>>
 I will give PHP one kudo -- They have wrapped themselves a fantastic
 suite of prebuilt componentry. Just go over to phpclasses.org and take
 a look. If you can't find a piece of code to use or morph then maybe
 PHP can't do it.

 Web2py has as a framework  the mechanism to do the same. Even has
 working examples with items like KPAX and CAS. Need more. It would be
 great to see code components for everyday problems faced in the
 development environment.

 On Apr 22, 9:51 am, Pynthon Pynthon  wrote:
 > So also a web-framework :$?
 >
 > 2009/4/22 mdipierro 
 >



>>>
>>> >>>
>>>
>>
>

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



[web2py:20283] Admin Panel

2009-04-22 Thread Pynthon

Hello

Sorry for making so much posts :P. But I have a question about the
admin panel. Is the out-of-the-box a-panel only for developing apps or
also for maintenance apps? Need I build a custom a-panel for
maintenance apps or can I just use the out-of-the-box a-panel?

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



[web2py:20281] Re: Script using DAL: references don't work

2009-04-22 Thread Álvaro Justen [Turicas]

On Wed, Apr 22, 2009 at 1:02 PM, mdipierro  wrote:
> web2py already has a mechanism for running scripts that see models.
>
> Did you look into
>
> python web2py.py -S yourapp -M -R script.py
>
> Try
>
> python web2py.py -h

It worked. Thanks!

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

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



[web2py:20282] Re: Compliments

2009-04-22 Thread Pynthon

Thanks, looks interesting! When I know some more about W2P I'm gonne
read it full!

On 22 apr, 19:19, Yarko Tymciurak  wrote:
> Overview of the dojo is here:http://us.pycon.org/2009/openspace/web2py_dojo/
>
> On Wed, Apr 22, 2009 at 12:17 PM, Yarko Tymciurak  wrote:
> >http://www.web2py.com/examples/static/dojo.pdf
>
> > On Wed, Apr 22, 2009 at 12:15 PM, Yarko Tymciurak wrote:
>
> >> We built a news system in 2 hours in PyCon, at a web2py code dojo.
> >> I'll try to find the link to the slides.
>
> >> On Wed, Apr 22, 2009 at 10:47 AM, Pynthon Pynthon 
> >> wrote:
>
> >>> I did not try W2P yet but I want to make something like this:
>
> >>> Content system with categories (add pages and categories etc.)
> >>> News system with categories (add news and categories etc.)
> >>> Menu Manager
> >>> Poll system
>
> >>> That can be done easily done with W2P right? In PHP this takes weeks!
>
> >>> 2009/4/22 JohnMc 
>
>  I will give PHP one kudo -- They have wrapped themselves a fantastic
>  suite of prebuilt componentry. Just go over to phpclasses.org and take
>  a look. If you can't find a piece of code to use or morph then maybe
>  PHP can't do it.
>
>  Web2py has as a framework  the mechanism to do the same. Even has
>  working examples with items like KPAX and CAS. Need more. It would be
>  great to see code components for everyday problems faced in the
>  development environment.
>
>  On Apr 22, 9:51 am, Pynthon Pynthon  wrote:
>  > So also a web-framework :$?
>
>  > 2009/4/22 mdipierro 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20284] google 3d js api

2009-04-22 Thread mdipierro

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



[web2py:20285] Re: Using external libraries?

2009-04-22 Thread mdipierro

If you are running web2py from source there is nothings special for
you to do. The steps below should just work.

Massimo


On Apr 22, 12:09 pm, Michael  wrote:
> Hey guys,
>
>I've been messing around with the twitter library for python from
> the command line. Is it possible to use this in web2py? It has a JSON
> library dependency.
>
>   Also, if i have it in web2py how do i 'install' it? from the command
> line, i know to just do;
>
>   python setup.py install
>
>   But how do i go about installing libraries into web2py so I can
> access them the same way:
>
>   import twitter
>
>   def tweet():
>
>   client = twitter.Api(username='test', password='test')
>   update = client.PostUpdate('hello from python!')
>
> etc...
>
> thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20286] Re: Admin Panel

2009-04-22 Thread Yarko Tymciurak
It should be good for maintenance of stes, this this depends on what you
think of when you say this.
for PyCon registration, we added some application-specific manager functions
for the application, used admin toolset for some (few) things, and for
the occasional special processing request, just ran a line or two of code
from the web2py shell.

As you get familiar with using web2py and admin, your questions will answer.

On Wed, Apr 22, 2009 at 12:29 PM, Pynthon  wrote:

>
> Hello
>
> Sorry for making so much posts :P. But I have a question about the
> admin panel. Is the out-of-the-box a-panel only for developing apps or
> also for maintenance apps? Need I build a custom a-panel for
> maintenance apps or can I just use the out-of-the-box a-panel?
>
> Thanks,
> Pynthon
> >
>

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



[web2py:20287] Re: Scalability

2009-04-22 Thread mdipierro

say you have a function f() and you want to cache it for 3000ms. You
do

instead of calling

f()

you call

cahe.ram('somekeyword',f,3000)

This way you can cache anything but database connections. You can
cache quesries with

db(...).select(...cache=(cache.ram,3000))

More examples are on the docs page.

Massimo

On Apr 22, 12:13 pm, Pynthon  wrote:
> And the cache function is that easy to do? Is W2P also faster then
> Django?
>
> On 22 apr, 19:01, mdipierro  wrote:
>
> > If you store everything in the database the only bottleneck is the
> > database. The web2py DAL does not add a significative overhead. You
> > can have as many servers you need under a load balancer. Those web
> > server can work independently (other than for the database) thus
> > providing scalability.
>
> > You cannot separate the issue of scalability from the issue of speed.
>
> > - web2py is much faster than rails. If you try them both you will feel
> > the difference.
> > - web2py supports connection pools
> > - You can improve web2py speed by storing uploaded files in a upload
> > folder (the default) and make it a shared folder. This will reduce
> > database load but does not necessarily reduce network load.
> > - You can improve speed by not using sessions.
> > - You can improve speed by caching page in ram or memcache.
>
> > I am sure other uses will have experiences to share.
>
> > Massimo
>
> > On Apr 22, 11:43 am, Pynthon  wrote:
>
> > > Hello
>
> > > Ruby on Rails is sometimes hard to scale I heard. How is this with
> > > W2P?
>
> > > Thanks
> > > Pynthon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20288] Re: Scalability

2009-04-22 Thread mdipierro

The template system is faster than Django's (because you can bytecode
compile after parsing thus there is no persing overhead in
production).
The models and controllers are probably of comparable speed. I do not
have precise data.

Massimo

On Apr 22, 12:13 pm, Pynthon  wrote:
> And the cache function is that easy to do? Is W2P also faster then
> Django?
>
> On 22 apr, 19:01, mdipierro  wrote:
>
> > If you store everything in the database the only bottleneck is the
> > database. The web2py DAL does not add a significative overhead. You
> > can have as many servers you need under a load balancer. Those web
> > server can work independently (other than for the database) thus
> > providing scalability.
>
> > You cannot separate the issue of scalability from the issue of speed.
>
> > - web2py is much faster than rails. If you try them both you will feel
> > the difference.
> > - web2py supports connection pools
> > - You can improve web2py speed by storing uploaded files in a upload
> > folder (the default) and make it a shared folder. This will reduce
> > database load but does not necessarily reduce network load.
> > - You can improve speed by not using sessions.
> > - You can improve speed by caching page in ram or memcache.
>
> > I am sure other uses will have experiences to share.
>
> > Massimo
>
> > On Apr 22, 11:43 am, Pynthon  wrote:
>
> > > Hello
>
> > > Ruby on Rails is sometimes hard to scale I heard. How is this with
> > > W2P?
>
> > > Thanks
> > > Pynthon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20289] Re: Admin Panel

2009-04-22 Thread Pynthon

So, a normal news system with categories with this functions:
Add news, edit news, delete news.
Add cats, edit cats, delete cats

Can be good for maintenance sites?

On 22 apr, 20:02, Yarko Tymciurak  wrote:
> It should be good for maintenance of stes, this this depends on what you
> think of when you say this.
> for PyCon registration, we added some application-specific manager functions
> for the application, used admin toolset for some (few) things, and for
> the occasional special processing request, just ran a line or two of code
> from the web2py shell.
>
> As you get familiar with using web2py and admin, your questions will answer.
>
> On Wed, Apr 22, 2009 at 12:29 PM, Pynthon  wrote:
>
> > Hello
>
> > Sorry for making so much posts :P. But I have a question about the
> > admin panel. Is the out-of-the-box a-panel only for developing apps or
> > also for maintenance apps? Need I build a custom a-panel for
> > maintenance apps or can I just use the out-of-the-box a-panel?
>
> > Thanks,
> > Pynthon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20290] Re: Scalability

2009-04-22 Thread mdipierro

I do not know if it is faster than Django because it depends on what
you do.

- the web2py template language is faster than Django's
- the web2py DAL is faster than Django's ORM
- Django has a url.py overhead (required). You have the same in web2py
is you use routes.py (optional)

If you want to run some tests I can help you and I'd be very much
interested in quantifying this.

Massimo


On Apr 22, 12:13 pm, Pynthon  wrote:
> And the cache function is that easy to do? Is W2P also faster then
> Django?
>
> On 22 apr, 19:01, mdipierro  wrote:
>
> > If you store everything in the database the only bottleneck is the
> > database. The web2py DAL does not add a significative overhead. You
> > can have as many servers you need under a load balancer. Those web
> > server can work independently (other than for the database) thus
> > providing scalability.
>
> > You cannot separate the issue of scalability from the issue of speed.
>
> > - web2py is much faster than rails. If you try them both you will feel
> > the difference.
> > - web2py supports connection pools
> > - You can improve web2py speed by storing uploaded files in a upload
> > folder (the default) and make it a shared folder. This will reduce
> > database load but does not necessarily reduce network load.
> > - You can improve speed by not using sessions.
> > - You can improve speed by caching page in ram or memcache.
>
> > I am sure other uses will have experiences to share.
>
> > Massimo
>
> > On Apr 22, 11:43 am, Pynthon  wrote:
>
> > > Hello
>
> > > Ruby on Rails is sometimes hard to scale I heard. How is this with
> > > W2P?
>
> > > Thanks
> > > Pynthon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20291] Re: Scalability

2009-04-22 Thread Pynthon

Nice! I searched at the document via Google but cannot find anything
about caching =[.

On 22 apr, 20:09, mdipierro  wrote:
> I do not know if it is faster than Django because it depends on what
> you do.
>
> - the web2py template language is faster than Django's
> - the web2py DAL is faster than Django's ORM
> - Django has a url.py overhead (required). You have the same in web2py
> is you use routes.py (optional)
>
> If you want to run some tests I can help you and I'd be very much
> interested in quantifying this.
>
> Massimo
>
> On Apr 22, 12:13 pm, Pynthon  wrote:
>
> > And the cache function is that easy to do? Is W2P also faster then
> > Django?
>
> > On 22 apr, 19:01, mdipierro  wrote:
>
> > > If you store everything in the database the only bottleneck is the
> > > database. The web2py DAL does not add a significative overhead. You
> > > can have as many servers you need under a load balancer. Those web
> > > server can work independently (other than for the database) thus
> > > providing scalability.
>
> > > You cannot separate the issue of scalability from the issue of speed.
>
> > > - web2py is much faster than rails. If you try them both you will feel
> > > the difference.
> > > - web2py supports connection pools
> > > - You can improve web2py speed by storing uploaded files in a upload
> > > folder (the default) and make it a shared folder. This will reduce
> > > database load but does not necessarily reduce network load.
> > > - You can improve speed by not using sessions.
> > > - You can improve speed by caching page in ram or memcache.
>
> > > I am sure other uses will have experiences to share.
>
> > > Massimo
>
> > > On Apr 22, 11:43 am, Pynthon  wrote:
>
> > > > Hello
>
> > > > Ruby on Rails is sometimes hard to scale I heard. How is this with
> > > > W2P?
>
> > > > Thanks
> > > > Pynthon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20292] Re: Using external libraries?

2009-04-22 Thread Michael

excuse my illiteracy on this.

I've downloaded the client for the mac. and it run it through the
web2py.app

also, how does one go about doing this in a production enviroment? i.e
a webhost, or GAE.

On Apr 22, 2:00 pm, mdipierro  wrote:
> If you are running web2py from source there is nothings special for
> you to do. The steps below should just work.
>
> Massimo
>
> On Apr 22, 12:09 pm, Michael  wrote:
>
>
>
> > Hey guys,
>
> >    I've been messing around with the twitter library for python from
> > the command line. Is it possible to use this in web2py? It has a JSON
> > library dependency.
>
> >   Also, if i have it in web2py how do i 'install' it? from the command
> > line, i know to just do;
>
> >   python setup.py install
>
> >   But how do i go about installing libraries into web2py so I can
> > access them the same way:
>
> >   import twitter
>
> >   def tweet():
>
> >       client = twitter.Api(username='test', password='test')
> >       update = client.PostUpdate('hello from python!')
>
> > etc...
>
> > thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20293] Re: Compliments

2009-04-22 Thread Francisco Gama

Btw, is there going to be a 2nd edition of the book?
If yes, When?

On Apr 21, 2:23 pm, mdipierro  wrote:
> Thank you for your comments. Mind that the "real" book is the same as
> the pdf book on lulu.
> If you have one there is no reason to spend money on the other.
>
> Massimo
>
> On 21 Apr, 05:39, Pynthon  wrote:
>
> > Hello
>
> > Im Pynthon and I'm 14 years old, sorry for my bad English but I come
> > from Holland. However, I started to learn Python 2/3 weeks ago for
> > Django. When I started Django I had a lot of problems. Then I saw Grok
> > some of the people said that hosting is a big problem so they
> > recommend me Web2Py. First I was a little bit scared because I need to
> > buy a book. I was scared that web2py was nothing and then I lost my 12
> > dollar :P. However, I saw some free eBooks like the cutted version of
> > the book. I was reading it and Web2Py is so simple! In Django I always
> > was frustrated but in W2P everything is so amazing! I think that I'm
> > gonne buy the real book this friday! I also saw that W2P is easy to
> > install on hosts. Anyways, thanks for this fantastic framework! I did
> > not use it yet but when I'm thinking about it I exactly know how to
> > create my site with it!
>
> > Good job, goob job!
>
> > Pynthon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20294] Re: google 3d js api

2009-04-22 Thread Michael

Holy smokes! This looks amazing

On Apr 22, 1:59 pm, mdipierro  wrote:
> http://code.google.com/apis/o3d/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20295] Re: Compliments

2009-04-22 Thread Pynthon

I don't know but is it outdated?

On 22 apr, 20:18, Francisco Gama  wrote:
> Btw, is there going to be a 2nd edition of the book?
> If yes, When?
>
> On Apr 21, 2:23 pm, mdipierro  wrote:
>
> > Thank you for your comments. Mind that the "real" book is the same as
> > the pdf book on lulu.
> > If you have one there is no reason to spend money on the other.
>
> > Massimo
>
> > On 21 Apr, 05:39, Pynthon  wrote:
>
> > > Hello
>
> > > Im Pynthon and I'm 14 years old, sorry for my bad English but I come
> > > from Holland. However, I started to learn Python 2/3 weeks ago for
> > > Django. When I started Django I had a lot of problems. Then I saw Grok
> > > some of the people said that hosting is a big problem so they
> > > recommend me Web2Py. First I was a little bit scared because I need to
> > > buy a book. I was scared that web2py was nothing and then I lost my 12
> > > dollar :P. However, I saw some free eBooks like the cutted version of
> > > the book. I was reading it and Web2Py is so simple! In Django I always
> > > was frustrated but in W2P everything is so amazing! I think that I'm
> > > gonne buy the real book this friday! I also saw that W2P is easy to
> > > install on hosts. Anyways, thanks for this fantastic framework! I did
> > > not use it yet but when I'm thinking about it I exactly know how to
> > > create my site with it!
>
> > > Good job, goob job!
>
> > > Pynthon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20296] pdf in js

2009-04-22 Thread mdipierro

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



[web2py:20297] Re: Scalability

2009-04-22 Thread JorgeR



On Apr 22, 1:09 pm, mdipierro  wrote:
> I do not know if it is faster than Django because it depends on what
> you do.


> If you want to run some tests I can help you and I'd be very much
> interested in quantifying this.
>
> Massimo

I am also very interested in those results!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20298] Re: Admin Panel

2009-04-22 Thread Fran

On Apr 22, 7:08 pm, Pynthon  wrote:
> So, a normal news system with categories with this functions:
> Add news, edit news, delete news.
> Add cats, edit cats, delete cats
> Can be good for maintenance sites?

If your admin is happy with this more-complex-than-necessary UI, then
sure, it'll do the job very nicely :)

However it is *very* easy to make a simplified version which means
maintenance admins can work in a more autopilot fashion :)

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



[web2py:20299] Re: How do I make a restricted page that I go to return after I login.

2009-04-22 Thread Fran

On Apr 21, 6:32 pm, Jason Brower  wrote:
> I have auth setup, but after entering my information to log into a
> restricted page, I get back to the index page.  Wouldn't it be natural
> to go to the page I was at rather than to index?

Yes & is the default setting, which works for me (it picks it up from
request.vars._next).

If this isn't working for you, you can control it via
auth.settings.login_next

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



[web2py:20300] Re: dynamically changing page headers

2009-04-22 Thread Fran

On Apr 21, 10:52 pm, Tim Michelsen 
wrote:
> is it possible to dynamically change web page headers in view?
> I am using openlayers.org, an external javascript library which demands
> to embed
> * a library script reference in the header
> * a custom css in the header
> How can this be done dynamically?
> So far, I just created new layout.html (layout_mylib.html) based on the
> default. Then I included the js & css in that layout file.
> In the pages where I want to use openlayers I extended layout_mylib.html
> instead of layout.html.
> Is this a good way or are there better options?

What I do is to use view fragments & so in my custom view for the
map_viewing_client I have:
{{extend 'layout.html'}}
{{include 'ol_js_loaders.html'}}

See:
http://trac.sahanapy.org/browser/views/gis/map_viewing_client.html

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



[web2py:20301] Re: Compliments

2009-04-22 Thread Yarko Tymciurak
Looking it over, I would say - no, it's not that the book is outdated...

(see the table of contents yourself at
http://www.web2py.com/examples/static/web2py_manual_cut.pdf)

I think it's more that there are new things to talk about.

I continue to use the book.

On Wed, Apr 22, 2009 at 1:20 PM, Pynthon  wrote:

>
> I don't know but is it outdated?
>
> On 22 apr, 20:18, Francisco Gama  wrote:
> > Btw, is there going to be a 2nd edition of the book?
> > If yes, When?
> >
> > On Apr 21, 2:23 pm, mdipierro  wrote:
> >
> > > Thank you for your comments. Mind that the "real" book is the same as
> > > the pdf book on lulu.
> > > If you have one there is no reason to spend money on the other.
> >
> > > Massimo
> >
> > > On 21 Apr, 05:39, Pynthon  wrote:
> >
> > > > Hello
> >
> > > > Im Pynthon and I'm 14 years old, sorry for my bad English but I come
> > > > from Holland. However, I started to learn Python 2/3 weeks ago for
> > > > Django. When I started Django I had a lot of problems. Then I saw
> Grok
> > > > some of the people said that hosting is a big problem so they
> > > > recommend me Web2Py. First I was a little bit scared because I need
> to
> > > > buy a book. I was scared that web2py was nothing and then I lost my
> 12
> > > > dollar :P. However, I saw some free eBooks like the cutted version of
> > > > the book. I was reading it and Web2Py is so simple! In Django I
> always
> > > > was frustrated but in W2P everything is so amazing! I think that I'm
> > > > gonne buy the real book this friday! I also saw that W2P is easy to
> > > > install on hosts. Anyways, thanks for this fantastic framework! I did
> > > > not use it yet but when I'm thinking about it I exactly know how to
> > > > create my site with it!
> >
> > > > Good job, goob job!
> >
> > > > Pynthon
> >
>

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



[web2py:20302] Q: Will "wwwSQLdesigner" be added into the "Web2Py" release cycle???

2009-04-22 Thread cesmiga

Massimo,

I don't know if this question has been asked before, but is it
possible to include "wwwSQLdesigner" into "Web2Py"?

wwwSQLdesigner
http://code.google.com/p/wwwsqldesigner/

I have been playing with this web based, JavaScript ERM application
and it is pretty cool.  I hope the author continues to develop it or
others are contribute. This sweet baby really helps people develop
"Web2Py" models.

"wwwSQLdesigner" + "Web2Py" is the "icing on the cake"!

Is anyone associated with "Web2Py" assisting with development of
"wwwSQLdesigner".  I see the...

[ Generate SQL (web2py) ]

button option when configured.

This stuff ROCKS!!!

Thank you,
Christopher

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



[web2py:20303] Re: Form for adding db line does not work; input text instead of select

2009-04-22 Thread dvid

Thanks for both replies. For now I only wanted what the first advice
solved, but the second one is interesting indeed.

I can say I like your piece of software increasingly, as getting
deeper. Really, it has brought the fresh air to the world of web
frameworks :)

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



[web2py:20304] templating a non-html file (in view)

2009-04-22 Thread Tim Michelsen

Hello,
I would like to use the following how-to to generate a kml file from my 
data base selection:

Better Python Practices for the GeoWeb
http://sgillies.net/blog/584/better-python-practices-for-the-geoweb/


http://earth.google.com/kml/2.1";
   xmlns:py="http://genshi.edgewall.org/";
   >
   
 
   
 
   http://maps.google.com/mapfiles/kml/pal3/icon38.png
 
   
 
 
   NAME
   #fireIcon
   
 DESCRIPTION
   
   
 
   LONG,LAT
 
   
 
   


I created a function that works in other files called "kml".

Now created a file kml.kml in views/default:


http://earth.google.com/kml/2.1";
   >
   
 
   
 
   http://maps.google.com/mapfiles/kml/pal3/icon38.png
 
   
 
 {{for placemark in placemarks:}}
 
   {{=placemark.name}}
   #fireIcon
   
 {{=placemark.description}}
   
   
 
   {{=placemark.lon}}, {{=placemark.lat}}
 
   
 
 {{pass}}
   



But when I enter the URL in the browser I get an invalid request.
Why?
If I rename the file to kml.html it returns the query result only.

How do I need to change my controller that web2py delivers xml using my 
kml.kml template file?

Thanks in advance,
Timmie


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



[web2py:20305] Tipp: SQLItebrowser [was: Re: [web2py:20302] Q: Will "wwwSQLdesigner" be added into the "Web2Py" release cycle???]

2009-04-22 Thread Tim Michelsen

additionally,
if you name your tables with the .sqlite extension, you can associate 
sqlitebrowser (http://sqlitebrowser.sourceforge.net/) to this file and 
explore the databse in the table


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



[web2py:20306] Re: Using external libraries?

2009-04-22 Thread mdipierro

You cannot use the Mac binary (the app) with third party libraries
easily.

If you want to use third party Python libraries you need to install
Python (2.5) and run the web2py source distribution.

Any web host that provides Python 2.5 can run web2py. Some hosts do it
via mod_proxy, some via mod_wsgi, some via mod_fcgi, some via cgi. It
really depends on the specific one you pick. Some like webfaction post
instructions on what to do.

Massimo

On Apr 22, 1:15 pm, Michael  wrote:
> excuse my illiteracy on this.
>
> I've downloaded the client for the mac. and it run it through the
> web2py.app
>
> also, how does one go about doing this in a production enviroment? i.e
> a webhost, or GAE.
>
> On Apr 22, 2:00 pm, mdipierro  wrote:
>
> > If you are running web2py from source there is nothings special for
> > you to do. The steps below should just work.
>
> > Massimo
>
> > On Apr 22, 12:09 pm, Michael  wrote:
>
> > > Hey guys,
>
> > >I've been messing around with the twitter library for python from
> > > the command line. Is it possible to use this in web2py? It has a JSON
> > > library dependency.
>
> > >   Also, if i have it in web2py how do i 'install' it? from the command
> > > line, i know to just do;
>
> > >   python setup.py install
>
> > >   But how do i go about installing libraries into web2py so I can
> > > access them the same way:
>
> > >   import twitter
>
> > >   def tweet():
>
> > >   client = twitter.Api(username='test', password='test')
> > >   update = client.PostUpdate('hello from python!')
>
> > > etc...
>
> > > thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20307] Re: Compliments

2009-04-22 Thread mdipierro

I agree with Yarko.

web2py is always backward compatible so technically the book is not
outdated.
Specifically it does not cover:

- dbtable[...] shortcuts
- new routes.py features
- tools.py

Massimo

On Apr 22, 4:08 pm, Yarko Tymciurak  wrote:
> Looking it over, I would say - no, it's not that the book is outdated...
>
> (see the table of contents yourself 
> athttp://www.web2py.com/examples/static/web2py_manual_cut.pdf)
>
> I think it's more that there are new things to talk about.
>
> I continue to use the book.
>
> On Wed, Apr 22, 2009 at 1:20 PM, Pynthon  wrote:
>
> > I don't know but is it outdated?
>
> > On 22 apr, 20:18, Francisco Gama  wrote:
> > > Btw, is there going to be a 2nd edition of the book?
> > > If yes, When?
>
> > > On Apr 21, 2:23 pm, mdipierro  wrote:
>
> > > > Thank you for your comments. Mind that the "real" book is the same as
> > > > the pdf book on lulu.
> > > > If you have one there is no reason to spend money on the other.
>
> > > > Massimo
>
> > > > On 21 Apr, 05:39, Pynthon  wrote:
>
> > > > > Hello
>
> > > > > Im Pynthon and I'm 14 years old, sorry for my bad English but I come
> > > > > from Holland. However, I started to learn Python 2/3 weeks ago for
> > > > > Django. When I started Django I had a lot of problems. Then I saw
> > Grok
> > > > > some of the people said that hosting is a big problem so they
> > > > > recommend me Web2Py. First I was a little bit scared because I need
> > to
> > > > > buy a book. I was scared that web2py was nothing and then I lost my
> > 12
> > > > > dollar :P. However, I saw some free eBooks like the cutted version of
> > > > > the book. I was reading it and Web2Py is so simple! In Django I
> > always
> > > > > was frustrated but in W2P everything is so amazing! I think that I'm
> > > > > gonne buy the real book this friday! I also saw that W2P is easy to
> > > > > install on hosts. Anyways, thanks for this fantastic framework! I did
> > > > > not use it yet but when I'm thinking about it I exactly know how to
> > > > > create my site with it!
>
> > > > > Good job, goob job!
>
> > > > > Pynthon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20308] Re: Form for adding db line does not work; input text instead of select

2009-04-22 Thread mdipierro

Thanks David, tell everybody. ;-)

On Apr 22, 4:47 pm, dvid  wrote:
> Thanks for both replies. For now I only wanted what the first advice
> solved, but the second one is interesting indeed.
>
> I can say I like your piece of software increasingly, as getting
> deeper. Really, it has brought the fresh air to the world of web
> frameworks :)
>
> With regards
> David
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20309] Re: templating a non-html file (in view)

2009-04-22 Thread mdipierro

If you app is called "yourapp" and you put this file in

applications/yourapp/views/default/kml.html

you also need to edit

applications/yourapp/controllers/default.py

and add an action

def kml():
 placemarks=db(...).select() ## fill the ...
 return dict(placemarks=placemarks)

then you visit

http://127.0.0.1:8000/yourapp/default/kml

this calls the action, the action calls the view file.

Hope this helps. I am not sure I understood the question.

Massimo

On Apr 22, 5:37 pm, Tim Michelsen  wrote:
> Hello,
> I would like to use the following how-to to generate a kml file from my
> data base selection:
>
> Better Python Practices for the 
> GeoWebhttp://sgillies.net/blog/584/better-python-practices-for-the-geoweb/
>
> 
> xmlns="http://earth.google.com/kml/2.1";
>xmlns:py="http://genshi.edgewall.org/";
>>
>
>  
>
>  
>http://maps.google.com/mapfiles/kml/pal3/icon38.png
>  
>
>  
>  
>NAME
>#fireIcon
>
>  DESCRIPTION
>
>
>  
>LONG,LAT
>  
>
>  
>
> 
>
> I created a function that works in other files called "kml".
>
> Now created a file kml.kml in views/default:
>
> 
> xmlns="http://earth.google.com/kml/2.1";
>>
>
>  
>
>  
>http://maps.google.com/mapfiles/kml/pal3/icon38.png
>  
>
>  
>  {{for placemark in placemarks:}}
>  
>{{=placemark.name}}
>#fireIcon
>
>  {{=placemark.description}}
>
>
>  
>{{=placemark.lon}}, {{=placemark.lat}}
>  
>
>  
>  {{pass}}
>
> 
>
> But when I enter the URL in the browser I get an invalid request.
> Why?
> If I rename the file to kml.html it returns the query result only.
>
> How do I need to change my controller that web2py delivers xml using my
> kml.kml template file?
>
> Thanks in advance,
> Timmie
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20310] Re: Q: Will "wwwSQLdesigner" be added into the "Web2Py" release cycle???

2009-04-22 Thread mdipierro

The problem is that sqldesigner is GPL and may not be compatible with
the web2py exception in the license.

we are working on simplifying the DAL syntax anyway,

Massimo



On Apr 22, 4:39 pm, cesmiga  wrote:
> Massimo,
>
> I don't know if this question has been asked before, but is it
> possible to include "wwwSQLdesigner" into "Web2Py"?
>
> wwwSQLdesigner
>http://code.google.com/p/wwwsqldesigner/
>
> I have been playing with this web based, JavaScript ERM application
> and it is pretty cool.  I hope the author continues to develop it or
> others are contribute. This sweet baby really helps people develop
> "Web2Py" models.
>
> "wwwSQLdesigner" + "Web2Py" is the "icing on the cake"!
>
> Is anyone associated with "Web2Py" assisting with development of
> "wwwSQLdesigner".  I see the...
>
> [ Generate SQL (web2py) ]
>
> button option when configured.
>
> This stuff ROCKS!!!
>
> Thank you,
> Christopher
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20311] Re: Tipp: SQLItebrowser [was: Re: [web2py:20302] Q: Will "wwwSQLdesigner" be added into the "Web2Py" release cycle???]

2009-04-22 Thread mdipierro

cool.

On Apr 22, 5:55 pm, Tim Michelsen  wrote:
> additionally,
> if you name your tables with the .sqlite extension, you can associate
> sqlitebrowser (http://sqlitebrowser.sourceforge.net/) to this file and
> explore the databse in the table
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20312] Re: Compliments

2009-04-22 Thread suiato

Look forward to T3 evolving :-)
Tried it after downloading from http://web2py.appspot.com/t3, and it
seems to work fine so far.

Noticed some updating is needed on the Main page (http://
web2py.appspot.com/t3/default/wiki/main) for the current T3 version:
- Click on Configure -> Click on Manage Settings
- If you access the "Configure" menu item -> If you access the "Manage
Models" menu item

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



[web2py:20313] How to insert db record, and return ID of new record

2009-04-22 Thread waTR

I am trying to have a controller insert a db record, and then update
the same record. However, in order to update the record just created
by a user session, I need to use the db record's id number. The
problem is, I don't know how to get the id number from the record just
created by a user session.

Help?

Here is the pseudo code:

db.db_users.insert( dbu_name=request.vars.nick,
dbu_email=request.vars.email,
dbu_password=request.vars.pass1,
dbu_city=request.vars.city,
dbu_referral=request.vars.referral)

db(db.db_users.id==USERID_FROM_RECORD_ABOVE).select()[0].update_record
(\
dbu_name=request.vars.nick,\
dbu_email=request.vars.email,\
dbu_password=request.vars.pass1,\
dbu_city=request.vars.city,\
dbu_referral=request.vars.referral)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20314] Re: Compliments

2009-04-22 Thread waTR

No, it is a webapp being developed using web2py. Think Drupal/Jumla +
Plug-ins.



On Apr 22, 7:51 am, Pynthon Pynthon  wrote:
> So also a web-framework :$?
>
> 2009/4/22 mdipierro 
>
>
>
> > T1 does not exist.
>
> > T2 is a deprecated web2py tier 2
> >http://www.web2py.com/examples/statis/plugin_t2.pdf
>
> > T3 is the evolution of T2 and still evolving... it includes T2.
> >http://web2py.appspot.com/t3
>
> > This will merge with this
> >http://www.web2py.com/events/default/index
> > + KPAX + eStore
>
> > to make a kick ass development platform.
>
> > Sorry no timetable yet.
>
> > Massimo
>
> > On 22 Apr, 09:11, Pynthon Pynthon  wrote:
> > > I also use WIndows. What is btw T1 and T2 *shame*?
>
> > > 2009/4/22 Fran 
>
> > > > On Apr 21, 8:59 pm, Omar Munk  wrote:
> > > > > Windows isn't much used in the "Web-Framework-Scene":(
>
> > > > Several people develop using Web2Py on Windows - I'm 1 :)
>
> > > > F
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20315] Auth API - Registration allow to save Empty Password ????

2009-04-22 Thread Yannick

Hello mate,
I just tested the new version 1.61.4 after a small break and noticed
that the Auth API still allows the registration form to register a new
user with an empty password (In the both fields) I was wondering
if this is how that Auth API is intend to work or it is just a small
bug.

I did report that issue in the thread long time ago... You can see the
full description from this link below !

*

http://groups.google.com/group/web2py/browse_thread/thread/606d27940683358/d049cef0ffbb4727?hl=en#d049cef0ffbb4727

*

Thanks for your attention,

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



[web2py:20316] Re: How to insert db record, and return ID of new record

2009-04-22 Thread Iceberg

Havn't you read this? http://www.web2py.com/examples/default/dal

On Apr23, 9:21am, waTR  wrote:
> I am trying to have a controller insert a db record, and then update
> the same record. However, in order to update the record just created
> by a user session, I need to use the db record's id number. The
> problem is, I don't know how to get the id number from the record just
> created by a user session.
>
> Help?
>
> Here is the pseudo code:
>
> db.db_users.insert( dbu_name=request.vars.nick,
>                             dbu_email=request.vars.email,
>                             dbu_password=request.vars.pass1,
>                             dbu_city=request.vars.city,
>                             dbu_referral=request.vars.referral)
>
> db(db.db_users.id==USERID_FROM_RECORD_ABOVE).select()[0].update_record
> (\
>                                 dbu_name=request.vars.nick,\
>                                 dbu_email=request.vars.email,\
>                                 dbu_password=request.vars.pass1,\
>                                 dbu_city=request.vars.city,\
>                                 dbu_referral=request.vars.referral)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20317] Re: Using external libraries?

2009-04-22 Thread Iceberg

I don't know mac, but when using Windows binary (the web2py_win.zip),
I can always put 3rd party libraries into web2py/applications/myapp/
modules, then access it, in a slightly different way:

  import applications.myapp.modules.third_parti_lib

On Apr23, 7:46am, mdipierro  wrote:
> You cannot use the Mac binary (the app) with third party libraries
> easily.
>
> If you want to use third party Python libraries you need to install
> Python (2.5) and run the web2py source distribution.
>
> Any web host that provides Python 2.5 can run web2py. Some hosts do it
> via mod_proxy, some via mod_wsgi, some via mod_fcgi, some via cgi. It
> really depends on the specific one you pick. Some like webfaction post
> instructions on what to do.
>
> Massimo
>
> On Apr 22, 1:15 pm, Michael  wrote:
>
> > excuse my illiteracy on this.
>
> > I've downloaded the client for the mac. and it run it through the
> > web2py.app
>
> > also, how does one go about doing this in a production enviroment? i.e
> > a webhost, or GAE.
>
> > On Apr 22, 2:00 pm, mdipierro  wrote:
>
> > > If you are running web2py from source there is nothings special for
> > > you to do. The steps below should just work.
>
> > > Massimo
>
> > > On Apr 22, 12:09 pm, Michael  wrote:
>
> > > > Hey guys,
>
> > > >    I've been messing around with the twitter library for python from
> > > > the command line. Is it possible to use this in web2py? It has a JSON
> > > > library dependency.
>
> > > >   Also, if i have it in web2py how do i 'install' it? from the command
> > > > line, i know to just do;
>
> > > >   python setup.py install
>
> > > >   But how do i go about installing libraries into web2py so I can
> > > > access them the same way:
>
> > > >   import twitter
>
> > > >   def tweet():
>
> > > >       client = twitter.Api(username='test', password='test')
> > > >       update = client.PostUpdate('hello from python!')
>
> > > > etc...
>
> > > > thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20318] Re: Auth API - Registration allow to save Empty Password ????

2009-04-22 Thread mdipierro

You are right. but it does not need to be change within web2py. you
can just do

auth.settings.table_user.password.requires=[IS_NOT_EMPTY(),CRYPT
(key='bla')]

you can replace IS_NOT_EMPTY with your own validator requiring
complexity.
key='' forces CRYPT to use HMAC(key) instead of the naive md5.

Massimo

On 22 Apr, 20:35, Yannick  wrote:
> Hello mate,
> I just tested the new version 1.61.4 after a small break and noticed
> that the Auth API still allows the registration form to register a new
> user with an empty password (In the both fields) I was wondering
> if this is how that Auth API is intend to work or it is just a small
> bug.
>
> I did report that issue in the thread long time ago... You can see the
> full description from this link below !
>
> *
>
> http://groups.google.com/group/web2py/browse_thread/thread/606d279406...
>
> *
>
> Thanks for your attention,
>
> Yannick P.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20319] Re: How to insert db record, and return ID of new record

2009-04-22 Thread mdipierro


id=db.db_users.insert( dbu_name=request.vars.nick,
dbu_email=request.vars.email,
dbu_password=request.vars.pass1,
dbu_city=request.vars.city,
dbu_referral=request.vars.referral)

USERID_FROM_RECORD_ABOVE=id

db(db.db_users.id==USERID_FROM_RECORD_ABOVE).select()[0].update_record
(\
dbu_name=request.vars.nick,\
dbu_email=request.vars.email,\
dbu_password=request.vars.pass1,\
dbu_city=request.vars.city,\
dbu_referral=request.vars.referral)

On 22 Apr, 20:54, Iceberg  wrote:
> Havn't you read this?http://www.web2py.com/examples/default/dal
>
> On Apr23, 9:21am, waTR  wrote:
>
> > I am trying to have a controller insert a db record, and then update
> > the same record. However, in order to update the record just created
> > by a user session, I need to use the db record's id number. The
> > problem is, I don't know how to get the id number from the record just
> > created by a user session.
>
> > Help?
>
> > Here is the pseudo code:
>
> > db.db_users.insert( dbu_name=request.vars.nick,
> >                             dbu_email=request.vars.email,
> >                             dbu_password=request.vars.pass1,
> >                             dbu_city=request.vars.city,
> >                             dbu_referral=request.vars.referral)
>
> > db(db.db_users.id==USERID_FROM_RECORD_ABOVE).select()[0].update_record
> > (\
> >                                 dbu_name=request.vars.nick,\
> >                                 dbu_email=request.vars.email,\
> >                                 dbu_password=request.vars.pass1,\
> >                                 dbu_city=request.vars.city,\
> >                                 dbu_referral=request.vars.referral)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20320] Re: Using external libraries?

2009-04-22 Thread mdipierro

You can do the same with the Mac binary. The problem may be with
modules that contain binary files. I just have never tried. In
principle every module can be installed into the binary distributions.
It is just a matter of finding the right place so that your app can
find it.

Massimo

On 22 Apr, 21:02, Iceberg  wrote:
> I don't know mac, but when using Windows binary (the web2py_win.zip),
> I can always put 3rd party libraries into web2py/applications/myapp/
> modules, then access it, in a slightly different way:
>
>   import applications.myapp.modules.third_parti_lib
>
> On Apr23, 7:46am, mdipierro  wrote:
>
> > You cannot use the Mac binary (the app) with third party libraries
> > easily.
>
> > If you want to use third party Python libraries you need to install
> > Python (2.5) and run the web2py source distribution.
>
> > Any web host that provides Python 2.5 can run web2py. Some hosts do it
> > via mod_proxy, some via mod_wsgi, some via mod_fcgi, some via cgi. It
> > really depends on the specific one you pick. Some like webfaction post
> > instructions on what to do.
>
> > Massimo
>
> > On Apr 22, 1:15 pm, Michael  wrote:
>
> > > excuse my illiteracy on this.
>
> > > I've downloaded the client for the mac. and it run it through the
> > > web2py.app
>
> > > also, how does one go about doing this in a production enviroment? i.e
> > > a webhost, or GAE.
>
> > > On Apr 22, 2:00 pm, mdipierro  wrote:
>
> > > > If you are running web2py from source there is nothings special for
> > > > you to do. The steps below should just work.
>
> > > > Massimo
>
> > > > On Apr 22, 12:09 pm, Michael  wrote:
>
> > > > > Hey guys,
>
> > > > >    I've been messing around with the twitter library for python from
> > > > > the command line. Is it possible to use this in web2py? It has a JSON
> > > > > library dependency.
>
> > > > >   Also, if i have it in web2py how do i 'install' it? from the command
> > > > > line, i know to just do;
>
> > > > >   python setup.py install
>
> > > > >   But how do i go about installing libraries into web2py so I can
> > > > > access them the same way:
>
> > > > >   import twitter
>
> > > > >   def tweet():
>
> > > > >       client = twitter.Api(username='test', password='test')
> > > > >       update = client.PostUpdate('hello from python!')
>
> > > > > etc...
>
> > > > > thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20321] Re: Using external libraries?

2009-04-22 Thread Michael

This makes sense, but do i put the whole folder inside of modules?

would i access the library by saying

import applications.myapp.modules.modulefolder

or

import applications.myapp.modules.modulefolder.twitter.py

thanks! sorry for being such a newb ;P

On Apr 22, 10:02 pm, Iceberg  wrote:
> I don't know mac, but when using Windows binary (the web2py_win.zip),
> I can always put 3rd party libraries into web2py/applications/myapp/
> modules, then access it, in a slightly different way:
>
>   import applications.myapp.modules.third_parti_lib
>
> On Apr23, 7:46am, mdipierro  wrote:
>
>
>
> > You cannot use the Mac binary (the app) with third party libraries
> > easily.
>
> > If you want to use third party Python libraries you need to install
> > Python (2.5) and run the web2py source distribution.
>
> > Any web host that provides Python 2.5 can run web2py. Some hosts do it
> > via mod_proxy, some via mod_wsgi, some via mod_fcgi, some via cgi. It
> > really depends on the specific one you pick. Some like webfaction post
> > instructions on what to do.
>
> > Massimo
>
> > On Apr 22, 1:15 pm, Michael  wrote:
>
> > > excuse my illiteracy on this.
>
> > > I've downloaded the client for the mac. and it run it through the
> > > web2py.app
>
> > > also, how does one go about doing this in a production enviroment? i.e
> > > a webhost, or GAE.
>
> > > On Apr 22, 2:00 pm, mdipierro  wrote:
>
> > > > If you are running web2py from source there is nothings special for
> > > > you to do. The steps below should just work.
>
> > > > Massimo
>
> > > > On Apr 22, 12:09 pm, Michael  wrote:
>
> > > > > Hey guys,
>
> > > > >    I've been messing around with the twitter library for python from
> > > > > the command line. Is it possible to use this in web2py? It has a JSON
> > > > > library dependency.
>
> > > > >   Also, if i have it in web2py how do i 'install' it? from the command
> > > > > line, i know to just do;
>
> > > > >   python setup.py install
>
> > > > >   But how do i go about installing libraries into web2py so I can
> > > > > access them the same way:
>
> > > > >   import twitter
>
> > > > >   def tweet():
>
> > > > >       client = twitter.Api(username='test', password='test')
> > > > >       update = client.PostUpdate('hello from python!')
>
> > > > > etc...
>
> > > > > thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20322] Bug: When an error in a form occures, upload file feilds are empty.

2009-04-22 Thread Jason Brower

I wonder if there is a way to fix this bug.  My project I work on using
file uploading very heavily and it would be nice if, when an error in
the form is found, it still has the file there ready for the upload.
Rather than the user needlessly having to find the file again.
Any thoughts on a solution?
It would also be nice if for example it's an image, it would should the
image as soon as I select it for uploading.
---
Regards,
Jason



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



[web2py:20323] Re: Using external libraries?

2009-04-22 Thread mdipierro

probably

  import applications.myapp.modules.modulefolder.twitter as twitter

no .py at the end.

or better

  exec('import applications.%s.modules.modulefolder.twitter as
twitter' % request.application)

Massimo



On 22 Apr, 22:03, Michael  wrote:
> This makes sense, but do i put the whole folder inside of modules?
>
> would i access the library by saying
>
> import applications.myapp.modules.modulefolder
>
> or
>
> import applications.myapp.modules.modulefolder.twitter.py
>
> thanks! sorry for being such a newb ;P
>
> On Apr 22, 10:02 pm, Iceberg  wrote:
>
> > I don't know mac, but when using Windows binary (the web2py_win.zip),
> > I can always put 3rd party libraries into web2py/applications/myapp/
> > modules, then access it, in a slightly different way:
>
> >   import applications.myapp.modules.third_parti_lib
>
> > On Apr23, 7:46am, mdipierro  wrote:
>
> > > You cannot use the Mac binary (the app) with third party libraries
> > > easily.
>
> > > If you want to use third party Python libraries you need to install
> > > Python (2.5) and run the web2py source distribution.
>
> > > Any web host that provides Python 2.5 can run web2py. Some hosts do it
> > > via mod_proxy, some via mod_wsgi, some via mod_fcgi, some via cgi. It
> > > really depends on the specific one you pick. Some like webfaction post
> > > instructions on what to do.
>
> > > Massimo
>
> > > On Apr 22, 1:15 pm, Michael  wrote:
>
> > > > excuse my illiteracy on this.
>
> > > > I've downloaded the client for the mac. and it run it through the
> > > > web2py.app
>
> > > > also, how does one go about doing this in a production enviroment? i.e
> > > > a webhost, or GAE.
>
> > > > On Apr 22, 2:00 pm, mdipierro  wrote:
>
> > > > > If you are running web2py from source there is nothings special for
> > > > > you to do. The steps below should just work.
>
> > > > > Massimo
>
> > > > > On Apr 22, 12:09 pm, Michael  wrote:
>
> > > > > > Hey guys,
>
> > > > > >    I've been messing around with the twitter library for python from
> > > > > > the command line. Is it possible to use this in web2py? It has a 
> > > > > > JSON
> > > > > > library dependency.
>
> > > > > >   Also, if i have it in web2py how do i 'install' it? from the 
> > > > > > command
> > > > > > line, i know to just do;
>
> > > > > >   python setup.py install
>
> > > > > >   But how do i go about installing libraries into web2py so I can
> > > > > > access them the same way:
>
> > > > > >   import twitter
>
> > > > > >   def tweet():
>
> > > > > >       client = twitter.Api(username='test', password='test')
> > > > > >       update = client.PostUpdate('hello from python!')
>
> > > > > > etc...
>
> > > > > > thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~--~~~~--~~--~--~---



[web2py:20324] new alterego entry

2009-04-22 Thread mdipierro

http://www.web2py.com/AlterEgo/default/show/217

feel free to correct any spelling/english error is you have the code.

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



[web2py:20325] Bug in admin/default/design

2009-04-22 Thread Álvaro Justen [Turicas]

Hello,
if I have:

{{extend "template.html"}}

instead of

{{extend 'template.html'}}

in myview.html, admin 'design' page of app show some buggy
information, like this:

# myview.html [ edit | htmledit | delete ] extends template.html"}}
http://www.peta5.com.br/

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



[web2py:20326] Re: Bug in admin/default/design

2009-04-22 Thread Álvaro Justen [Turicas]

On Thu, Apr 23, 2009 at 1:42 AM, Álvaro Justen [Turicas]
 wrote:
> Hello,
> if I have:
>
> {{extend "template.html"}}
>
> instead of
>
> {{extend 'template.html'}}
>
> in myview.html, admin 'design' page of app show some buggy
> information, like this:
>
> # myview.html [ edit | htmledit | delete ] extends template.html"}}
>  'mystr', '''mystr''' and """mystr""".

Thiss bug is in line 29 of gluon/myregx.py:

re.compile('^\s*(?P\{\{\s*extend\s+[\'"](?P[^\']+)[\'"]\s*\}\})'

It can be fixed with:

re.compile('^\s*(?P\{\{\s*extend\s+[\'"](?P[^\'"]+)[\'"]\s*\}\})'

"include" statement has the same bug, line 25:

re.compile('(?P\{\{\s*include\s+[\'"](?P[^\']*)[\'"]\s*\}\})'

To fix, change to:

re.compile('(?P\{\{\s*include\s+[\'"](?P[^\'"]*)[\'"]\s*\}\})'

This don't add support to """mystr""" and '''mystr'''.

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

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



[web2py:20327] Overriding default field validators

2009-04-22 Thread Joe Barnhart

I have a special application that holds the results of swimming
matches.  I store all times as floating-point "seconds" internally,
but I want to permit users to enter times as either a formatted string
(mm:ss.hh) or an integer (mmsshh).

I created my own custom validator which can take either input and
renders the result to the database as a float.  It also formats the
presentation to show the times as mm:ss.hh as the preferred output
format.  So far, so good...

Now the problem.  The underlying field is a 'double' which resolves to
a float on Sqllite.  The built-in field validator for FLOAT is still
active, so it prevents anyone from entering ":" characters.  Is there
no easy way to completely replace the default field validator?  This
will limit my use of the custom validation feature, I fear.

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



[web2py:20328] Re: new alterego entry

2009-04-22 Thread Álvaro Justen [Turicas]

On Thu, Apr 23, 2009 at 1:32 AM, mdipierro  wrote:
>
> http://www.web2py.com/AlterEgo/default/show/217
>
> feel free to correct any spelling/english error is you have the code.

Thanks.

I've found an AlterEgo bug:
Text that you wrote: "Here item and items are not keywords. There are
been defined here. TAG.name(...) is the same as TAG['name'](...) and
it corresponds to "

"TAG['name'](...)" is showed as "TAG'name'(...)" where "'name'" is a
link to '...'. I don't know how to fix it changing text - maybe we
have to change wiki render code.

Is AlterEgo code avaible to download?

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

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



[web2py:20329] Re: Using external libraries?

2009-04-22 Thread Iceberg

Just some thought. Is it a good idea that if web2py can automatically
do this BEFORE accessing an app?

old_syspath=sys.path
sys.path.append(os.path.abspath('applications/%s/
modules'%request.application))
try:
  serve_currect_request()
finally: sys.path=old_syspath # So that different app won't mess up
their own modules

In this way, hopefully app can call third party modules in the usual,
simple, straightforward way, like this:

  import mylib  # rather than: import applications.myapp.modules.mylib

On Apr23, 11:19am, mdipierro  wrote:
> probably
>
>   import applications.myapp.modules.modulefolder.twitter as twitter
>
> or better
>
>   exec('import applications.%s.modules.modulefolder.twitter as
> twitter' % request.application)
>
> Massimo
>
> On 22 Apr, 22:03, Michael  wrote:
>
> > This makes sense, but do i put the whole folder inside of modules?
>
> > would i access the library by saying
>
> > import applications.myapp.modules.modulefolder
>
> > or
>
> > import applications.myapp.modules.modulefolder.twitter.py
>
> > thanks! sorry for being such a newb ;P
>
> > On Apr 22, 10:02 pm, Iceberg  wrote:
>
> > > I don't know mac, but when using Windows binary (the web2py_win.zip),
> > > I can always put 3rd party libraries into web2py/applications/myapp/
> > > modules, then access it, in a slightly different way:
>
> > >   import applications.myapp.modules.third_parti_lib
>

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



[web2py:20330] Re: Overriding default field validators

2009-04-22 Thread Álvaro Justen [Turicas]

On Thu, Apr 23, 2009 at 2:11 AM, Joe  Barnhart  wrote:
> I have a special application that holds the results of swimming
> matches.  I store all times as floating-point "seconds" internally,
> but I want to permit users to enter times as either a formatted string
> (mm:ss.hh) or an integer (mmsshh).
>
> I created my own custom validator which can take either input and
> renders the result to the database as a float.  It also formats the
> presentation to show the times as mm:ss.hh as the preferred output
> format.  So far, so good...
>
> Now the problem.  The underlying field is a 'double' which resolves to
> a float on Sqllite.  The built-in field validator for FLOAT is still
> active, so it prevents anyone from entering ":" characters.  Is there
> no easy way to completely replace the default field validator?  This
> will limit my use of the custom validation feature, I fear.

Default validators are in definition of function sqlhtml_validators,
in gluon/sql.py but I think it is not "normal" to a validator don't be
rewrited. Can you show your models and new validator code?

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

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



[web2py:20331] Integrated Development Environment with web2py

2009-04-22 Thread Speedbird

Folks,

Just wanted to share with the community a real jewel, many of you knew
this but I actually started using it "heavily" during the past couple
of weeks: the IDE is wing from wingware, basically you run web2py from
inside of it, then just open your controller/module/model from the
IDE, set up a breakpoint and voila you have a very interesting
development "studio" ala visual studio.

I've added a screenshot of my desktop running the IDE with my current
pet, pyforum.org being "debugged", the screenshot can be found here:
http://www.julioflores.com/static/debug_web2py.png

Wing IDE is not free, BUT you can get a developer's license (which
will give you the latest "Pro" release bona-fide). you have no idea
how much less time I've spent debugging the code with a tool like this
one, long live web2py

PS - Here's the web2py-specific information on their page, whoever
wrote it must've had a good understanding of the web2py framework (was
it you massimo??) - http://www.wingware.com/doc/howtos/web2py

Best regards to all,

Julio


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



  1   2   >