[web2py:32455] Re: Newbie Question: Storing things in the the Session

2009-10-07 Thread portly.shor...@googlemail.com

Hi

yet again - many thanks for this. I now realise the difference in the
queries (that [0]).

Ah well, I'm learning Web2Py slowly but surely.

I must say that I'm very impressed with the prompt response
(especially for what is probably a very basic question).

Keep up the good work

cheers

Portly

On Oct 7, 11:26 pm, mdipierro  wrote:
> I suggest
>
> worksheets = db(db.worksheet.id == request.args(0)).select().as_list()
> fred=worksheets[0]
>
> now both can go in a session
>
> On Oct 7, 4:25 pm, "portly.shor...@googlemail.com"
>
>
>
>  wrote:
> > Sure:
>
> >  worksheet = db(db.worksheet.id == request.args(0)).select()[0]
> >  fred =  worksheet.as_list()
>
> > Worksheet returns a single row - hope this helps. I'm really keen to
> > use Web2Py.
>
> > cheers
>
> > On Oct 7, 10:20 pm, mdipierro  wrote:
>
> > > Can you show us the code?
>
> > > On Oct 7, 3:58 pm, "portly.shor...@googlemail.com"
>
> > >  wrote:
> > > > Many thanks for such a quick answer. A second question (if I may). I
> > > > have a second query that returns a single row - how would I store that
> > > > in the session as trying as_list gives me an error:
>
> > > > KeyError: 'as_list'.
>
> > > > many thanks (again).
>
> > > > p.s I've bought the PDF of the second version of the book but could
> > > > not find it in there.
>
> > > > cheers
>
> > > > Portly
>
> > > > On Oct 7, 7:42 pm, mdipierro  wrote:
>
> > > > > if
>
> > > > > rows=db().select(...)
>
> > > > > you cannot store rows in a session because it includes an open db
> > > > > connection.
> > > > > You can store
>
> > > > > rows.as_list()
>
> > > > > On Oct 7, 1:35 pm, "portly.shor...@googlemail.com"
>
> > > > >  wrote:
> > > > > > Hi - I am new to Web2py and think it is great but I'm stuck. Is 
> > > > > > there
> > > > > > a limit on what i can store in the Session? I want to store the the
> > > > > > results of a sql query (returning 40 records) in the session. When I
> > > > > > try I get an exception:
>
> > > > > > Traceback (most recent call last):
> > > > > >   File "gluon/main.py", line 419, in wsgibase
> > > > > >   File "gluon/globals.py", line 368, in _try_store_on_disk
> > > > > >   File "copy_reg.pyc", line 73, in _reduce_ex
> > > > > >   File "gluon/sql.py", line 537, in __getattr__
> > > > > > KeyError: '__getstate__'
>
> > > > > > any ideas?
>
> > > > > > many thanks
>
> > > > > > Portly
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32454] sqlform using already existing tables...

2009-10-07 Thread Arvind

Hello,

I have already defined tables in a database.
I need to generate forms using sql form
in my code

db = DAL('sqlite://db.db')

db.define_table('logina',
Field
('uname',requires=IS_NOT_EMPTY()),
 )
It complains duplicate field uname.

If I create a new db, then it works fine by creating a database and a
table with that field. At this point, I can see that it makes a  file
in the database directory with that field description.

How can i use an already existing table ? I dont want to define a
table. just reuse the table.

thanks
Arvind
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32453] jobs

2009-10-07 Thread mdipierro

http://www.devbistro.com/jobs/96952
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32452] Re: lots of stuff in trunk.

2009-10-07 Thread mdipierro

and which python version.

usually
>>> a=8L
>>> print str(a)
8
>>> print repr(a)
8L

but there is no repr in DAL anymore.
strange

On Oct 7, 11:45 pm, "mr.freeze"  wrote:
> I updated and get this MySQL error on an inner join:
> OperationalError: (1054, "Unknown column '8L' in 'where clause'")
>
> request.args(0) is 8.  If I change request.args(0) to 1, the error
> changes to:
> OperationalError: (1054, "Unknown column '1L' in 'where clause'")
>
> ...and so on. Hope that makes sense. Using sqlite seems to work.
>
> On Oct 7, 10:10 pm, mdipierro  wrote:
>
> > There is lots of new stuff in trunk, in particular in sql.py.
>
> > Chris Clark added Ingres support and Denes added support for legacy
> > databases.
>
> > While we test the new stuff please check that nothing breaks your
> > code.
>
> > Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32451] Re: Internal Error in Administrative Interface

2009-10-07 Thread mdipierro

Can you try delete everything and download it again from

http://web2py.com/examples/default/download

Massimo

On Oct 7, 11:50 pm, Sujan Shakya  wrote:
> Ya, I downloaded many times, but still can't get it working.
> Btw, 2 weeks before when i checked out the svn, it was working, but
> later when i updated the svn, admin page showed the Internal Error.
>
> And also 1 more problem I m having is, Opera shows the welcome page in
> other foreign language, but in case of firefox, its english.
>
> On Oct 7, 7:11 pm, mdipierro  wrote:
>
>
>
> > I cannot reproduce this. Can you please download it again?
>
> > On Oct 7, 3:34 am, Sujan Shakya  wrote:
>
> > > I just checked out the web2py source from code.google.com.
> > > Then I ran 'python web2py.py -a mypassword'
> > > Then I visitedhttp://127.0.0.1:8000/. This shows the welcome page.
> > > But when I clicked on 'click here for the administrative interface'
> > > link, I got 'Internal Error Ticket Issued' page. Clicking on the
> > > ticket link opened another 'Internal Error' page.
>
> > > Am I missing something ?
>
> > > Thanks
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32450] Re: lots of stuff in trunk.

2009-10-07 Thread mdipierro

Can you show me the controller action?

Massimo

On Oct 7, 11:45 pm, "mr.freeze"  wrote:
> I updated and get this MySQL error on an inner join:
> OperationalError: (1054, "Unknown column '8L' in 'where clause'")
>
> request.args(0) is 8.  If I change request.args(0) to 1, the error
> changes to:
> OperationalError: (1054, "Unknown column '1L' in 'where clause'")
>
> ...and so on. Hope that makes sense. Using sqlite seems to work.
>
> On Oct 7, 10:10 pm, mdipierro  wrote:
>
> > There is lots of new stuff in trunk, in particular in sql.py.
>
> > Chris Clark added Ingres support and Denes added support for legacy
> > databases.
>
> > While we test the new stuff please check that nothing breaks your
> > code.
>
> > Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32449] Re: Internal Error in Administrative Interface

2009-10-07 Thread Sujan Shakya

Ya, I downloaded many times, but still can't get it working.
Btw, 2 weeks before when i checked out the svn, it was working, but
later when i updated the svn, admin page showed the Internal Error.

And also 1 more problem I m having is, Opera shows the welcome page in
other foreign language, but in case of firefox, its english.


On Oct 7, 7:11 pm, mdipierro  wrote:
> I cannot reproduce this. Can you please download it again?
>
> On Oct 7, 3:34 am, Sujan Shakya  wrote:
>
>
>
> > I just checked out the web2py source from code.google.com.
> > Then I ran 'python web2py.py -a mypassword'
> > Then I visitedhttp://127.0.0.1:8000/. This shows the welcome page.
> > But when I clicked on 'click here for the administrative interface'
> > link, I got 'Internal Error Ticket Issued' page. Clicking on the
> > ticket link opened another 'Internal Error' page.
>
> > Am I missing something ?
>
> > Thanks

Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32448] Re: lots of stuff in trunk.

2009-10-07 Thread mr.freeze

I updated and get this MySQL error on an inner join:
OperationalError: (1054, "Unknown column '8L' in 'where clause'")

request.args(0) is 8.  If I change request.args(0) to 1, the error
changes to:
OperationalError: (1054, "Unknown column '1L' in 'where clause'")

...and so on. Hope that makes sense. Using sqlite seems to work.

On Oct 7, 10:10 pm, mdipierro  wrote:
> There is lots of new stuff in trunk, in particular in sql.py.
>
> Chris Clark added Ingres support and Denes added support for legacy
> databases.
>
> While we test the new stuff please check that nothing breaks your
> code.
>
> Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32447] Re: lots of stuff in trunk.

2009-10-07 Thread Jason (spot) Brower

Exciting.  Thanks.

On Thu, Oct 8, 2009 at 6:10 AM, mdipierro  wrote:
>
> There is lots of new stuff in trunk, in particular in sql.py.
>
> Chris Clark added Ingres support and Denes added support for legacy
> databases.
>
> While we test the new stuff please check that nothing breaks your
> code.
>
> Massimo
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32446] lots of stuff in trunk.

2009-10-07 Thread mdipierro

There is lots of new stuff in trunk, in particular in sql.py.

Chris Clark added Ingres support and Denes added support for legacy
databases.

While we test the new stuff please check that nothing breaks your
code.

Massimo
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32445] Re: web2py wiki

2009-10-07 Thread Álvaro Justen [Turicas]

On Wed, Oct 7, 2009 at 22:15, John Heenan  wrote:
>
> On Oct 8, 1:15 am, Álvaro Justen [Turicas] 
> wrote:
>> Please use:http://wiki.web2py.com/
>> (instead ofhttp://www.web2py.com/wiki- it actually will redirect to
>> former URL)
>>
>  Great work.
>
> Just a small suggestion to remain in line with current wiki practices
> that would make potential adopters less nervous.
>
> There are good sound practical reasons to to make the wiki appear to
> live off a directory that is part of the URL. For example
> http://wiki.web2py.com/wiki. I know it looks ugly and redundant but it
> is sound.
>
> http://wiki.web2py.com could be made to redirect to 
> http://wiki.web2py.com/wiki
>
> This is from http://www.mediawiki.org/wiki/Manual:Short_URL
>
>    http://example.com/wiki/Page_title (this is the standard, same as
> in Wikipedia)
>    http://wiki.example.com/Page_title (not recommended!)

Hi John,
for now, it'll be too dificult to adopt this URI schema since we have
wiki hosted in different server than site.
In a near future we'll have only one server to host all web2py-related
apps so we can change URIs.
Yeh, cool URIs don't change...and I know that wiki.web2py.com isn't a
cool URI - so it'll change. :-)
But you can rest assured that I will place the redirecting "HTTP Moved
Permanently" when do it.

Thanks for that.

-- 
 Á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-users" 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:32444] Re: web2py wiki

2009-10-07 Thread John Heenan

On Oct 8, 1:15 am, Álvaro Justen [Turicas] 
wrote:
> Please use:http://wiki.web2py.com/
> (instead ofhttp://www.web2py.com/wiki- it actually will redirect to
> former URL)
>
 Great work.

Just a small suggestion to remain in line with current wiki practices
that would make potential adopters less nervous.

There are good sound practical reasons to to make the wiki appear to
live off a directory that is part of the URL. For example
http://wiki.web2py.com/wiki. I know it looks ugly and redundant but it
is sound.

http://wiki.web2py.com could be made to redirect to http://wiki.web2py.com/wiki

This is from http://www.mediawiki.org/wiki/Manual:Short_URL

http://example.com/wiki/Page_title (this is the standard, same as
in Wikipedia)
http://wiki.example.com/Page_title (not recommended!)

John Heenan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32443] Re: [New] web2py wiki

2009-10-07 Thread Álvaro Justen [Turicas]

On Wed, Oct 7, 2009 at 18:51, Yarko Tymciurak  wrote:
> On Wed, Oct 7, 2009 at 4:48 PM, Yarko Tymciurak  wrote:
>>
>> On Wed, Oct 7, 2009 at 4:20 PM, Tim Michelsen
>>  wrote:
>
> 
>>
>> However,  I have recently seen that Bruce Eckel is thinking about using
>> MoinMoin for contributions to Python Pattersn & Idioms
>
> I helped Bruce setup access lists in Moin, and I think this would be a nice
> concept for this / "our" wiki:
>
> ACL lists held in a page, so that people can be added by  people with
> permissions - in Moin, I setup a Admin ACL, and a "CONTRIBUTOR" ACL  (admins
> can edit either; contributors can edit pages / chpaters - a way to assign
> sections for at least places where you want to generate a Sphinx doc - html
> or LaTeX).
>
> Just some thoughts...

Yes, I'm thinking in implementing ACLs.
I like the way dokuwiki[1] gives with that.
It'll be nice to generate LaTeX. :-)




On Wed, Oct 7, 2009 at 19:26, Tim Michelsen  wrote:
>
>> However,  I have recently seen that Bruce Eckel is thinking about using
>> MoinMoin for contributions to Python Pattersn & Idioms (people seemed ot
>> have a hard time ??? with editing Sphinx - though I can't imagine why -
> I think we have to distiguish:
> Books and documentations.
> docs are part of the code in soem way. should be easy, short,
> straightforward. should be included in the VCS.
>
>> it's the simplest basic thing to me), and I thought about how - with
>> cron - that a web2py reST blog would be a nicer solution (since Sphinx
>> generation / "publishing" could be done w/ cron).
> Yes, if Alvaro would create a Sphinx sandbox on his box we could even
> use web2py to edit the Sphinx doc and the docstrings online.
> like the numpy community.

Do you have interest on implementing this feature? It is free
software! :-) We could work together on this.

[1] http://www.dokuwiki.org/dokuwiki

-- 
 Á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-users" 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:32442] Re: [New] web2py wiki

2009-10-07 Thread Álvaro Justen [Turicas]

On Wed, Oct 7, 2009 at 18:20, Tim Michelsen  wrote:
> Hi Alvaro,
> if you need help with the sphinxification send me a mail.
> My current web2py project got stalled somehow. Therefore, please send me
> a direct mail if you have special questions to documentation. I am not
> readying this list every day.
> Yarko wanted to add some docstring specs, but he hasn't made it so far.
> The Sphinx-Project got stalled due to some bug/problem in the API doc
> generation.
> I will try to trace it with the Sphinx project.

Ok, thanks.


>> Future plans:
>> - Move AlterEgo pages to wiki and create a "FAQ" page in wiki with a
>> list - please don't do it manually, I'll do a script to do this job
>> (probably next weekend);
> It's there already.
> Here:
> http://bazaar.launchpad.net/~timmie/web2py/web2py-appdocu/annotate/head%3A/doc/convert_faq.py
> Ask Massimo to send you a recent dump of the AlterEgo

Nice, thank you!


On Wed, Oct 7, 2009 at 18:22, Tim Michelsen  wrote:
>
> Error when registering:
>
> http://wiki.web2py.com/_user/_register
>
> => 404 NOT FOUND

Only the link on login page was incorrect, I fixed it, 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-users" 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:32441] Re: URLs in static files

2009-10-07 Thread Jonathan Lundell

On Oct 7, 2009, at 11:49 AM, mdipierro wrote:

>
> Yes, this should be done in main using using gluon/contenttype after
> creating the Response object. I would take a patch for this.

Here's my cut at a patch to return proper headers for css files. This  
does not address Eric's desire for a single controller solution for  
CSS files, which is a different issue, but it does eliminate the need  
for the __cssheaders() function.

http://lobitos.net/web2py-patches/gluon/contenttype.py
http://lobitos.net/web2py-patches/gluon/main.py


>
> Massimo
>
> On Oct 7, 10:56 am, Jonathan Lundell  wrote:
>> On Oct 7, 2009, at 8:44 AM, Julio wrote:
>>
>>
>>
>>> This is good, specially if on your website you implement some sort  
>>> of
>>> "skinning" allowing the users to dynamically switch "layouts" using
>>> the same css file, thanks for sharing this.
>>
>> You're welcome.
>>
>> I think it's a generally useful capability, and I hope that there's a
>> more elegant way of incorporating it into web2py. As I was saying
>> somewhere else, a generic.css file doesn't really work (unless you're
>> generating all your CSS content in controllers). At the very least,
>> perhaps the logic (where?) that creates the default html headers  
>> could
>> recognize that it's got a .css file and create css headers instead.
>>
>>
>>
>>> On Oct 7, 8:19 am, Jonathan Lundell  wrote:
 On Oct 6, 2009, at 2:54 PM, Eric Vicenti wrote:
>>
> Thanks, mdi and Jonathan. I will borrow your __cssheaders()
> function,
> if you don't mind.
>>
 I should have commented it a bit first, but it's not all that  
 subtle.
>>
 By the time the controller runs, the response has been set up as a
 standard html page. So we delete cookies and the default caching,  
 and
 use Expires caching (an hour as shown) so that, in theory anyway (I
 haven't tested this against browsers yet) the performance should be
 fairly close to static.
>>
 When I'm actually working on the CSS, I reduce the Expires  
 timeout to
 3 seconds (or whatever you like) so that my changes appear  
 promptly.
>>
 Here's a slightly cleaner version:
>>
 def __cssheaders():
  '''
  edit default response headers for CSS
  serve text/css with no cookies, limited caching
  '''
  response.cookies = Storage()  # no cookies
  for header in ('Last-Modified', 'Expires', 'Pragma'):
 if header in response.headers: del response.headers[header]
  response.headers['Content-Type']='text/css'
  response.headers['Cache-Control'] = 'max-age=3600, must-
 revalidate'
  response.headers['Cache-Control'] = 'max-age=3, must- 
 revalidate'
>>
> Is there any way to have some code in the css.py controller which
> will
> automatically define functions for all my css files in /views/ 
> css/ ?
> All it would need to do is run the __cssheaders() function and
> return
> dict(), but it feels unnecessary to maintain a list of functions
> when
> there are files.
>>
> -Eric
>>
> On Oct 6, 2:29 pm, Jonathan Lundell  wrote:
>> On Oct 6, 2009, at 1:35 PM, mdipierro wrote:
>>
>>> It is good practice to put in the CSS only relative urls to  
>>> other
>>> static files. That is not a problem with web2py.
>>
>>> If you need to include in the CSS urls generated by {{=URL 
>>> ()}}
>>> then you should promote the css from a static file to a dynamic
>>> page:
>>> 1) make a controller for it
>>> 2) make a view ending in .css
>>> 3) call the action from the layout ending in .css
>>> 4) in the .css view use absolute paths to include images
>>
>> When I tried serving dynamic CSS (I wanted to dynamically control
>> colors, fonts, etc), I had to do some work to get the result  
>> served
>> as
>> text/css (which is necessary). I ended up hacking that (and some
>> other
>> header stuff, like caching) in the controller, but I suppose it
>> could
>> happen in the view.
>>
>> I notice that there's no generic.css.
>>
>> I have a controller, css.py, that looks like this:
>>
>> import time
>> from gluon.storage import Storage
>>
>> def __cssheaders():
>>  '''
>>  edit default response headers for CSS
>>  serve text/css with limited caching
>>  '''
>>  response.cookies = Storage()
>>  response.headers['Content-Type']='text/css'
>>  response.headers['Cache-Control'] = 'max-age=3600, must-
>> revalidate'
>>  if 'Last-Modified' in response.headers: del response.headers
>> ['Last-Modified']
>>  if 'Expires' in response.headers: del response.headers
>> ['Expires']
>>  if 'Pragma' in response.headers: del response.headers
>> ['Pragma']
>>
>> def xxx():
>>  '''
>>  app/css/xxx.css
>>  set fonts and colors to be substituted via xxx.cs

[web2py:32440] Re: advice on the routes py and database queries.

2009-10-07 Thread Richard

is that the proper way to do it, having a separate controller for each
operation? The routes approach sounds more flexible.
Richard


On Oct 7, 12:23 pm, Mengu  wrote:
> massimo,
>
> actually this wasn't what i am asking, but thank you for showing
> another way for it. i have my controller named as "post" and i have
> the action "view". i currently have my routes_in like the 
> following:http://mengu.pastebin.com/m698f1726this is working very well however
> please let me know if this is not necessary or a proper way.
>
> any recommendations on the query?http://mengu.pastebin.com/m111e1a47
> i could make something like:
> posts = db().select(db.posts.ALL)
> postcategories = {}
> for post in posts:
>     postcategories[post.id] = {}
>     for relation in post.relations.select():
>         category = db.categories[relation.category]
>         postcategories[post.id][category.id] = category.title
>
> however this makes tons of queries for each post which is something i
> really don't want.
>
> 
>
> dear alvaro,
>
> i ofcourse would like to produce the software with you, i'd enjoy
> that. however i currently have my time very lack so i'm not working on
> the product all the time.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32438] Re: [New] web2py wiki

2009-10-07 Thread Yarko Tymciurak
On Wed, Oct 7, 2009 at 5:26 PM, Tim Michelsen
wrote:

>
> > However,  I have recently seen that Bruce Eckel is thinking about using
> > MoinMoin for contributions to Python Pattersn & Idioms (people seemed ot
> > have a hard time ??? with editing Sphinx - though I can't imagine why -
> I think we have to distiguish:
> Books and documentations.
> docs are part of the code in soem way. should be easy, short,
> straightforward. should be included in the VCS.
>
> > it's the simplest basic thing to me), and I thought about how - with
> > cron - that a web2py reST blog would be a nicer solution (since Sphinx
> > generation / "publishing" could be done w/ cron).
> Yes, if Alvaro would create a Sphinx sandbox on his box we could even
> use web2py to edit the Sphinx doc and the docstrings online.
> like the numpy community.
>
> > Sphinx has bugs?  the web2py sphinx has problems?  Not sure what you are
> > saying here.
> http://bitbucket.org/birkenfeld/sphinx/issue/217/autogen-aborts
> This happened whith web2py docstrings.
>
>
Thanks for the clarification, Tim!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32437] Re: [New] web2py wiki

2009-10-07 Thread Tim Michelsen

> However,  I have recently seen that Bruce Eckel is thinking about using 
> MoinMoin for contributions to Python Pattersn & Idioms (people seemed ot 
> have a hard time ??? with editing Sphinx - though I can't imagine why - 
I think we have to distiguish:
Books and documentations.
docs are part of the code in soem way. should be easy, short, 
straightforward. should be included in the VCS.

> it's the simplest basic thing to me), and I thought about how - with 
> cron - that a web2py reST blog would be a nicer solution (since Sphinx 
> generation / "publishing" could be done w/ cron).
Yes, if Alvaro would create a Sphinx sandbox on his box we could even 
use web2py to edit the Sphinx doc and the docstrings online.
like the numpy community.

> Sphinx has bugs?  the web2py sphinx has problems?  Not sure what you are 
> saying here.
http://bitbucket.org/birkenfeld/sphinx/issue/217/autogen-aborts
This happened whith web2py docstrings.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32436] Re: Newbie Question: Storing things in the the Session

2009-10-07 Thread mdipierro

I suggest

worksheets = db(db.worksheet.id == request.args(0)).select().as_list()
fred=worksheets[0]

now both can go in a session

On Oct 7, 4:25 pm, "portly.shor...@googlemail.com"
 wrote:
> Sure:
>
>  worksheet = db(db.worksheet.id == request.args(0)).select()[0]
>  fred =  worksheet.as_list()
>
> Worksheet returns a single row - hope this helps. I'm really keen to
> use Web2Py.
>
> cheers
>
> On Oct 7, 10:20 pm, mdipierro  wrote:
>
> > Can you show us the code?
>
> > On Oct 7, 3:58 pm, "portly.shor...@googlemail.com"
>
> >  wrote:
> > > Many thanks for such a quick answer. A second question (if I may). I
> > > have a second query that returns a single row - how would I store that
> > > in the session as trying as_list gives me an error:
>
> > > KeyError: 'as_list'.
>
> > > many thanks (again).
>
> > > p.s I've bought the PDF of the second version of the book but could
> > > not find it in there.
>
> > > cheers
>
> > > Portly
>
> > > On Oct 7, 7:42 pm, mdipierro  wrote:
>
> > > > if
>
> > > > rows=db().select(...)
>
> > > > you cannot store rows in a session because it includes an open db
> > > > connection.
> > > > You can store
>
> > > > rows.as_list()
>
> > > > On Oct 7, 1:35 pm, "portly.shor...@googlemail.com"
>
> > > >  wrote:
> > > > > Hi - I am new to Web2py and think it is great but I'm stuck. Is there
> > > > > a limit on what i can store in the Session? I want to store the the
> > > > > results of a sql query (returning 40 records) in the session. When I
> > > > > try I get an exception:
>
> > > > > Traceback (most recent call last):
> > > > >   File "gluon/main.py", line 419, in wsgibase
> > > > >   File "gluon/globals.py", line 368, in _try_store_on_disk
> > > > >   File "copy_reg.pyc", line 73, in _reduce_ex
> > > > >   File "gluon/sql.py", line 537, in __getattr__
> > > > > KeyError: '__getstate__'
>
> > > > > any ideas?
>
> > > > > many thanks
>
> > > > > Portly
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32435] Re: [New] web2py wiki

2009-10-07 Thread Yarko Tymciurak
On Wed, Oct 7, 2009 at 4:48 PM, Yarko Tymciurak  wrote:

> On Wed, Oct 7, 2009 at 4:20 PM, Tim Michelsen  > wrote:
>


> However,  I have recently seen that Bruce Eckel is thinking about using
> MoinMoin for contributions to Python Pattersn & Idioms
>

I helped Bruce setup access lists in Moin, and I think this would be a nice
concept for this / "our" wiki:

ACL lists held in a page, so that people can be added by  people with
permissions - in Moin, I setup a Admin ACL, and a "CONTRIBUTOR" ACL  (admins
can edit either; contributors can edit pages / chpaters - a way to assign
sections for at least places where you want to generate a Sphinx doc - html
or LaTeX).

Just some thoughts...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32434] Re: [New] web2py wiki

2009-10-07 Thread Yarko Tymciurak
On Wed, Oct 7, 2009 at 4:20 PM, Tim Michelsen
wrote:

>
> Hi Alvaro,
> if you need help with the sphinxification send me a mail.
> My current web2py project got stalled somehow. Therefore, please send me
> a direct mail if you have special questions to documentation. I am not
> readying this list every day.
> Yarko wanted to add some docstring specs, but he hasn't made it so far.
>

That's correct - there was something I didn't like about how it was layed
out, and wanted it simpler - started changing things, then got layed off, so
just stopped thinking about it for the summer.
However,  I have recently seen that Bruce Eckel is thinking about using
MoinMoin for contributions to Python Pattersn & Idioms (people seemed ot
have a hard time ??? with editing Sphinx - though I can't imagine why - it's
the simplest basic thing to me), and I thought about how - with cron - that
a web2py reST blog would be a nicer solution (since Sphinx generation /
"publishing" could be done w/ cron).

In any case, one fundamental thing the blog would need is a "publish" state
for pages,  some way to "ignore" (at least) sphinx-specific markups, and a
way to generate a sphinx doc from a tree.


> The Sphinx-Project got stalled due to some bug/problem in the API doc
> generation.
> I will try to trace it with the Sphinx project.
>

Sphinx has bugs?  the web2py sphinx has problems?  Not sure what you are
saying here.

- Yarko


>
> > Future plans:
> > - Move AlterEgo pages to wiki and create a "FAQ" page in wiki with a
> > list - please don't do it manually, I'll do a script to do this job
> > (probably next weekend);
> It's there already.
> Here:
>
> http://bazaar.launchpad.net/~timmie/web2py/web2py-appdocu/annotate/head%3A/doc/convert_faq.py
> Ask Massimo to send you a recent dump of the AlterEgo
>
> Thanks for the efforts & regards,
> Timmie
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32433] Re: Why does this NOT pass validation? (bug?)

2009-10-07 Thread Thadeus Burgess
Awesome, thanks a bunch!

-Thadeus




On Wed, Oct 7, 2009 at 3:42 PM, mdipierro  wrote:

> tore integers. You can rep

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32432] Re: [New] web2py wiki

2009-10-07 Thread Tim Michelsen

Error when registering:

http://wiki.web2py.com/_user/_register

=> 404 NOT FOUND


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32431] Re: Newbie Question: Storing things in the the Session

2009-10-07 Thread portly.shor...@googlemail.com

Sure:

 worksheet = db(db.worksheet.id == request.args(0)).select()[0]
 fred =  worksheet.as_list()

Worksheet returns a single row - hope this helps. I'm really keen to
use Web2Py.

cheers


On Oct 7, 10:20 pm, mdipierro  wrote:
> Can you show us the code?
>
> On Oct 7, 3:58 pm, "portly.shor...@googlemail.com"
>
>
>
>  wrote:
> > Many thanks for such a quick answer. A second question (if I may). I
> > have a second query that returns a single row - how would I store that
> > in the session as trying as_list gives me an error:
>
> > KeyError: 'as_list'.
>
> > many thanks (again).
>
> > p.s I've bought the PDF of the second version of the book but could
> > not find it in there.
>
> > cheers
>
> > Portly
>
> > On Oct 7, 7:42 pm, mdipierro  wrote:
>
> > > if
>
> > > rows=db().select(...)
>
> > > you cannot store rows in a session because it includes an open db
> > > connection.
> > > You can store
>
> > > rows.as_list()
>
> > > On Oct 7, 1:35 pm, "portly.shor...@googlemail.com"
>
> > >  wrote:
> > > > Hi - I am new to Web2py and think it is great but I'm stuck. Is there
> > > > a limit on what i can store in the Session? I want to store the the
> > > > results of a sql query (returning 40 records) in the session. When I
> > > > try I get an exception:
>
> > > > Traceback (most recent call last):
> > > >   File "gluon/main.py", line 419, in wsgibase
> > > >   File "gluon/globals.py", line 368, in _try_store_on_disk
> > > >   File "copy_reg.pyc", line 73, in _reduce_ex
> > > >   File "gluon/sql.py", line 537, in __getattr__
> > > > KeyError: '__getstate__'
>
> > > > any ideas?
>
> > > > many thanks
>
> > > > Portly
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32430] Re: [New] web2py wiki

2009-10-07 Thread Tim Michelsen

comment on page:
http://wiki.web2py.com/Documentation_HOWTO

the primer at:
http://sphinx.pocoo.org/latest/rest.html

is much better to get you started with ReST


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32429] Re: OpenShare (first opensource ad service built on web2py) just went opensource!

2009-10-07 Thread JorgeR

Cool
;)

On Oct 7, 7:55 am, Jon Romero  wrote:
> I've just release OpenShare on bitbucket. You can see it running (and
> submit your opensource projects) here:http://openshare.emotionull.com
>
> http://bitbucket.org/jonromero/openshare/
>
> Enjoy!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32428] Re: Newbie Question: Storing things in the the Session

2009-10-07 Thread mdipierro

Can you show us the code?


On Oct 7, 3:58 pm, "portly.shor...@googlemail.com"
 wrote:
> Many thanks for such a quick answer. A second question (if I may). I
> have a second query that returns a single row - how would I store that
> in the session as trying as_list gives me an error:
>
> KeyError: 'as_list'.
>
> many thanks (again).
>
> p.s I've bought the PDF of the second version of the book but could
> not find it in there.
>
> cheers
>
> Portly
>
> On Oct 7, 7:42 pm, mdipierro  wrote:
>
> > if
>
> > rows=db().select(...)
>
> > you cannot store rows in a session because it includes an open db
> > connection.
> > You can store
>
> > rows.as_list()
>
> > On Oct 7, 1:35 pm, "portly.shor...@googlemail.com"
>
> >  wrote:
> > > Hi - I am new to Web2py and think it is great but I'm stuck. Is there
> > > a limit on what i can store in the Session? I want to store the the
> > > results of a sql query (returning 40 records) in the session. When I
> > > try I get an exception:
>
> > > Traceback (most recent call last):
> > >   File "gluon/main.py", line 419, in wsgibase
> > >   File "gluon/globals.py", line 368, in _try_store_on_disk
> > >   File "copy_reg.pyc", line 73, in _reduce_ex
> > >   File "gluon/sql.py", line 537, in __getattr__
> > > KeyError: '__getstate__'
>
> > > any ideas?
>
> > > many thanks
>
> > > Portly
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32427] Re: [New] web2py wiki

2009-10-07 Thread Tim Michelsen

Hi Alvaro,
if you need help with the sphinxification send me a mail.
My current web2py project got stalled somehow. Therefore, please send me 
a direct mail if you have special questions to documentation. I am not 
readying this list every day.
Yarko wanted to add some docstring specs, but he hasn't made it so far.
The Sphinx-Project got stalled due to some bug/problem in the API doc 
generation.
I will try to trace it with the Sphinx project.

> Future plans:
> - Move AlterEgo pages to wiki and create a "FAQ" page in wiki with a
> list - please don't do it manually, I'll do a script to do this job
> (probably next weekend);
It's there already.
Here:
http://bazaar.launchpad.net/~timmie/web2py/web2py-appdocu/annotate/head%3A/doc/convert_faq.py
Ask Massimo to send you a recent dump of the AlterEgo

Thanks for the efforts & regards,
Timmie


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32426] Re: Newbie Question: Storing things in the the Session

2009-10-07 Thread portly.shor...@googlemail.com



On Oct 7, 9:58 pm, "portly.shor...@googlemail.com"
 wrote:
> Many thanks for such a quick answer. A second question (if I may). I
> have a second query that returns a single row - how would I store that
> in the session as trying as_list gives me an error:
>
> KeyError: 'as_list'.
>
> many thanks (again).
>
> p.s I've bought the PDF of the second version of the book but could
> not find it in there.
>
> cheers
>
> Portly
>
> On Oct 7, 7:42 pm, mdipierro  wrote:
>
>
>
> > if
>
> > rows=db().select(...)
>
> > you cannot store rows in a session because it includes an open db
> > connection.
> > You can store
>
> > rows.as_list()
>
> > On Oct 7, 1:35 pm, "portly.shor...@googlemail.com"
>
> >  wrote:
> > > Hi - I am new to Web2py and think it is great but I'm stuck. Is there
> > > a limit on what i can store in the Session? I want to store the the
> > > results of a sql query (returning 40 records) in the session. When I
> > > try I get an exception:
>
> > > Traceback (most recent call last):
> > >   File "gluon/main.py", line 419, in wsgibase
> > >   File "gluon/globals.py", line 368, in _try_store_on_disk
> > >   File "copy_reg.pyc", line 73, in _reduce_ex
> > >   File "gluon/sql.py", line 537, in __getattr__
> > > KeyError: '__getstate__'
>
> > > any ideas?
>
> > > many thanks
>
> > > Portly
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32425] Re: Newbie Question: Storing things in the the Session

2009-10-07 Thread portly.shor...@googlemail.com

Many thanks for such a quick answer. A second question (if I may). I
have a second query that returns a single row - how would I store that
in the session as trying as_list gives me an error:

KeyError: 'as_list'.

many thanks (again).

p.s I've bought the PDF of the second version of the book but could
not find it in there.

cheers

Portly

On Oct 7, 7:42 pm, mdipierro  wrote:
> if
>
> rows=db().select(...)
>
> you cannot store rows in a session because it includes an open db
> connection.
> You can store
>
> rows.as_list()
>
> On Oct 7, 1:35 pm, "portly.shor...@googlemail.com"
>
>
>
>  wrote:
> > Hi - I am new to Web2py and think it is great but I'm stuck. Is there
> > a limit on what i can store in the Session? I want to store the the
> > results of a sql query (returning 40 records) in the session. When I
> > try I get an exception:
>
> > Traceback (most recent call last):
> >   File "gluon/main.py", line 419, in wsgibase
> >   File "gluon/globals.py", line 368, in _try_store_on_disk
> >   File "copy_reg.pyc", line 73, in _reduce_ex
> >   File "gluon/sql.py", line 537, in __getattr__
> > KeyError: '__getstate__'
>
> > any ideas?
>
> > many thanks
>
> > Portly
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32424] Re: Why does this NOT pass validation? (bug?)

2009-10-07 Thread mdipierro

correct. multiple is intended to be used for reference fields that
store integers. You can replace:

IS_IN_SET(('Glasses', 'Soft Contacts','Hard Contacts', 'Other',
'None'))

with

IS_IN_SET(range(4),('Glasses', 'Soft Contacts','Hard Contacts',
'Other'))

None should not be an option becase you can select none of the items.

On Oct 7, 3:15 pm, Thadeus Burgess  wrote:
> It seems as if there is a space in the text, then it will not pass
> validation if one of the options with a space is selected.
>
> def test():
>     form = SQLFORM.factory(
>             Field('field', requires=IS_IN_SET(('Glasses', 'Soft Contacts',
> 'Hard Contacts', 'Other', 'None'), multiple=True, error_message="Must be in
> set"))
>         )
>
>     if form.accepts(request.vars, session):
>         response.flash = "Accepted"
>     if form.errors:
>         response.flash = "Errors"
>
>     return dict(form=form)
>
> -Thadeus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32423] Re: form.custom.errors.field

2009-10-07 Thread mdipierro

Hi Thadeus,

we just need to talk about this more and get more opinions. I can be
convinced. The code you proposed does not show errors by default any
more.
That is a break of backward compatibility.

You also assume that people who do not want to display the default
errors would use one DIV for each error. Perhaps or perhaps not.

How about a new flag like

form.display_errors=True or False

and if false you can do {{=DIV(form.error.fieldname,_class='error')}}
in code?

Massimo

On Oct 7, 2:54 pm, Thadeus Burgess  wrote:
> But I do want to display errors... just not where web2py insists they
> display.
>
> And I think there is a solution here that will satisfy everybody, that kind
> of thinking is NOT good for the growth web2py!!!
>
> I am just not familiar enough with the base code, but I suppose I will get
> familiar with it to find this solution that will satisfy everybody.
>
> -Thadeus
>
> On Wed, Oct 7, 2009 at 1:47 PM, mdipierro  wrote:
>
> > I doubt there is a solution here that would satisfly everybody.
>
> > If you do now want to display errors automatically do
>
> >    form.errors.clear()
>
> > Massimo
>
> > On Oct 7, 12:13 pm, Thadeus Burgess  wrote:
> > > I am attempting to patch web2py to allow support for custom errors in
> > custom
> > > forms, so that the widgets to auto magically render the errors when using
> > > custom form.
>
> > > Desired functionality should behave such as
> > "{{=form.custom.errors.field}}"
> > > and would display "must contain a
> > > value!"
>
> > > The below patch provides this functionality, however, when using regular
> > > form, it will not render the error div.
>
> > > Perhaps there is a less intrusive method? Something that will still work
> > > with just calling {{=form}}
>
> > > I would think that the new errors DIV would need to be appended to the
> > > components of the SQLFORM?
>
> > > Could someone with more knowledge of the web2py innerworkings help me
> > with
> > > this?
>
> > > Index: gluon/html.py
> > > ===
> > > --- gluon/html.py    (revision 1258)
> > > +++ gluon/html.py    (working copy)
> > > @@ -1092,8 +1092,8 @@
> > >      def xml(self):
> > >          name = self.attributes.get('_name', None)
> > >          if name and hasattr(self, 'errors') and self.errors.get(name,
> > > None):
> > > -            return DIV.xml(self) + DIV(self.errors[name],
> > _class='error',
> > > -                errors=None, _id='%s__error' % name).xml()
> > > +            return DIV.xml(self) #+ DIV(self.errors[name],
> > _class='error',
> > > +              #  errors=None, _id='%s__error' % name).xml()
> > >          else:
> > >              return DIV.xml(self)
>
> > > Index: gluon/sqlhtml.py
> > > ===
> > > --- gluon/sqlhtml.py    (revision 1258)
> > > +++ gluon/sqlhtml.py    (working copy)
> > > @@ -756,6 +756,10 @@
> > >                      del self.errors[key]
> > >              if not self.errors:
> > >                  ret = True
> > > +
> > > +        self.custom.errors = Storage()
> > > +        for key, value in self.errors.items():
> > > +                self.custom.errors[key] = DIV(value, _class='error',
> > > errors=None, _id='%s__error' % key).xml()
>
> > >          requested_delete = \
> > >              request_vars.get(self.FIELDNAME_REQUEST_DELETE, False)
>
> > > -Thadeus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32422] Why does this NOT pass validation? (bug?)

2009-10-07 Thread Thadeus Burgess
It seems as if there is a space in the text, then it will not pass
validation if one of the options with a space is selected.

def test():
form = SQLFORM.factory(
Field('field', requires=IS_IN_SET(('Glasses', 'Soft Contacts',
'Hard Contacts', 'Other', 'None'), multiple=True, error_message="Must be in
set"))
)

if form.accepts(request.vars, session):
response.flash = "Accepted"
if form.errors:
response.flash = "Errors"

return dict(form=form)

-Thadeus

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32421] Re: FORM factory

2009-10-07 Thread Russell

Personally, I like the way the widget renders the error by default -
it's pretty tidy and does what you want most of the time.  If you want
to remove the error from the widget you could look at the section
called "Switch off errors" on page 220 of the manual.

On Oct 8, 5:03 am, Thadeus Burgess  wrote:
> Massimo, how hard would it be to implement
>
> form.custom.errors.field
>
> instead of having the widget render the error?
>
> -Thadeus
>
> On Wed, Oct 7, 2009 at 10:46 AM, Thadeus Burgess wrote:
>
> > I have to perform a nasty hack to get around the form.errors displaying on
> > each radio button!
>
> > Make sure to set error_message="". Now it won't display a divs for the
> > error.
>
> > Manually in my view,
>
> > {{if form.errors.has_key('field'):}}
> > You must enter a value into this field!
> > }}
> > {{=form.custom.widget.field}}
>
> > There has got to be an easier way?
>
> > -Thadeus
>
> > On Wed, Oct 7, 2009 at 7:22 AM, leone  wrote:
>
> >> I notice that if you don't match defined Field in SQLFORM.factory and
> >> {{=form...}} in html form.results is False but form.errors is empty.
> >> The length attribute of Field-string doesn't produce a desired width
> >> of input.  There is a different way to obtain the apprioate layout?
>
> >> On 6 Ott, 21:53, mdipierro  wrote:
> >> > Let us know when you find out.
>
> >> > Massimo
>
> >> > On Oct 6, 2:43 pm, leone  wrote:
>
> >> > > Acc.!!
> >> > > It works fine, but form.accets(request.vars) returns always False.
> >> > > I have a button type=submit with an image before {{=form.custom.end}}.
> >> > > I suppose this could be an error and Ihave substitute it with
> >> > > {{=form.custom.submit}} with no result.
> >> > > I have difficult to find solutions using your manual, but it is my
> >> > > problem.
>
> >> > > On 6 Ott, 19:58, mdipierro  wrote:
>
> >> > > > It is automatic. You just need
>
> >> > > > Field('name',requires=IS_IN_SET(('a','b','c')))
>
> >> > > > or requires IS_IN_DB
>
> >> > > > On Oct 6, 11:32 am, leone  wrote:
>
> >> > > > > How can I render a   sequence by Field in
> >> > > > > SQLFORM.factory?
> >> > > > > Thanks!
>
> >> > > > > On 6 Ott, 17:14, mdipierro  wrote:
>
> >> > > > > > yes
>
> >> > > > > > form=SQLFORM.factory(Field('x'),Field('y'))
>
> >> > > > > > 
> >> > > > > > ..
> >> > > > > >  {{=form.custom.begin}}
> >> > > > > >  {{=form.custom.widget.x}}
> >> > > > > >  {{=form.custom.widget.y}}
> >> > > > > >  {{=form.custom.submit}}
> >> > > > > >  {{=form.custom.end}}
> >> > > > > >   ..
> >> > > > > >  
>
> >> > > > > > On Oct 6, 9:51 am, leone  wrote:
>
> >> > > > > > > I want use FORM object and helpers objects, but I need
> >> complete
> >> > > > > > > control over html code.
> >> > > > > > > Exists a factory method as in SQLFORM, so I can code
> >> > > > > > > 
> >> > > > > > > ..
> >> > > > > > >  {{=form.begin}}
> >> > > > > > >  {{=form.widget.x}}
> >> > > > > > >  {{=form.widget.y}}
> >> > > > > > >  {{=form.submit}}
> >> > > > > > >  {{=form.end}}
> >> > > > > > >   ..
> >> > > > > > >  
> >> > > > > > > ???
> >> > > > > > > If not, exist an alternative way to obtain the advantages of
> >> web2py
> >> > > > > > > and html flexibility?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32420] Re: form.custom.errors.field

2009-10-07 Thread Thadeus Burgess
But I do want to display errors... just not where web2py insists they
display.

And I think there is a solution here that will satisfy everybody, that kind
of thinking is NOT good for the growth web2py!!!

I am just not familiar enough with the base code, but I suppose I will get
familiar with it to find this solution that will satisfy everybody.

-Thadeus




On Wed, Oct 7, 2009 at 1:47 PM, mdipierro  wrote:

>
> I doubt there is a solution here that would satisfly everybody.
>
> If you do now want to display errors automatically do
>
>form.errors.clear()
>
> Massimo
>
> On Oct 7, 12:13 pm, Thadeus Burgess  wrote:
> > I am attempting to patch web2py to allow support for custom errors in
> custom
> > forms, so that the widgets to auto magically render the errors when using
> > custom form.
> >
> > Desired functionality should behave such as
> "{{=form.custom.errors.field}}"
> > and would display "must contain a
> > value!"
> >
> > The below patch provides this functionality, however, when using regular
> > form, it will not render the error div.
> >
> > Perhaps there is a less intrusive method? Something that will still work
> > with just calling {{=form}}
> >
> > I would think that the new errors DIV would need to be appended to the
> > components of the SQLFORM?
> >
> > Could someone with more knowledge of the web2py innerworkings help me
> with
> > this?
> >
> > Index: gluon/html.py
> > ===
> > --- gluon/html.py(revision 1258)
> > +++ gluon/html.py(working copy)
> > @@ -1092,8 +1092,8 @@
> >  def xml(self):
> >  name = self.attributes.get('_name', None)
> >  if name and hasattr(self, 'errors') and self.errors.get(name,
> > None):
> > -return DIV.xml(self) + DIV(self.errors[name],
> _class='error',
> > -errors=None, _id='%s__error' % name).xml()
> > +return DIV.xml(self) #+ DIV(self.errors[name],
> _class='error',
> > +  #  errors=None, _id='%s__error' % name).xml()
> >  else:
> >  return DIV.xml(self)
> >
> > Index: gluon/sqlhtml.py
> > ===
> > --- gluon/sqlhtml.py(revision 1258)
> > +++ gluon/sqlhtml.py(working copy)
> > @@ -756,6 +756,10 @@
> >  del self.errors[key]
> >  if not self.errors:
> >  ret = True
> > +
> > +self.custom.errors = Storage()
> > +for key, value in self.errors.items():
> > +self.custom.errors[key] = DIV(value, _class='error',
> > errors=None, _id='%s__error' % key).xml()
> >
> >  requested_delete = \
> >  request_vars.get(self.FIELDNAME_REQUEST_DELETE, False)
> >
> > -Thadeus
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32419] Re: Mac Theme

2009-10-07 Thread mdipierro

Could you email it to me as a zip? I have problems with rar. sorry.

On Oct 7, 11:55 am, Alex Fanjul  wrote:
> Sorry, I forgot some skin files. This is new version v.1.1
> -I added some alternative fonts in css, in case you don't have "Century
> Gothic" font, (that is the original one for this page).
>
> alex f
>
> El 07/10/2009 18:48, Alex Fanjul escribió:
>
> > Here I'm sending you a Mac Theme for Web2py (its just a proof of
> > concept), just extract and sustitute all files in your application
> > "static" folder.
> > I hope you like it.
>
> > By the way Maximo, the original skin or theme (like the one im
> > sending) is not accesible due to the use of tables for web
> > structure... I think you knew that...but FYI.
> >http://www.w3.org/TR/WCAG10/#gl-table-markup
>
> > regards,
> > alex F
>
> --
> Alejandro Fanjul Fdez.
> alex.fan...@gmail.comwww.mhproject.org
>
>  mac_theme - v1.1.rar
> 14KViewDownload
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32418] Re: URLs in static files

2009-10-07 Thread mdipierro

Yes, this should be done in main using using gluon/contenttype after
creating the Response object. I would take a patch for this.

Massimo

On Oct 7, 10:56 am, Jonathan Lundell  wrote:
> On Oct 7, 2009, at 8:44 AM, Julio wrote:
>
>
>
> > This is good, specially if on your website you implement some sort of
> > "skinning" allowing the users to dynamically switch "layouts" using
> > the same css file, thanks for sharing this.
>
> You're welcome.
>
> I think it's a generally useful capability, and I hope that there's a  
> more elegant way of incorporating it into web2py. As I was saying  
> somewhere else, a generic.css file doesn't really work (unless you're  
> generating all your CSS content in controllers). At the very least,  
> perhaps the logic (where?) that creates the default html headers could  
> recognize that it's got a .css file and create css headers instead.
>
>
>
> > On Oct 7, 8:19 am, Jonathan Lundell  wrote:
> >> On Oct 6, 2009, at 2:54 PM, Eric Vicenti wrote:
>
> >>> Thanks, mdi and Jonathan. I will borrow your __cssheaders()  
> >>> function,
> >>> if you don't mind.
>
> >> I should have commented it a bit first, but it's not all that subtle.
>
> >> By the time the controller runs, the response has been set up as a
> >> standard html page. So we delete cookies and the default caching, and
> >> use Expires caching (an hour as shown) so that, in theory anyway (I
> >> haven't tested this against browsers yet) the performance should be
> >> fairly close to static.
>
> >> When I'm actually working on the CSS, I reduce the Expires timeout to
> >> 3 seconds (or whatever you like) so that my changes appear promptly.
>
> >> Here's a slightly cleaner version:
>
> >> def __cssheaders():
> >>      '''
> >>      edit default response headers for CSS
> >>      serve text/css with no cookies, limited caching
> >>      '''
> >>      response.cookies = Storage()  # no cookies
> >>      for header in ('Last-Modified', 'Expires', 'Pragma'):
> >>         if header in response.headers: del response.headers[header]
> >>      response.headers['Content-Type']='text/css'
> >>      response.headers['Cache-Control'] = 'max-age=3600, must-
> >> revalidate'
> >>      response.headers['Cache-Control'] = 'max-age=3, must-revalidate'
>
> >>> Is there any way to have some code in the css.py controller which  
> >>> will
> >>> automatically define functions for all my css files in /views/css/ ?
> >>> All it would need to do is run the __cssheaders() function and  
> >>> return
> >>> dict(), but it feels unnecessary to maintain a list of functions  
> >>> when
> >>> there are files.
>
> >>> -Eric
>
> >>> On Oct 6, 2:29 pm, Jonathan Lundell  wrote:
>  On Oct 6, 2009, at 1:35 PM, mdipierro wrote:
>
> > It is good practice to put in the CSS only relative urls to other
> > static files. That is not a problem with web2py.
>
> > If you need to include in the CSS urls generated by {{=URL()}}
> > then you should promote the css from a static file to a dynamic
> > page:
> > 1) make a controller for it
> > 2) make a view ending in .css
> > 3) call the action from the layout ending in .css
> > 4) in the .css view use absolute paths to include images
>
>  When I tried serving dynamic CSS (I wanted to dynamically control
>  colors, fonts, etc), I had to do some work to get the result served
>  as
>  text/css (which is necessary). I ended up hacking that (and some
>  other
>  header stuff, like caching) in the controller, but I suppose it  
>  could
>  happen in the view.
>
>  I notice that there's no generic.css.
>
>  I have a controller, css.py, that looks like this:
>
>  import time
>  from gluon.storage import Storage
>
>  def __cssheaders():
>       '''
>       edit default response headers for CSS
>       serve text/css with limited caching
>       '''
>       response.cookies = Storage()
>       response.headers['Content-Type']='text/css'
>       response.headers['Cache-Control'] = 'max-age=3600, must-
>  revalidate'
>       if 'Last-Modified' in response.headers: del response.headers
>  ['Last-Modified']
>       if 'Expires' in response.headers: del response.headers
>  ['Expires']
>       if 'Pragma' in response.headers: del response.headers
>  ['Pragma']
>
>  def xxx():
>       '''
>       app/css/xxx.css
>       set fonts and colors to be substituted via xxx.css view
>       '''
>       __cssheaders()
>       font_serif = 'cambria, georgia, "times new roman", serif'
>       font_sans = 'corbel, "Helvetica Neue", Helvetica, Arial, sans-
>  serif'
>       return dict(dark_color="#8e1650", second_color="#635e54",
>  light_color="#e9e7de",
>           accent_color="#edab05", flash_color="white",
>  flash_background="#8e1650",
>           body_background_color="#e8e8e8",
>  content_background_color="white",
>         

[web2py:32417] Re: form.custom.errors.field

2009-10-07 Thread mdipierro

I doubt there is a solution here that would satisfly everybody.

If you do now want to display errors automatically do

form.errors.clear()

Massimo

On Oct 7, 12:13 pm, Thadeus Burgess  wrote:
> I am attempting to patch web2py to allow support for custom errors in custom
> forms, so that the widgets to auto magically render the errors when using
> custom form.
>
> Desired functionality should behave such as "{{=form.custom.errors.field}}"
> and would display "must contain a
> value!"
>
> The below patch provides this functionality, however, when using regular
> form, it will not render the error div.
>
> Perhaps there is a less intrusive method? Something that will still work
> with just calling {{=form}}
>
> I would think that the new errors DIV would need to be appended to the
> components of the SQLFORM?
>
> Could someone with more knowledge of the web2py innerworkings help me with
> this?
>
> Index: gluon/html.py
> ===
> --- gluon/html.py    (revision 1258)
> +++ gluon/html.py    (working copy)
> @@ -1092,8 +1092,8 @@
>      def xml(self):
>          name = self.attributes.get('_name', None)
>          if name and hasattr(self, 'errors') and self.errors.get(name,
> None):
> -            return DIV.xml(self) + DIV(self.errors[name], _class='error',
> -                errors=None, _id='%s__error' % name).xml()
> +            return DIV.xml(self) #+ DIV(self.errors[name], _class='error',
> +              #  errors=None, _id='%s__error' % name).xml()
>          else:
>              return DIV.xml(self)
>
> Index: gluon/sqlhtml.py
> ===
> --- gluon/sqlhtml.py    (revision 1258)
> +++ gluon/sqlhtml.py    (working copy)
> @@ -756,6 +756,10 @@
>                      del self.errors[key]
>              if not self.errors:
>                  ret = True
> +
> +        self.custom.errors = Storage()
> +        for key, value in self.errors.items():
> +                self.custom.errors[key] = DIV(value, _class='error',
> errors=None, _id='%s__error' % key).xml()
>
>          requested_delete = \
>              request_vars.get(self.FIELDNAME_REQUEST_DELETE, False)
>
> -Thadeus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32416] Re: Newbie Question: Storing things in the the Session

2009-10-07 Thread mdipierro

if

rows=db().select(...)

you cannot store rows in a session because it includes an open db
connection.
You can store

rows.as_list()

On Oct 7, 1:35 pm, "portly.shor...@googlemail.com"
 wrote:
> Hi - I am new to Web2py and think it is great but I'm stuck. Is there
> a limit on what i can store in the Session? I want to store the the
> results of a sql query (returning 40 records) in the session. When I
> try I get an exception:
>
> Traceback (most recent call last):
>   File "gluon/main.py", line 419, in wsgibase
>   File "gluon/globals.py", line 368, in _try_store_on_disk
>   File "copy_reg.pyc", line 73, in _reduce_ex
>   File "gluon/sql.py", line 537, in __getattr__
> KeyError: '__getstate__'
>
> any ideas?
>
> many thanks
>
> Portly
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32415] Newbie Question: Storing things in the the Session

2009-10-07 Thread portly.shor...@googlemail.com

Hi - I am new to Web2py and think it is great but I'm stuck. Is there
a limit on what i can store in the Session? I want to store the the
results of a sql query (returning 40 records) in the session. When I
try I get an exception:

Traceback (most recent call last):
  File "gluon/main.py", line 419, in wsgibase
  File "gluon/globals.py", line 368, in _try_store_on_disk
  File "copy_reg.pyc", line 73, in _reduce_ex
  File "gluon/sql.py", line 537, in __getattr__
KeyError: '__getstate__'

any ideas?

many thanks

Portly

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32414] Re: Microapps on microblogs using web2py + OAuth (the cyborg approach for apps)

2009-10-07 Thread Offray Vladimir Luna Cárdenas

Hi,

I made an omission. Here is the original phrase:

Offray Vladimir Luna Cárdenas escribió:

> The idea of microapps on top of microblog engines is some kind of 
> cyborg approach. We can build a wrapper on top of any infraestructure 
> and replace with progressive as we progress, so we can, for example, 
> extend django powered jaiku engine with web2py. 
It was:

The idea of microapps on top of microblog engines is some kind of 
"cyborg approach". We can build a wrapper on top of any infraestructure 
and replace with progressive layers down to the base as we progress, so 
we can, for example, extend django powered jaiku engine with web2py.

Cheers,

Offray

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32413] go to different page on submit in T3

2009-10-07 Thread Wes James

I can see how to use onaccept/redirect to a different page standard
views and controllers, but with t3 how is this done?

Editing a T3 page, say you have:

{{=FORM( INPUT(_type='submit', _value='search'))}}

How would you submit to a different page.  By default it comes back to
the same page.

30 seconds later.

wait, never mind I just used {{=FORM( _action='next-page')}} and that worked

thx,

-wes

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32412] form.custom.errors.field

2009-10-07 Thread Thadeus Burgess
I am attempting to patch web2py to allow support for custom errors in custom
forms, so that the widgets to auto magically render the errors when using
custom form.

Desired functionality should behave such as "{{=form.custom.errors.field}}"
and would display "must contain a
value!"

The below patch provides this functionality, however, when using regular
form, it will not render the error div.

Perhaps there is a less intrusive method? Something that will still work
with just calling {{=form}}

I would think that the new errors DIV would need to be appended to the
components of the SQLFORM?

Could someone with more knowledge of the web2py innerworkings help me with
this?

Index: gluon/html.py
===
--- gluon/html.py(revision 1258)
+++ gluon/html.py(working copy)
@@ -1092,8 +1092,8 @@
 def xml(self):
 name = self.attributes.get('_name', None)
 if name and hasattr(self, 'errors') and self.errors.get(name,
None):
-return DIV.xml(self) + DIV(self.errors[name], _class='error',
-errors=None, _id='%s__error' % name).xml()
+return DIV.xml(self) #+ DIV(self.errors[name], _class='error',
+  #  errors=None, _id='%s__error' % name).xml()
 else:
 return DIV.xml(self)

Index: gluon/sqlhtml.py
===
--- gluon/sqlhtml.py(revision 1258)
+++ gluon/sqlhtml.py(working copy)
@@ -756,6 +756,10 @@
 del self.errors[key]
 if not self.errors:
 ret = True
+
+self.custom.errors = Storage()
+for key, value in self.errors.items():
+self.custom.errors[key] = DIV(value, _class='error',
errors=None, _id='%s__error' % key).xml()

 requested_delete = \
 request_vars.get(self.FIELDNAME_REQUEST_DELETE, False)



-Thadeus

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32411] Re: how to import html helpers inside a module?

2009-10-07 Thread mr.freeze

Here's 2 more cents: http://www.loc.gov/standards/codelists/countries.xml

On Oct 7, 10:57 am, Thadeus Burgess  wrote:
> Here is my 10 cents... dictionary of US States, :)
>
> http://pastebin.com/m4b73d548
>
> -Thadeus
>
> On Wed, Oct 7, 2009 at 10:21 AM, Álvaro Justen [Turicas] <
>
> alvarojus...@gmail.com> wrote:
>
> > On Wed, Oct 7, 2009 at 11:28, Jon Romero  wrote:
>
> > > Yes, you are right. And now that we have this thread, someone how is
> > > interested in adding a countries dropdown can implement it easily (I
> > > was searching around but didn't find anything elegant)
>
> > > On Oct 7, 5:08 pm, mdipierro  wrote:
> > >> I can add 1) but this means web2py becomes dependent on geopolitical
> > >> issues.
>
> > > At least it should be documented how someone could add countries (it's
> > > a field used a lot)
>
> > Jon,
> > thanks for it. Can you create a wiki page and describe this solution?
> > Just visithttp://wiki.web2py.com/register and visit
> >http://wiki.web2py.com/Page_name_you_want_to_createso post your code
> > and some comments about.
>
> > > Thanks for the solution
>
> > 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-users" 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:32410] Microapps on microblogs using web2py + OAuth (the cyborg approach for apps)

2009-10-07 Thread Offray Vladimir Luna Cárdenas

Hi all,

There is an idea about using small apps that can be created on top of 
microblog engines[1]. I would like to create that apps in web2py. The 
specific idea is to enrich a microblogging engine putting 
metainformation on messages to make it more accurate in educative 
context in similar way to what philtro[2] does for twitter. The idea is 
to get statistics, richer tags an even another interface. We tested 
several open source  microblog engines like Jaiku (which runs on top of 
the restrictive GAE --exclusion by countries, powered by google) and 
Yonkly (but running asp.net + SQL Express on Linux was the long way to 
go), so, for the moment, we're using present.ly as a microblogging app, 
because is the one with most of the features we want, the best user 
interface and has and API made using OAuth[3], so we can taker care 
about of things like data portability and other issues of a free/open 
web. The idea of microapps on top of microblog engines is some kind of 
cyborg approach. We can build a wrapper on top of any infraestructure 
and replace with progressive as we progress, so we can, for example, 
extend django powered jaiku engine with web2py. I previously had made 
some attempts to start with web2py, but this is the one that seems more 
interesting to me so any pointer about this idea would be appreciated.

[1] 
http://www.louisgray.com/live/2008/10/openmicroblogger-monetizes-with.html
[2] http://philtro.com/
[3] 
http://hueniverse.com/2007/10/beginners-guide-to-oauth-part-ii-protocol-workflow/


Thanks,

Offray

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32409] Re: Mac Theme

2009-10-07 Thread Alex Fanjul
Sorry, I forgot some skin files. This is new version v.1.1
-I added some alternative fonts in css, in case you don't have "Century 
Gothic" font, (that is the original one for this page).

alex f

El 07/10/2009 18:48, Alex Fanjul escribió:
> Here I'm sending you a Mac Theme for Web2py (its just a proof of 
> concept), just extract and sustitute all files in your application 
> "static" folder.
> I hope you like it.
>
> By the way Maximo, the original skin or theme (like the one im 
> sending) is not accesible due to the use of tables for web 
> structure... I think you knew that...but FYI.
> http://www.w3.org/TR/WCAG10/#gl-table-markup
>
> regards,
> alex F

-- 
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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
-~--~~~~--~~--~--~---



mac_theme - v1.1.rar
Description: Binary data


[web2py:32408] Mac Theme v1.0

2009-10-07 Thread Alex Fanjul
Here I'm sending you a Mac Theme for Web2py (its just a proof of 
concept), just extract and sustitute all files in your application 
"static" folder.
I hope you like it.

By the way Maximo, the original skin or theme (like the one im sending) 
is not accesible due to the use of tables for web structure... I think 
you knew that...but FYI.
http://www.w3.org/TR/WCAG10/#gl-table-markup

regards,
alex F
-- 
Alejandro Fanjul Fdez.
alex.fan...@gmail.com
www.mhproject.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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
-~--~~~~--~~--~--~---



mac_theme - v1.0.rar
Description: Binary data


[web2py:32407] RESTful Web Services

2009-10-07 Thread max

Dear developers.

My web2py search engine needs get content from a REST API from a Java
application server.
How would I do it best with Web2py?

Has somebody any experience with web2py or python rest clietns.

I also need to implement REST Services through Web2py  ? Is there any
example application, which I refer to.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32406] Re: FORM factory

2009-10-07 Thread Thadeus Burgess
Massimo, how hard would it be to implement

form.custom.errors.field

instead of having the widget render the error?

-Thadeus




On Wed, Oct 7, 2009 at 10:46 AM, Thadeus Burgess wrote:

> I have to perform a nasty hack to get around the form.errors displaying on
> each radio button!
>
> Make sure to set error_message="". Now it won't display a divs for the
> error.
>
> Manually in my view,
>
> {{if form.errors.has_key('field'):}}
> You must enter a value into this field!
> }}
> {{=form.custom.widget.field}}
>
> There has got to be an easier way?
>
> -Thadeus
>
>
>
>
>
> On Wed, Oct 7, 2009 at 7:22 AM, leone  wrote:
>
>>
>> I notice that if you don't match defined Field in SQLFORM.factory and
>> {{=form...}} in html form.results is False but form.errors is empty.
>> The length attribute of Field-string doesn't produce a desired width
>> of input.  There is a different way to obtain the apprioate layout?
>>
>> On 6 Ott, 21:53, mdipierro  wrote:
>> > Let us know when you find out.
>> >
>> > Massimo
>> >
>> > On Oct 6, 2:43 pm, leone  wrote:
>> >
>> >
>> >
>> > > Acc.!!
>> > > It works fine, but form.accets(request.vars) returns always False.
>> > > I have a button type=submit with an image before {{=form.custom.end}}.
>> > > I suppose this could be an error and Ihave substitute it with
>> > > {{=form.custom.submit}} with no result.
>> > > I have difficult to find solutions using your manual, but it is my
>> > > problem.
>> >
>> > > On 6 Ott, 19:58, mdipierro  wrote:
>> >
>> > > > It is automatic. You just need
>> >
>> > > > Field('name',requires=IS_IN_SET(('a','b','c')))
>> >
>> > > > or requires IS_IN_DB
>> >
>> > > > On Oct 6, 11:32 am, leone  wrote:
>> >
>> > > > > How can I render a   sequence by Field in
>> > > > > SQLFORM.factory?
>> > > > > Thanks!
>> >
>> > > > > On 6 Ott, 17:14, mdipierro  wrote:
>> >
>> > > > > > yes
>> >
>> > > > > > form=SQLFORM.factory(Field('x'),Field('y'))
>> >
>> > > > > > 
>> > > > > > ..
>> > > > > >  {{=form.custom.begin}}
>> > > > > >  {{=form.custom.widget.x}}
>> > > > > >  {{=form.custom.widget.y}}
>> > > > > >  {{=form.custom.submit}}
>> > > > > >  {{=form.custom.end}}
>> > > > > >   ..
>> > > > > >  
>> >
>> > > > > > On Oct 6, 9:51 am, leone  wrote:
>> >
>> > > > > > > I want use FORM object and helpers objects, but I need
>> complete
>> > > > > > > control over html code.
>> > > > > > > Exists a factory method as in SQLFORM, so I can code
>> > > > > > > 
>> > > > > > > ..
>> > > > > > >  {{=form.begin}}
>> > > > > > >  {{=form.widget.x}}
>> > > > > > >  {{=form.widget.y}}
>> > > > > > >  {{=form.submit}}
>> > > > > > >  {{=form.end}}
>> > > > > > >   ..
>> > > > > > >  
>> > > > > > > ???
>> > > > > > > If not, exist an alternative way to obtain the advantages of
>> web2py
>> > > > > > > and html flexibility?
>> >>
>>
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32405] Re: how to import html helpers inside a module?

2009-10-07 Thread Thadeus Burgess
Here is my 10 cents... dictionary of US States, :)

http://pastebin.com/m4b73d548

-Thadeus




On Wed, Oct 7, 2009 at 10:21 AM, Álvaro Justen [Turicas] <
alvarojus...@gmail.com> wrote:

>
> On Wed, Oct 7, 2009 at 11:28, Jon Romero  wrote:
> >
> > Yes, you are right. And now that we have this thread, someone how is
> > interested in adding a countries dropdown can implement it easily (I
> > was searching around but didn't find anything elegant)
> >
> > On Oct 7, 5:08 pm, mdipierro  wrote:
> >> I can add 1) but this means web2py becomes dependent on geopolitical
> >> issues.
> >
> > At least it should be documented how someone could add countries (it's
> > a field used a lot)
>
> Jon,
> thanks for it. Can you create a wiki page and describe this solution?
> Just visit http://wiki.web2py.com/ register and visit
> http://wiki.web2py.com/Page_name_you_want_to_create so post your code
> and some comments about.
>
> > Thanks for the solution
>
> 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-users" 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:32404] Re: URLs in static files

2009-10-07 Thread Jonathan Lundell

On Oct 7, 2009, at 8:44 AM, Julio wrote:

>
> This is good, specially if on your website you implement some sort of
> "skinning" allowing the users to dynamically switch "layouts" using
> the same css file, thanks for sharing this.

You're welcome.

I think it's a generally useful capability, and I hope that there's a  
more elegant way of incorporating it into web2py. As I was saying  
somewhere else, a generic.css file doesn't really work (unless you're  
generating all your CSS content in controllers). At the very least,  
perhaps the logic (where?) that creates the default html headers could  
recognize that it's got a .css file and create css headers instead.

>
> On Oct 7, 8:19 am, Jonathan Lundell  wrote:
>> On Oct 6, 2009, at 2:54 PM, Eric Vicenti wrote:
>>
>>
>>
>>> Thanks, mdi and Jonathan. I will borrow your __cssheaders()  
>>> function,
>>> if you don't mind.
>>
>> I should have commented it a bit first, but it's not all that subtle.
>>
>> By the time the controller runs, the response has been set up as a
>> standard html page. So we delete cookies and the default caching, and
>> use Expires caching (an hour as shown) so that, in theory anyway (I
>> haven't tested this against browsers yet) the performance should be
>> fairly close to static.
>>
>> When I'm actually working on the CSS, I reduce the Expires timeout to
>> 3 seconds (or whatever you like) so that my changes appear promptly.
>>
>> Here's a slightly cleaner version:
>>
>> def __cssheaders():
>>  '''
>>  edit default response headers for CSS
>>  serve text/css with no cookies, limited caching
>>  '''
>>  response.cookies = Storage()  # no cookies
>>  for header in ('Last-Modified', 'Expires', 'Pragma'):
>> if header in response.headers: del response.headers[header]
>>  response.headers['Content-Type']='text/css'
>>  response.headers['Cache-Control'] = 'max-age=3600, must- 
>> revalidate'
>>  response.headers['Cache-Control'] = 'max-age=3, must-revalidate'
>>
>>
>>
>>> Is there any way to have some code in the css.py controller which  
>>> will
>>> automatically define functions for all my css files in /views/css/ ?
>>> All it would need to do is run the __cssheaders() function and  
>>> return
>>> dict(), but it feels unnecessary to maintain a list of functions  
>>> when
>>> there are files.
>>
>>> -Eric
>>
>>> On Oct 6, 2:29 pm, Jonathan Lundell  wrote:
 On Oct 6, 2009, at 1:35 PM, mdipierro wrote:
>>
> It is good practice to put in the CSS only relative urls to other
> static files. That is not a problem with web2py.
>>
> If you need to include in the CSS urls generated by {{=URL()}}
> then you should promote the css from a static file to a dynamic
> page:
> 1) make a controller for it
> 2) make a view ending in .css
> 3) call the action from the layout ending in .css
> 4) in the .css view use absolute paths to include images
>>
 When I tried serving dynamic CSS (I wanted to dynamically control
 colors, fonts, etc), I had to do some work to get the result served
 as
 text/css (which is necessary). I ended up hacking that (and some
 other
 header stuff, like caching) in the controller, but I suppose it  
 could
 happen in the view.
>>
 I notice that there's no generic.css.
>>
 I have a controller, css.py, that looks like this:
>>
 import time
 from gluon.storage import Storage
>>
 def __cssheaders():
  '''
  edit default response headers for CSS
  serve text/css with limited caching
  '''
  response.cookies = Storage()
  response.headers['Content-Type']='text/css'
  response.headers['Cache-Control'] = 'max-age=3600, must-
 revalidate'
  if 'Last-Modified' in response.headers: del response.headers
 ['Last-Modified']
  if 'Expires' in response.headers: del response.headers
 ['Expires']
  if 'Pragma' in response.headers: del response.headers 
 ['Pragma']
>>
 def xxx():
  '''
  app/css/xxx.css
  set fonts and colors to be substituted via xxx.css view
  '''
  __cssheaders()
  font_serif = 'cambria, georgia, "times new roman", serif'
  font_sans = 'corbel, "Helvetica Neue", Helvetica, Arial, sans-
 serif'
  return dict(dark_color="#8e1650", second_color="#635e54",
 light_color="#e9e7de",
  accent_color="#edab05", flash_color="white",
 flash_background="#8e1650",
  body_background_color="#e8e8e8",
 content_background_color="white",
  font_body=font_serif,
  font_logo=font_sans,
  font_head=font_sans,)
>>
>>
> >



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email

[web2py:32403] Use existing database tables?

2009-10-07 Thread snorkel

Hi,
I have a application currently in PHP and already have PostgreSQL
tables etc setup for it, is there a way to
effectively use web2py to create a new front end using a DB pool from
the dbutils package and use that pool from
a controller?   I don't want to create new models for the database.

I am currently using Pylons, but web2py looks a lot easier to use.

Thanks,

Snorkel

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32402] Re: FORM factory

2009-10-07 Thread Thadeus Burgess
I have to perform a nasty hack to get around the form.errors displaying on
each radio button!

Make sure to set error_message="". Now it won't display a divs for the
error.

Manually in my view,

{{if form.errors.has_key('field'):}}
You must enter a value into this field!
}}
{{=form.custom.widget.field}}

There has got to be an easier way?

-Thadeus




On Wed, Oct 7, 2009 at 7:22 AM, leone  wrote:

>
> I notice that if you don't match defined Field in SQLFORM.factory and
> {{=form...}} in html form.results is False but form.errors is empty.
> The length attribute of Field-string doesn't produce a desired width
> of input.  There is a different way to obtain the apprioate layout?
>
> On 6 Ott, 21:53, mdipierro  wrote:
> > Let us know when you find out.
> >
> > Massimo
> >
> > On Oct 6, 2:43 pm, leone  wrote:
> >
> >
> >
> > > Acc.!!
> > > It works fine, but form.accets(request.vars) returns always False.
> > > I have a button type=submit with an image before {{=form.custom.end}}.
> > > I suppose this could be an error and Ihave substitute it with
> > > {{=form.custom.submit}} with no result.
> > > I have difficult to find solutions using your manual, but it is my
> > > problem.
> >
> > > On 6 Ott, 19:58, mdipierro  wrote:
> >
> > > > It is automatic. You just need
> >
> > > > Field('name',requires=IS_IN_SET(('a','b','c')))
> >
> > > > or requires IS_IN_DB
> >
> > > > On Oct 6, 11:32 am, leone  wrote:
> >
> > > > > How can I render a   sequence by Field in
> > > > > SQLFORM.factory?
> > > > > Thanks!
> >
> > > > > On 6 Ott, 17:14, mdipierro  wrote:
> >
> > > > > > yes
> >
> > > > > > form=SQLFORM.factory(Field('x'),Field('y'))
> >
> > > > > > 
> > > > > > ..
> > > > > >  {{=form.custom.begin}}
> > > > > >  {{=form.custom.widget.x}}
> > > > > >  {{=form.custom.widget.y}}
> > > > > >  {{=form.custom.submit}}
> > > > > >  {{=form.custom.end}}
> > > > > >   ..
> > > > > >  
> >
> > > > > > On Oct 6, 9:51 am, leone  wrote:
> >
> > > > > > > I want use FORM object and helpers objects, but I need complete
> > > > > > > control over html code.
> > > > > > > Exists a factory method as in SQLFORM, so I can code
> > > > > > > 
> > > > > > > ..
> > > > > > >  {{=form.begin}}
> > > > > > >  {{=form.widget.x}}
> > > > > > >  {{=form.widget.y}}
> > > > > > >  {{=form.submit}}
> > > > > > >  {{=form.end}}
> > > > > > >   ..
> > > > > > >  
> > > > > > > ???
> > > > > > > If not, exist an alternative way to obtain the advantages of
> web2py
> > > > > > > and html flexibility?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32401] Re: URLs in static files

2009-10-07 Thread Julio

This is good, specially if on your website you implement some sort of
"skinning" allowing the users to dynamically switch "layouts" using
the same css file, thanks for sharing this.

On Oct 7, 8:19 am, Jonathan Lundell  wrote:
> On Oct 6, 2009, at 2:54 PM, Eric Vicenti wrote:
>
>
>
> > Thanks, mdi and Jonathan. I will borrow your __cssheaders() function,
> > if you don't mind.
>
> I should have commented it a bit first, but it's not all that subtle.
>
> By the time the controller runs, the response has been set up as a  
> standard html page. So we delete cookies and the default caching, and  
> use Expires caching (an hour as shown) so that, in theory anyway (I  
> haven't tested this against browsers yet) the performance should be  
> fairly close to static.
>
> When I'm actually working on the CSS, I reduce the Expires timeout to  
> 3 seconds (or whatever you like) so that my changes appear promptly.
>
> Here's a slightly cleaner version:
>
> def __cssheaders():
>      '''
>      edit default response headers for CSS
>      serve text/css with no cookies, limited caching
>      '''
>      response.cookies = Storage()  # no cookies
>      for header in ('Last-Modified', 'Expires', 'Pragma'):
>         if header in response.headers: del response.headers[header]
>      response.headers['Content-Type']='text/css'
>      response.headers['Cache-Control'] = 'max-age=3600, must-revalidate'
>      response.headers['Cache-Control'] = 'max-age=3, must-revalidate'
>
>
>
> > Is there any way to have some code in the css.py controller which will
> > automatically define functions for all my css files in /views/css/ ?
> > All it would need to do is run the __cssheaders() function and return
> > dict(), but it feels unnecessary to maintain a list of functions when
> > there are files.
>
> > -Eric
>
> > On Oct 6, 2:29 pm, Jonathan Lundell  wrote:
> >> On Oct 6, 2009, at 1:35 PM, mdipierro wrote:
>
> >>> It is good practice to put in the CSS only relative urls to other
> >>> static files. That is not a problem with web2py.
>
> >>> If you need to include in the CSS urls generated by {{=URL()}}
> >>> then you should promote the css from a static file to a dynamic  
> >>> page:
> >>> 1) make a controller for it
> >>> 2) make a view ending in .css
> >>> 3) call the action from the layout ending in .css
> >>> 4) in the .css view use absolute paths to include images
>
> >> When I tried serving dynamic CSS (I wanted to dynamically control
> >> colors, fonts, etc), I had to do some work to get the result served  
> >> as
> >> text/css (which is necessary). I ended up hacking that (and some  
> >> other
> >> header stuff, like caching) in the controller, but I suppose it could
> >> happen in the view.
>
> >> I notice that there's no generic.css.
>
> >> I have a controller, css.py, that looks like this:
>
> >> import time
> >> from gluon.storage import Storage
>
> >> def __cssheaders():
> >>      '''
> >>      edit default response headers for CSS
> >>      serve text/css with limited caching
> >>      '''
> >>      response.cookies = Storage()
> >>      response.headers['Content-Type']='text/css'
> >>      response.headers['Cache-Control'] = 'max-age=3600, must-
> >> revalidate'
> >>      if 'Last-Modified' in response.headers: del response.headers
> >> ['Last-Modified']
> >>      if 'Expires' in response.headers: del response.headers
> >> ['Expires']
> >>      if 'Pragma' in response.headers: del response.headers['Pragma']
>
> >> def xxx():
> >>      '''
> >>      app/css/xxx.css
> >>      set fonts and colors to be substituted via xxx.css view
> >>      '''
> >>      __cssheaders()
> >>      font_serif = 'cambria, georgia, "times new roman", serif'
> >>      font_sans = 'corbel, "Helvetica Neue", Helvetica, Arial, sans-
> >> serif'
> >>      return dict(dark_color="#8e1650", second_color="#635e54",
> >> light_color="#e9e7de",
> >>          accent_color="#edab05", flash_color="white",
> >> flash_background="#8e1650",
> >>          body_background_color="#e8e8e8",
> >> content_background_color="white",
> >>          font_body=font_serif,
> >>          font_logo=font_sans,
> >>          font_head=font_sans,)
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32400] Re: web2py wiki

2009-10-07 Thread Julio

Beautiful, Obrigado Alvaro!, this is an excellent app and much needed
for the community, we are truly eating our own dog food now! :)

Thanks!

Julio

On Oct 7, 8:15 am, Álvaro Justen [Turicas] 
wrote:
> Hi folks,
> I'm posting this to show you that we have a "new" wiki system.
> Last weekend I changed some things in wiki app, like:
> - Now we have real page names, likehttp://wiki.web2py.com/Page_name
> - Some layout changes
> - Simplification of some forms
> - Included views that weren't there
> - Fixed some bugs
>
> And with Massimo's help we migrated it to my server - and so now I
> have more flexibility to update the app.
> Please use:http://wiki.web2py.com/
> (instead ofhttp://www.web2py.com/wiki- it actually will redirect to
> former URL)
>
> All "active" pages that have links in the old way
> (/wiki/default/page/an_ugly_uuid) were changed to new way.
> All users are still in the database, none was changed in users' table.
>
> Future plans:
> - Move AlterEgo pages to wiki and create a "FAQ" page in wiki with a
> list - please don't do it manually, I'll do a script to do this job
> (probably next weekend);
> - Add more wiki features that we don't have today;
> - Better usability;
> - Move to BitBucket.
>
> If you want to contribute or use this wiki in your site, just check
> out the code in:https://code.launchpad.net/web2py-wiki/
> If you have feature requests, bug reports or other issues related to
> this app (like usability, hosting etc.) please let me know.
>
> Let's create the better documentation project of a web framework!
> Let's write about web2py! :-)
>
> 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-users" 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:32399] Re: how to import html helpers inside a module?

2009-10-07 Thread Álvaro Justen [Turicas]

On Wed, Oct 7, 2009 at 11:28, Jon Romero  wrote:
>
> Yes, you are right. And now that we have this thread, someone how is
> interested in adding a countries dropdown can implement it easily (I
> was searching around but didn't find anything elegant)
>
> On Oct 7, 5:08 pm, mdipierro  wrote:
>> I can add 1) but this means web2py becomes dependent on geopolitical
>> issues.
>
> At least it should be documented how someone could add countries (it's
> a field used a lot)

Jon,
thanks for it. Can you create a wiki page and describe this solution?
Just visit http://wiki.web2py.com/ register and visit
http://wiki.web2py.com/Page_name_you_want_to_create so post your code
and some comments about.

> Thanks for the solution

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-users" 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:32398] Re: web2py wiki

2009-10-07 Thread mdipierro

Thank you Alvaro.
I fully endorse this. This is a much needed move.
It will kill to birds with one stone: will make a better wiki app and
better documentation.

Massimo

On Oct 7, 10:15 am, Álvaro Justen [Turicas] 
wrote:
> Hi folks,
> I'm posting this to show you that we have a "new" wiki system.
> Last weekend I changed some things in wiki app, like:
> - Now we have real page names, likehttp://wiki.web2py.com/Page_name
> - Some layout changes
> - Simplification of some forms
> - Included views that weren't there
> - Fixed some bugs
>
> And with Massimo's help we migrated it to my server - and so now I
> have more flexibility to update the app.
> Please use:http://wiki.web2py.com/
> (instead ofhttp://www.web2py.com/wiki- it actually will redirect to
> former URL)
>
> All "active" pages that have links in the old way
> (/wiki/default/page/an_ugly_uuid) were changed to new way.
> All users are still in the database, none was changed in users' table.
>
> Future plans:
> - Move AlterEgo pages to wiki and create a "FAQ" page in wiki with a
> list - please don't do it manually, I'll do a script to do this job
> (probably next weekend);
> - Add more wiki features that we don't have today;
> - Better usability;
> - Move to BitBucket.
>
> If you want to contribute or use this wiki in your site, just check
> out the code in:https://code.launchpad.net/web2py-wiki/
> If you have feature requests, bug reports or other issues related to
> this app (like usability, hosting etc.) please let me know.
>
> Let's create the better documentation project of a web framework!
> Let's write about web2py! :-)
>
> 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-users" 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:32397] Re: URLs in static files

2009-10-07 Thread Jonathan Lundell

On Oct 6, 2009, at 2:54 PM, Eric Vicenti wrote:

>
> Thanks, mdi and Jonathan. I will borrow your __cssheaders() function,
> if you don't mind.

I should have commented it a bit first, but it's not all that subtle.

By the time the controller runs, the response has been set up as a  
standard html page. So we delete cookies and the default caching, and  
use Expires caching (an hour as shown) so that, in theory anyway (I  
haven't tested this against browsers yet) the performance should be  
fairly close to static.

When I'm actually working on the CSS, I reduce the Expires timeout to  
3 seconds (or whatever you like) so that my changes appear promptly.

Here's a slightly cleaner version:

def __cssheaders():
 '''
 edit default response headers for CSS
 serve text/css with no cookies, limited caching
 '''
 response.cookies = Storage()  # no cookies
 for header in ('Last-Modified', 'Expires', 'Pragma'):
if header in response.headers: del response.headers[header]
 response.headers['Content-Type']='text/css'
 response.headers['Cache-Control'] = 'max-age=3600, must-revalidate'
 response.headers['Cache-Control'] = 'max-age=3, must-revalidate'


>
> Is there any way to have some code in the css.py controller which will
> automatically define functions for all my css files in /views/css/ ?
> All it would need to do is run the __cssheaders() function and return
> dict(), but it feels unnecessary to maintain a list of functions when
> there are files.
>
> -Eric
>
> On Oct 6, 2:29 pm, Jonathan Lundell  wrote:
>> On Oct 6, 2009, at 1:35 PM, mdipierro wrote:
>>
>>> It is good practice to put in the CSS only relative urls to other
>>> static files. That is not a problem with web2py.
>>
>>> If you need to include in the CSS urls generated by {{=URL()}}
>>> then you should promote the css from a static file to a dynamic  
>>> page:
>>> 1) make a controller for it
>>> 2) make a view ending in .css
>>> 3) call the action from the layout ending in .css
>>> 4) in the .css view use absolute paths to include images
>>
>> When I tried serving dynamic CSS (I wanted to dynamically control
>> colors, fonts, etc), I had to do some work to get the result served  
>> as
>> text/css (which is necessary). I ended up hacking that (and some  
>> other
>> header stuff, like caching) in the controller, but I suppose it could
>> happen in the view.
>>
>> I notice that there's no generic.css.
>>
>> I have a controller, css.py, that looks like this:
>>
>> import time
>> from gluon.storage import Storage
>>
>> def __cssheaders():
>>  '''
>>  edit default response headers for CSS
>>  serve text/css with limited caching
>>  '''
>>  response.cookies = Storage()
>>  response.headers['Content-Type']='text/css'
>>  response.headers['Cache-Control'] = 'max-age=3600, must- 
>> revalidate'
>>  if 'Last-Modified' in response.headers: del response.headers
>> ['Last-Modified']
>>  if 'Expires' in response.headers: del response.headers 
>> ['Expires']
>>  if 'Pragma' in response.headers: del response.headers['Pragma']
>>
>> def xxx():
>>  '''
>>  app/css/xxx.css
>>  set fonts and colors to be substituted via xxx.css view
>>  '''
>>  __cssheaders()
>>  font_serif = 'cambria, georgia, "times new roman", serif'
>>  font_sans = 'corbel, "Helvetica Neue", Helvetica, Arial, sans-
>> serif'
>>  return dict(dark_color="#8e1650", second_color="#635e54",
>> light_color="#e9e7de",
>>  accent_color="#edab05", flash_color="white",
>> flash_background="#8e1650",
>>  body_background_color="#e8e8e8",
>> content_background_color="white",
>>  font_body=font_serif,
>>  font_logo=font_sans,
>>  font_head=font_sans,)



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32396] [New] web2py wiki

2009-10-07 Thread Álvaro Justen [Turicas]

Hi folks,
I'm posting this to show you that we have a "new" wiki system.
Last weekend I changed some things in wiki app, like:
- Now we have real page names, like http://wiki.web2py.com/Page_name
- Some layout changes
- Simplification of some forms
- Included views that weren't there
- Fixed some bugs

And with Massimo's help we migrated it to my server - and so now I
have more flexibility to update the app.
Please use:
http://wiki.web2py.com/
(instead of http://www.web2py.com/wiki - it actually will redirect to
former URL)

All "active" pages that have links in the old way
(/wiki/default/page/an_ugly_uuid) were changed to new way.
All users are still in the database, none was changed in users' table.

Future plans:
- Move AlterEgo pages to wiki and create a "FAQ" page in wiki with a
list - please don't do it manually, I'll do a script to do this job
(probably next weekend);
- Add more wiki features that we don't have today;
- Better usability;
- Move to BitBucket.

If you want to contribute or use this wiki in your site, just check
out the code in:
https://code.launchpad.net/web2py-wiki/
If you have feature requests, bug reports or other issues related to
this app (like usability, hosting etc.) please let me know.

Let's create the better documentation project of a web framework!
Let's write about web2py! :-)

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-users" 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:32395] which subversion revision is 1.67.2

2009-10-07 Thread mr.freeze

Does anyone know which svn revision is 1.67.2? I don't see it in the
comments.

Thanks,
Nathan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32394] Re: how to import html helpers inside a module?

2009-10-07 Thread Jon Romero

Yes, you are right. And now that we have this thread, someone how is
interested in adding a countries dropdown can implement it easily (I
was searching around but didn't find anything elegant)

On Oct 7, 5:08 pm, mdipierro  wrote:
> I can add 1) but this means web2py becomes dependent on geopolitical
> issues.

At least it should be documented how someone could add countries (it's
a field used a lot)

Thanks for the solution
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32393] Re: A simple patch to provide upload progress

2009-10-07 Thread mdipierro

Check again. I added it now.

On Oct 7, 6:42 am, AndCycle  wrote:
> oops, the patch been cut by width restriction on mailing list lol
>
> here is pastebinhttp://pastebin.com/f219d603b
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32392] Re: Internal Error in Administrative Interface

2009-10-07 Thread mdipierro

I cannot reproduce this. Can you please download it again?

On Oct 7, 3:34 am, Sujan Shakya  wrote:
> I just checked out the web2py source from code.google.com.
> Then I ran 'python web2py.py -a mypassword'
> Then I visitedhttp://127.0.0.1:8000/. This shows the welcome page.
> But when I clicked on 'click here for the administrative interface'
> link, I got 'Internal Error Ticket Issued' page. Clicking on the
> ticket link opened another 'Internal Error' page.
>
> Am I missing something ?
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32391] Re: Try out admin editor

2009-10-07 Thread mdipierro

Please check again it should be there

On Oct 7, 4:26 am, Iceberg  wrote:
> Looks like the problem is already addressed 3 weeks ago. But I did not
> find a file named keyboard.js in our web2py admin.
>
>  http://sourceforge.net/projects/editarea/forums/forum/556921/topic/33...
>
> On Oct7, 11:24am, mdipierro  wrote:
>
> > Can you send me a patch?
>
> > On Oct 6, 7:30 am, Kuba Kucharski  wrote:
>
> > > Still the main problem with admin editor is this
> > > wrong-refreshing/wrong-displaying trauma - never solved or did I miss 
> > > smth ?
>
> > > On Oct 5, 2009 3:47 AM, "Iceberg"  wrote:
>
> > > Did not really try the admin editor until recently. Nice as a handy
> > > tool for some quick typing, the only inconvenience is the lack of ctrl
> > > +s shortcut to save a file. Is it possible to add this feature? Since
> > > I notice the ctrl+f etc can work.
>
> > > BTW, the word_wrap.gif icon is missing in the toolbar.
>
> > > Regards,
> > > Iceberg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32390] Re: how to import html helpers inside a module?

2009-10-07 Thread mdipierro

I can add 1) but this means web2py becomes dependent on geopolitical
issues.
I agree 2) and 3) do not belong in there.

Massimo

On Oct 7, 9:04 am, Iceberg  wrote:
> Sorry but IMHO:
>
> 1. adding a gluon/contrib/countries.py with a countries_list =
> ['United States', 'Afghanistan', ...] is good enough for reference,
> and developers might change orders or languages before really use it.
>
> 2. adding a countries_widget is not that convincing, especially
> because it is just one line of code (means not worthy to wrap as a
> widget), if we already have the countries_list=[...]
>
> 3. adding a Field('country', 'countries') ... mmm... see point #2.
>
> Just my 2 cents.
>
> On Oct7, 8:45pm, Jon Romero  wrote:
>
> > Yeap, that's the way I was first doing it but I am wondering what must
> > be imported so module code can work (because it's working when it's in
> > db.py).
> > Also, creating a Field('country', 'countries') would be (I think) a
> > nice addition. Should I submit a patch, Massimo?
>
> > Thanks for
>
> > On Oct 7, 3:33 pm, Iceberg  wrote:
>
> > > Since you gonna import one homemade module anyway, why not just:
>
> > > from applications.yourapp.modules.country import
> > > country_names_as_a_list
> > > db.define_table('shipping_info',
> > >   Field('countries', _requires=IS_IN_SET(country_names_as_a_list))
> > >   ...
> > >   )
>
> > > This way you don't force yourself to know something difficult (though
> > > not that difficult if you really know widgets well).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32389] Re: how to import html helpers inside a module?

2009-10-07 Thread Iceberg

Sorry but IMHO:

1. adding a gluon/contrib/countries.py with a countries_list =
['United States', 'Afghanistan', ...] is good enough for reference,
and developers might change orders or languages before really use it.

2. adding a countries_widget is not that convincing, especially
because it is just one line of code (means not worthy to wrap as a
widget), if we already have the countries_list=[...]

3. adding a Field('country', 'countries') ... mmm... see point #2.

Just my 2 cents.


On Oct7, 8:45pm, Jon Romero  wrote:
> Yeap, that's the way I was first doing it but I am wondering what must
> be imported so module code can work (because it's working when it's in
> db.py).
> Also, creating a Field('country', 'countries') would be (I think) a
> nice addition. Should I submit a patch, Massimo?
>
> Thanks for
>
> On Oct 7, 3:33 pm, Iceberg  wrote:
>
>
>
> > Since you gonna import one homemade module anyway, why not just:
>
> > from applications.yourapp.modules.country import
> > country_names_as_a_list
> > db.define_table('shipping_info',
> >   Field('countries', _requires=IS_IN_SET(country_names_as_a_list))
> >   ...
> >   )
>
> > This way you don't force yourself to know something difficult (though
> > not that difficult if you really know widgets well).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32388] Re: Amf service doesn't work

2009-10-07 Thread mdipierro

try:

def getList():
return db().select(db.classifieds.ALL).as_list()

On Oct 7, 6:13 am, elffikk  wrote:
> Hi,
>
> I am pretty new to web2py and ... need help :)
>
> I am trying this and works (json service)
>
> def call(): return service()
>
> @service.json
> def getList():
>     return db().select(db.classifieds.ALL)
>
> but with amf doesn't work
>
> def call(): return service()
>
> @service.amfrpc
> def getList():
>     return db().select(db.classifieds.ALL)
>
> in logs I found this message:
>
> Traceback (most recent call last):
>   File "gluon/restricted.py", line 178, in restricted
>   File "C:/Documents and Settings/Vasile/Desktop/web2py_win/web2py/
> applications/info777/controllers/classifieds.py", line 21, in 
>   File "gluon/globals.py", line 102, in 
>   File "C:/Documents and Settings/Vasile/Desktop/web2py_win/web2py/
> applications/info777/controllers/classifieds.py", line 1, in call
>   File "gluon/tools.py", line 2426, in __call__
>   File "gluon/tools.py", line 2369, in serve_amfrpc
>   File "C:\Documents and Settings\Vasile\Desktop\web2py_win\web2py
> \pyamf\remoting\__init__.py", line 634, in decode
>   File "C:\Documents and Settings\Vasile\Desktop\web2py_win\web2py
> \pyamf\util\__init__.py", line 322, in read_uchar
>   File "C:\Documents and Settings\Vasile\Desktop\web2py_win\web2py
> \pyamf\util\__init__.py", line 298, in _read
>   File "C:\Documents and Settings\Vasile\Desktop\web2py_win\web2py
> \pyamf\util\__init__.py", line 646, in read
> IOError: Attempted to read 1 bytes from the buffer but only 0 remain
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32387] Re: OpenShare (first opensource ad service built on web2py) just went opensource!

2009-10-07 Thread mdipierro

:-)

On Oct 7, 7:55 am, Jon Romero  wrote:
> I've just release OpenShare on bitbucket. You can see it running (and
> submit your opensource projects) here:http://openshare.emotionull.com
>
> http://bitbucket.org/jonromero/openshare/
>
> Enjoy!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32386] Re: Adding a user name to user registration

2009-10-07 Thread mdipierro

gae provides https for the appspot domain

On Oct 7, 7:21 am, Joseph Jude  wrote:
> > > 2) in login, the password is sent in plain text. how to rectify
>
> > You can use https to protect your password... http is not enough to do
> > so...
>
> I'm going to deploy in GAE, so I don't think https is an option. In
> the out-of-the-box web2py passwords are not visible. I would like to
> adopt the same but with user name rather than email. Is it possible?
>
> BTW: I am able to get a web2py app pretty quickly; but this auth
> customization is what I'm struggling with. Is there any link where it
> is explained in detail (like what steps to take)? I've got the web2py
> book & slides too.
>
> Thx,
> Joseph
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32385] Re: Internal Error in Administrative Interface

2009-10-07 Thread mdipierro

Use stable for now. I do not swear by the development version since a
lot of changes are there. I will investigage.

On Oct 7, 3:34 am, Sujan Shakya  wrote:
> I just checked out the web2py source from code.google.com.
> Then I ran 'python web2py.py -a mypassword'
> Then I visitedhttp://127.0.0.1:8000/. This shows the welcome page.
> But when I clicked on 'click here for the administrative interface'
> link, I got 'Internal Error Ticket Issued' page. Clicking on the
> ticket link opened another 'Internal Error' page.
>
> Am I missing something ?
>
> Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32384] Re: anti spam, anti *** strategy?

2009-10-07 Thread mdipierro

I changed the title of the thread.

On Oct 7, 12:21 am, weheh  wrote:
> How about people who haven't discovered web2py yet and won't bother
> asking IT to reclassify the site?
>
> On Oct 7, 1:09 am, Yarko Tymciurak  wrote:
>
> > A corp server will trigger on keywords, as a precaution - Jason just needs
> > to inform his IT dept. to take this off their ban list, and point out why
> > this was a mis-fired trigger (they will no doubt add an exception for web2py
> > groups, given the topic).
>
> > On Wed, Oct 7, 2009 at 12:06 AM, weheh  wrote:
>
> > > That's scary. Would deleting this thread get the group back on the
> > > permitted list? Probably not. Maybe this thread should be cut anyway
> > > before the bot censors all catch the scent. Yarko, you've got a sharp
> > > knife, don't you?
>
> > > On Oct 6, 11:24 pm, Richard  wrote:
> > > > oh, because of the keyword "p*rn" in the title! haha
>
> > > > On Oct 7, 10:13 am, Richard  wrote:
>
> > > > > what do you mean?
>
> > > > > On Oct 6, 6:44 pm, encompass  wrote:
>
> > > > > > Just as a side note, I wanted to inform you that web2py groups is 
> > > > > > now
> > > > > > on the ban list of my business.  Just after I looked at this post
> > > with
> > > > > > my work computer.  I am not blaming you, but I thought it was funny.
> > > > > > Regards,
> > > > > > Jason
>
> > > > > > On Oct 6, 7:17 am, Richard  wrote:
>
> > > > > > > I've used the recaptcha built in to auth_user registration and it
> > > > > > > worked well. Is it easy to integrate with other forms?
>
> > > > > > > On Oct 6, 1:34 am, david bain  wrote:
>
> > > > > > > > implementing a captcha or recaptcha based system should help.
>
> > > > > > > > On Mon, Oct 5, 2009 at 9:27 AM, Web2py-SuperFan <
> > > mwkan...@gmail.com> wrote:
>
> > > > > > > > > Hi all,
>
> > > > > > > > > I'm implementing a comments and wiki feature on my web2py app.
> > >  Is
> > > > > > > > > there any best practices or strategies you've used or would
> > > recommend
> > > > > > > > > on preventing spam or porn posts onto the site.  I'm looking
> > > for some
> > > > > > > > > automated prevention as I'm afraid the amount of posts will be
> > > way too
> > > > > > > > > much for human monitoring.  Its a social site.
>
> > > > > > > > > Thanks for all your pointers.
>
> > > > > > > > > Mark
>
> > > > > > > > --
> > > > > > > > SplashStart - Professional Websites. Starting Now.
> > >http://www.splashstart.com-Hidequoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32383] Amf service doesn't work

2009-10-07 Thread elffikk

Hi,

I am pretty new to web2py and ... need help :)

I am trying this and works (json service)

def call(): return service()

@service.json
def getList():
return db().select(db.classifieds.ALL)

but with amf doesn't work

def call(): return service()

@service.amfrpc
def getList():
return db().select(db.classifieds.ALL)

in logs I found this message:

Traceback (most recent call last):
  File "gluon/restricted.py", line 178, in restricted
  File "C:/Documents and Settings/Vasile/Desktop/web2py_win/web2py/
applications/info777/controllers/classifieds.py", line 21, in 
  File "gluon/globals.py", line 102, in 
  File "C:/Documents and Settings/Vasile/Desktop/web2py_win/web2py/
applications/info777/controllers/classifieds.py", line 1, in call
  File "gluon/tools.py", line 2426, in __call__
  File "gluon/tools.py", line 2369, in serve_amfrpc
  File "C:\Documents and Settings\Vasile\Desktop\web2py_win\web2py
\pyamf\remoting\__init__.py", line 634, in decode
  File "C:\Documents and Settings\Vasile\Desktop\web2py_win\web2py
\pyamf\util\__init__.py", line 322, in read_uchar
  File "C:\Documents and Settings\Vasile\Desktop\web2py_win\web2py
\pyamf\util\__init__.py", line 298, in _read
  File "C:\Documents and Settings\Vasile\Desktop\web2py_win\web2py
\pyamf\util\__init__.py", line 646, in read
IOError: Attempted to read 1 bytes from the buffer but only 0 remain

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32382] OpenShare (first opensource ad service built on web2py) just went opensource!

2009-10-07 Thread Jon Romero

I've just release OpenShare on bitbucket. You can see it running (and
submit your opensource projects) here: http://openshare.emotionull.com

http://bitbucket.org/jonromero/openshare/

Enjoy!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32381] Re: how to import html helpers inside a module?

2009-10-07 Thread Jon Romero

Yeap, that's the way I was first doing it but I am wondering what must
be imported so module code can work (because it's working when it's in
db.py).
Also, creating a Field('country', 'countries') would be (I think) a
nice addition. Should I submit a patch, Massimo?

Thanks for

On Oct 7, 3:33 pm, Iceberg  wrote:
> Since you gonna import one homemade module anyway, why not just:
>
> from applications.yourapp.modules.country import
> country_names_as_a_list
> db.define_table('shipping_info',
>   Field('countries', _requires=IS_IN_SET(country_names_as_a_list))
>   ...
>   )
>
> This way you don't force yourself to know something difficult (though
> not that difficult if you really know widgets well).
>
> On Oct7, 8:05pm, Jon Romero  wrote:
>
> > ok, I've imported gluon.html but now it seems there is another
> > different error.
>
> > I am creating a country widget (it will display all countries in a
> > dropdown box).
>
> > So, in my db.py I have this:
> > from applications.appname.modules.countries import *
> > db.shipping_info.countries.widget = countries_widget
>
> > and in countries.py
>
> > from gluon.html import *
> > COUNTRIES=['United States', 'Afghanistan', ...]
> > def countries_widget(field, value):
> >     return SELECT(COUNTRIES, _id=0)
>
> > and I get this error:
> > File "/home/darksun4/Sources/web2py/gluon/sqlhtml.py", line 595, in
> > __init__
> >     inp = field.widget(field, default)
> >   File "/home/darksun4/Sources/web2py/applications/myapp/modules/
> > countries.py", line 4, in countries_widget
> > AttributeError: 'list' object has no attribute 'options'
>
> > If I place my widget code in db.py, everything works ok.
>
> > Also, what do you think about a db field, countries? Should I commit
> > something like that?
>
> > On Oct 7, 2:44 pm, Jon Romero  wrote:
>
> > > I have created a module (inside my application/modules) and I use
> > > SELECT.
> > > I tried importing gluon.tools but no go. All I get is this error:
>
> > > NameError: global name 'SELECT' is not defined
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32380] Re: how to import html helpers inside a module?

2009-10-07 Thread Iceberg

Since you gonna import one homemade module anyway, why not just:

from applications.yourapp.modules.country import
country_names_as_a_list
db.define_table('shipping_info',
  Field('countries', _requires=IS_IN_SET(country_names_as_a_list))
  ...
  )

This way you don't force yourself to know something difficult (though
not that difficult if you really know widgets well).

On Oct7, 8:05pm, Jon Romero  wrote:
> ok, I've imported gluon.html but now it seems there is another
> different error.
>
> I am creating a country widget (it will display all countries in a
> dropdown box).
>
> So, in my db.py I have this:
> from applications.appname.modules.countries import *
> db.shipping_info.countries.widget = countries_widget
>
> and in countries.py
>
> from gluon.html import *
> COUNTRIES=['United States', 'Afghanistan', ...]
> def countries_widget(field, value):
>     return SELECT(COUNTRIES, _id=0)
>
> and I get this error:
> File "/home/darksun4/Sources/web2py/gluon/sqlhtml.py", line 595, in
> __init__
>     inp = field.widget(field, default)
>   File "/home/darksun4/Sources/web2py/applications/myapp/modules/
> countries.py", line 4, in countries_widget
> AttributeError: 'list' object has no attribute 'options'
>
> If I place my widget code in db.py, everything works ok.
>
> Also, what do you think about a db field, countries? Should I commit
> something like that?
>
> On Oct 7, 2:44 pm, Jon Romero  wrote:
>
>
>
> > I have created a module (inside my application/modules) and I use
> > SELECT.
> > I tried importing gluon.tools but no go. All I get is this error:
>
> > NameError: global name 'SELECT' is not defined
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:/] Re: Adding a user name to user registration

2009-10-07 Thread Joseph Jude

> > 2) in login, the password is sent in plain text. how to rectify
>
> You can use https to protect your password... http is not enough to do
> so...
>


I'm going to deploy in GAE, so I don't think https is an option. In
the out-of-the-box web2py passwords are not visible. I would like to
adopt the same but with user name rather than email. Is it possible?

BTW: I am able to get a web2py app pretty quickly; but this auth
customization is what I'm struggling with. Is there any link where it
is explained in detail (like what steps to take)? I've got the web2py
book & slides too.

Thx,
Joseph
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32379] Re: FORM factory

2009-10-07 Thread leone

I notice that if you don't match defined Field in SQLFORM.factory and
{{=form...}} in html form.results is False but form.errors is empty.
The length attribute of Field-string doesn't produce a desired width
of input.  There is a different way to obtain the apprioate layout?

On 6 Ott, 21:53, mdipierro  wrote:
> Let us know when you find out.
>
> Massimo
>
> On Oct 6, 2:43 pm, leone  wrote:
>
>
>
> > Acc.!!
> > It works fine, but form.accets(request.vars) returns always False.
> > I have a button type=submit with an image before {{=form.custom.end}}.
> > I suppose this could be an error and Ihave substitute it with
> > {{=form.custom.submit}} with no result.
> > I have difficult to find solutions using your manual, but it is my
> > problem.
>
> > On 6 Ott, 19:58, mdipierro  wrote:
>
> > > It is automatic. You just need
>
> > > Field('name',requires=IS_IN_SET(('a','b','c')))
>
> > > or requires IS_IN_DB
>
> > > On Oct 6, 11:32 am, leone  wrote:
>
> > > > How can I render a   sequence by Field in
> > > > SQLFORM.factory?
> > > > Thanks!
>
> > > > On 6 Ott, 17:14, mdipierro  wrote:
>
> > > > > yes
>
> > > > > form=SQLFORM.factory(Field('x'),Field('y'))
>
> > > > > 
> > > > > ..
> > > > >  {{=form.custom.begin}}
> > > > >  {{=form.custom.widget.x}}
> > > > >  {{=form.custom.widget.y}}
> > > > >  {{=form.custom.submit}}
> > > > >  {{=form.custom.end}}
> > > > >   ..
> > > > >  
>
> > > > > On Oct 6, 9:51 am, leone  wrote:
>
> > > > > > I want use FORM object and helpers objects, but I need complete
> > > > > > control over html code.
> > > > > > Exists a factory method as in SQLFORM, so I can code
> > > > > > 
> > > > > > ..
> > > > > >  {{=form.begin}}
> > > > > >  {{=form.widget.x}}
> > > > > >  {{=form.widget.y}}
> > > > > >  {{=form.submit}}
> > > > > >  {{=form.end}}
> > > > > >   ..
> > > > > >  
> > > > > > ???
> > > > > > If not, exist an alternative way to obtain the advantages of web2py
> > > > > > and html flexibility?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32377] Re: GAE Tutorial to Web2py

2009-10-07 Thread murray3

sorry for posting this again but it does not appear to show up in the
list of
postings!

I wondered if anyone had tried to use the xmpp functionality of GAE
for non chat i.e. application communications.

There are a number of ways of doing this using the various javascript
libraries (strophe, jajasc etc) but not sure if they work with
this initial xmpp offering from google? Also Strophe has a django
sample but again not sure if it will work with GAE as it is using
BOSH.

I think this is the future for web apps and it would be great if we
could
get web2py fully enabled to utilise this technology.
Chrism

On Oct 7, 12:12 am, murray3  wrote:
> This works really well now, thanks.
> I want to take it further have you configured any of the javascript
> xmpp client libraries to work with this onGAE?
> any help
> appreciated
> chrism
>
> On Oct 5, 7:35 am, Robin B  wrote:
>
>
>
> > Try not checking for 'POST' or chat, to see if there is a problem with
> > those checks:
>
> > def message():
> >         import logging
> >         message =  request.vars
> >         logging.debug(str(message))
> >         from google.appengine.api import xmpp
> >         user_address = 'chrisjmurr...@gmail.com'
> >         xmpp.send_invite(user_address)
> >         msg = "Simple responce from a simple guy:)"
> >         xmpp.send_message(user_address, msg)
> >         return message
>
> > > also if you look at these logs some of them are red or orange
> > > indicating highGAECPU usage, is this normal?
>
> > When your app does not get much activity, google kills your app's CGI
> > processes, then when the next request comes later, google reloads your
> > app from scratch.  Reloading can take a lot of CPU to read, parse,
> > compile, execute web2py and your app.  Google is warning you that if
> > every request took as long as this cold request, you should make
> > changes to optimize your app for better performance, since its the
> > first/warm-up request there is not much you can do about the high CPU.
>
> > Robin
>
> > On Oct 4, 4:42 am, murray3  wrote:
>
> > > Thanks Robin,
> > > Here are some snapshots of the logs, as you can see requests are being
> > > made to /_ah/xmpp/message/chat/, I thought I would see the xml /
> > > jabber message somewhere? either returned to the view or in these
> > > logs?
>
> > > I have tried to write a simple bot / responder but not getting far,
> > > any help appreciated:
> > > in xmpp.py:
>
> > > def message():
> > >     if request.args[0] == 'chat' and request.method == 'POST':
> > >         import logging
> > >         message =  request.vars
> > >         logging.debug(str(message))
> > >         from google.appengine.api import xmpp
> > >         user_address = 'chrisjmurr...@gmail.com'
> > >         xmpp.send_invite(user_address)
> > >         msg = "Simple responce from a simple guy:)"
> > >         xmpp.send_message(user_address, msg)
> > >         return message
>
> > > also if you look at these logs some of them are red or orange
> > > indicating highGAECPU usage, is this normal?
>
> > > regards
> > > Chrism
>
> > >    1.
> > >       10-04 02:18AM 56.352 /_ah/xmpp/message/chat/ 200 98ms 149cpu_ms
> > > 90api_cpu_ms 0kb Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:
> > > 1.9.1.2) Gecko/20090729 Firefox/3.5.2 (.NET CLR 3.5.30729),gzip(gfe)
> > >       See details
>
> > >       92.251.156.137 - chrisjmurray3 [04/Oct/2009:02:18:56 -0700]
> > > "GET /_ah/xmpp/message/chat/ HTTP/1.1" 200 300 - "Mozilla/5.0
> > > (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1.2) Gecko/20090729 Firefox/
> > > 3.5.2 (.NET CLR 3.5.30729),gzip(gfe)"
>
> > > #
>
> > >    1. IN RED
> > >       10-04 01:55AM 23.960 /_ah/xmpp/message/chat/ 200 590ms 881cpu_ms
> > > 131api_cpu_ms 0kb
> > >       See details
>
> > >       0.1.0.10 - - [04/Oct/2009:01:55:24 -0700] "POST /_ah/xmpp/
> > > message/chat/ HTTP/1.1" 200 278 - - "testhogg.appspot.com"
>
> > >    2.
> > >       W 10-04 01:55AM 24.081
>
> > >       no file locking
>
> > >    3.
> > >       D 10-04 01:55AM 24.316
>
> > >       no sqlite3 or pysqlite2.dbapi2 driver
>
> > >    4.
> > >       D 10-04 01:55AM 24.320
>
> > >       no MySQLdb driver
>
> > >    5.
> > >       D 10-04 01:55AM 24.323
>
> > >       no psycopg2 driver
>
> > >    6.
> > >       D 10-04 01:55AM 24.327
>
> > >       no cx_Oracle driver
>
> > >    7.
> > >       D 10-04 01:55AM 24.332
>
> > >       no MSSQL/DB2 driver
>
> > >    8.
> > >       D 10-04 01:55AM 24.337
>
> > >       no kinterbasdb driver
>
> > >    9.
> > >       D 10-04 01:55AM 24.342
>
> > >       no informixdb driver
>
> > >   10.
> > >       D 10-04 01:55AM 24.349
>
> > >       no zxJDBC driver
>
> > >   11.
> > >       W 10-04 01:55AM 24.378
>
> > >       unable to import dbhash
>
> > >   12.
> > >       W 10-04 01:55AM 24.421
>
> > >       unable to import wsgiserver
> > > IN ORANGE*
> > > #
> > > 10-04 02:01AM 15.007 /_ah/xmpp/message/chat/ 200 1622ms 978cpu_ms
> > > 131api_cpu_ms 0kb
> > > See details
>
> > 

[web2py:32376] Re: how to import html helpers inside a module?

2009-10-07 Thread Jon Romero

ok, I've imported gluon.html but now it seems there is another
different error.

I am creating a country widget (it will display all countries in a
dropdown box).

So, in my db.py I have this:
from applications.appname.modules.countries import *
db.shipping_info.countries.widget = countries_widget

and in countries.py

from gluon.html import *
COUNTRIES=['United States', 'Afghanistan', ...]
def countries_widget(field, value):
return SELECT(COUNTRIES, _id=0)

and I get this error:
File "/home/darksun4/Sources/web2py/gluon/sqlhtml.py", line 595, in
__init__
inp = field.widget(field, default)
  File "/home/darksun4/Sources/web2py/applications/myapp/modules/
countries.py", line 4, in countries_widget
AttributeError: 'list' object has no attribute 'options'

If I place my widget code in db.py, everything works ok.

Also, what do you think about a db field, countries? Should I commit
something like that?

On Oct 7, 2:44 pm, Jon Romero  wrote:
> I have created a module (inside my application/modules) and I use
> SELECT.
> I tried importing gluon.tools but no go. All I get is this error:
>
> NameError: global name 'SELECT' is not defined
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32375] how to import html helpers inside a module?

2009-10-07 Thread Jon Romero

I have created a module (inside my application/modules) and I use
SELECT.
I tried importing gluon.tools but no go. All I get is this error:

NameError: global name 'SELECT' is not defined
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32374] Re: A simple patch to provide upload progress

2009-10-07 Thread AndCycle

oops, the patch been cut by width restriction on mailing list lol

here is pastebin
http://pastebin.com/f219d603b
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32373] A simple patch to provide upload progress

2009-10-07 Thread AndCycle

after read over this "thread [web2py:23034] Upload progress"
http://www.mail-archive.com/web2py@googlegroups.com/msg13111.html

I have looks around how other web framework done this,

in pylons's way, this require a WSGI middleware and URLmap,
unfortunately URLmap is impossible for web2py,
and wrap middleware like "gp.fileupload" or insert filer in cherrypy
also require lot's of hack,

in django's way, it hooks handler at input chain, which web2py doesn't
have,
but it just store the upload progress in cache, which is possible for
web2py,
so I made the patch to proof this works

I just made a proof of concept to provide upload progress,

part of code and idea taken from django snippets with some
modification
http://www.djangosnippets.org/snippets/678
http://www.djangosnippets.org/snippets/679/

here is the major part



--- web2py-orig/main.py 2009-09-22 09:07:52.0 +0800
+++ web2py/main.py  2009-10-07 16:07:55.0 +0800
@@ -335,6 +335,51 @@

 if request.env.content_length:
 request.body = tempfile.TemporaryFile()
+def copystream(
+src,
+dest,
+size,
+chunk_size=10 ** 5,
+):
+"""
+original from fileutils,
+this is a hacking for progress upload status,
+"""
+import time
+progressCache = True
+try:
+cache_key = 'X-Progress-ID:'+request.get_vars
['X-Progress-ID']
+except KeyError:
+progressCache = False
+if progressCache:
+from cache import Cache
+cache = Cache(request)
+cache.ram(cache_key+':length', lambda: size,
0)
+cache.ram(cache_key+':uploaded', lambda: 0,
0)
+while size > 0:
+if size < chunk_size:
+data = src.read(size)
+if progressCache:
+cache.ram.increment(cache_key
+':uploaded', size)
+else:
+data = src.read(chunk_size)
+if progressCache:
+cache.ram.increment(cache_key
+':uploaded', chunk_size)
+length = len(data)
+if length > size:
+(data, length) = (data[:size], size)
+size -= length
+if length == 0:
+break
+dest.write(data)
+if length < chunk_size:
+break
+dest.seek(0)
+if progressCache:
+cache.ram(cache_key+':length', None)
+cache.ram(cache_key+':uploaded', None)
+return
 copystream(request.env.wsgi_input, request.body,
int(request.env.content_length))
 else:


maybe just wrap wsgi_input will make it pretty,

next is how to use it,

at controller, just require a function to respond json

def post():
#I need a from, give me give me
return dict(form=crud.create(db.foo_table))

@service.jsonrpc
def progress_report_by_id():
cache_key = 'X-Progress-ID:'+request.get_vars['X-Progress-ID']
return dict(
length=cache.ram(cache_key+':length', lambda: 0, None),
uploaded=cache.ram(cache_key+':uploaded', lambda: 0,
None),
)



at view you can do whatever you want,
this one is post.html for post function up there,

or just take javascript snippet part,

watch out "var progress_url",
you have to modify this to match your app/controller/function
somewhere

{{extend 'layout.html'}}

// Generate 32 char random uuid
function gen_uuid() {
var uuid = ""
for (var i=0; i < 32; i++) {
uuid += Math.floor(Math.random() * 16).toString(16);
}
return uuid
}

// Add upload progress for multipart forms.
$(function() {
$('form[enctype=multipart/form-data]').submit(function(){
// Prevent multiple submits
if ($.data(this, 'submitted')) return false;

var freq = 1000; // freqency of update in ms
var uuid = gen_uuid(); // id for this upload so we can fetch
progress info.
var progress_url = /poc/default/
progress_report_by

[web2py:32372] Re: Try out admin editor

2009-10-07 Thread Iceberg

Looks like the problem is already addressed 3 weeks ago. But I did not
find a file named keyboard.js in our web2py admin.

  
http://sourceforge.net/projects/editarea/forums/forum/556921/topic/3381727?message=7631764

On Oct7, 11:24am, mdipierro  wrote:
> Can you send me a patch?
>
> On Oct 6, 7:30 am, Kuba Kucharski  wrote:
>
>
>
> > Still the main problem with admin editor is this
> > wrong-refreshing/wrong-displaying trauma - never solved or did I miss smth ?
>
> > On Oct 5, 2009 3:47 AM, "Iceberg"  wrote:
>
> > Did not really try the admin editor until recently. Nice as a handy
> > tool for some quick typing, the only inconvenience is the lack of ctrl
> > +s shortcut to save a file. Is it possible to add this feature? Since
> > I notice the ctrl+f etc can work.
>
> > BTW, the word_wrap.gif icon is missing in the toolbar.
>
> > Regards,
> > Iceberg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32371] Internal Error in Administrative Interface

2009-10-07 Thread Sujan Shakya

I just checked out the web2py source from code.google.com.
Then I ran 'python web2py.py -a mypassword'
Then I visited http://127.0.0.1:8000/. This shows the welcome page.
But when I clicked on 'click here for the administrative interface'
link, I got 'Internal Error Ticket Issued' page. Clicking on the
ticket link opened another 'Internal Error' page.

Am I missing something ?

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32370] most wanted aunties with young boys

2009-10-07 Thread stella m

most wanted aunties with young boys
Free 21 age sex movies and Photos downloading


CUTE AUNTY AFTER BATHING & BEAUTIFUL GIRLS VIDEO COLLECTIONS
PleaseVisit.
CREATE FREE MEMBERSHIP ACCOUNT. OTHER DETAILS LOG ON TO
**
 http://www.AWSurveys.com/HomeMain.cfm?RefID=thmlsel
**

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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:32369] Re: Google app engine retrieve data from related table

2009-10-07 Thread Michael - afewtips.com

Thanks - I will also check out ListProperty

On Oct 6, 8:56 pm, Robin B  wrote:
> If you want to keep it normalized, and the intersection is less than
> 1000 entities, and joined by a primary key (ID), use a batch get, to
> fetch all the join items in parallel.
>
> If you are going to de-normalize, take a look at google ListProperty.
>
> Robin
>
> On Oct 6, 9:59 am, "Michael - afewtips.com" 
> wrote:
>
> > What if it's 9 fields? (Just Kidding).
>
> > Thanks -
>
> > I think I will retain the normalized form and possibly create a
> > function that scans a table
> > that maintains the relationships between tables with the table names
> > and key fields so I don't have to deal with updating the names and
> > queries
> > everywhere every time I add or remove a table or key field.
> > Creating the record from all related tables one table at a time. A
> > kind of data dispatch.
>
> > On Oct 6, 10:19 am, mdipierro  wrote:
>
> > > It depends on how many you need per page. If more than 10 I would use
> > > option 1 (denormalize) and if less than 10 I would go with option 2. I
> > > just made up the number 10.
>
> > > On Oct 6, 8:38 am, "Michael - afewtips.com" 
> > > wrote:
>
> > > > I understand that inner joins on GAE are not allowed, so what is the
> > > > best practice for
> > > > retrieving data from related tables?
>
> > > > Forget normalizing and just add the related data to the record when
> > > > the record is added?
>
> > > > or
>
> > > > Keep the data normalized and every time I need to show the data for a
> > > > bicycle, go get the brand name from the brands table?
>
> > > > How do most get around the no inner join limitation?
>
> > > > Thanks
> > > > Michael
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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
-~--~~~~--~~--~--~---