Re: [web2py] Re: googling web2py

2010-03-29 Thread Nicol van der Merwe
South Africa:

Results *1* - *10* of about *109,000* for *web2py


*
On Mon, Mar 29, 2010 at 5:11 AM, Vidul Petrov  wrote:

> 109,000 from Bulgaria
>
>
> On Mar 28, 3:23 am, mdipierro  wrote:
> > When you google "web2py" how may hits do you get? from which country?
> >
> > When I do it from the US I get ~106,000. The number has been steady
> > for one year. Before that is was much higher ~600,000.
> >
> > When I did it from India the number was about ~550,000.
> >
> > Not that the number means anything but I am interested in building
> > some statistics from different countries.
> >
> > Massimo
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@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.
>
>


-- 
If we hit that bullseye, the rest of the dominoes should fall like a house
of cards. Checkmate.  -Z. Brannigan

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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] appliance typo

2010-03-29 Thread hamdy.a.farag
Hi

in the appliacnce 'appliances'

http://web2py.com/appliances/default/show/4

 there's a typo in appadmin.py line 125

except: reponse.flash='unable to parse csv file'  should be except:
response.flash='unable to parse csv file'

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: googling web2py

2010-03-29 Thread guruyaya
109K in ISR

On Mar 28, 4:23 am, mdipierro  wrote:
> When you google "web2py" how may hits do you get? from which country?
>
> When I do it from the US I get ~106,000. The number has been steady
> for one year. Before that is was much higher ~600,000.
>
> When I did it from India the number was about ~550,000.
>
> Not that the number means anything but I am interested in building
> some statistics from different countries.
>
> Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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] problem with belongs

2010-03-29 Thread pacopyc
Hi, I've a problem with belongs. I've a page with a list of checkbox
(dog, cat, mouse, ...). For example If I choose dog and cat I'd like
execute:

select * from table where field in ('dog', 'cat')

I've written this code:

animals = request.vars.animals
res = db(db.table.field.belongs(animals)).select(db.table.ALL)

This works very good!!!
But If I choose only dog (for example) the code don't work. If I print
sql query I get this

select * from table where field in (do)

There aren't characters " ' " and last letter " g ". I don't
understand. Can you help me?

Thank you very much

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: googling web2py

2010-03-29 Thread Christopher Steel
Canada with various language settings:

Google Site : http://www.google.ca/
Language: fr-ca
Total   : 109,000
Generated URL   :
http://www.google.ca/#hl=fr&source=hp&q=web2py&meta=&aq=f&aqi=g3&aql=&oq=&gs_rfai=&fp=73cab96ac3bd1594

Google Site : http://www.google.ca/
Language: fr
Total   : 109,000
Generated URL   :
http://www.google.ca/#hl=fr&source=hp&q=web2py&meta=&aq=f&aqi=g3&aql=&oq=&gs_rfai=&fp=73cab96ac3bd1594

Google Site : http://www.google.ca/
Language: en-ca
Total   : 107,000
Generated URL   :
http://www.google.ca/#hl=en&source=hp&q=web2py&meta=&aq=f&aqi=g10&aql=&oq=&gs_rfai=&fp=4692a3ff86a6f392

Google Site : http://www.google.ca/
Language: en
Total   : 107,000
Generated URL   :
http://www.google.ca/#hl=en&source=hp&q=web2py&meta=&aq=f&aqi=g10&aql=&oq=&gs_rfai=&fp=4692a3ff86a6f392

Google Site : http://www.google.ca/
Language: en-us
Total   : 107,000
Generated URL   :
http://www.google.ca/#hl=en&source=hp&q=web2py&meta=&aq=f&aqi=g10&aql=&oq=&gs_rfai=&fp=4692a3ff86a6f392

On 28 mar, 17:44, Zphen  wrote:
> 655,000 from Australia...
>
> On Mar 28, 12:23 pm, mdipierro  wrote:
>
> > When you google "web2py" how may hits do you get? from which country?
>
> > When I do it from the US I get ~106,000. The number has been steady
> > for one year. Before that is was much higher ~600,000.
>
> > When I did it from India the number was about ~550,000.
>
> > Not that the number means anything but I am interested in building
> > some statistics from different countries.
>
> > Massimo

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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] Running DAL oustide web2py

2010-03-29 Thread Giovanni Giorgi
Hi all,
 there is a simple way to run DAL oustide web2py?
I need to write a script to access to the DB using the web2py model,
something like

import myappmodel
import DAL
[...otherstuff...]


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

Where can I find an example?
Thank you!



-- 
Software Architect / Team Leader
http://Gioorgi.com

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: problem with belongs

2010-03-29 Thread pacopyc
With this code works, but I don't like this:

if type(animals) == str:
  res = db(db.table.field==animals).select(db.table.ALL)
else:
  res = db(db.table.field.belongs(animals)).select(db.table.ALL)

Can you say me a better method?

Thank you

On 29 Mar, 13:29, pacopyc  wrote:
> Hi, I've a problem with belongs. I've a page with a list of checkbox
> (dog, cat, mouse, ...). For example If I choose dog and cat I'd like
> execute:
>
> select * from table where field in ('dog', 'cat')
>
> I've written this code:
>
> animals = request.vars.animals
> res = db(db.table.field.belongs(animals)).select(db.table.ALL)
>
> This works very good!!!
> But If I choose only dog (for example) the code don't work. If I print
> sql query I get this
>
> select * from table where field in (do)
>
> There aren't characters " ' " and last letter " g ". I don't
> understand. Can you help me?
>
> Thank you very much

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: zengarden anybody?

2010-03-29 Thread Christopher Steel
Great!,

I am going to do a little research and then put together some
options / samples. Two other items I am going to look into (which are
also suggested on the ez.css page) are html5 semantics and WAI ARIA
landmark roles. Roles would require a code tweak or flag as some
(most?)  validation sites do not support it yet, html5 I need to look
into a bit more. html 5 is semantic and I am wondering if this could
conflict with our current naming conventions, validation and so
forth.

Anyway it is a great opportunity to check all this stuff out and we
could always we could offer some "unsupported" / "off label" options
that give people more choice while maintaining our compatibility
commitments first adopters in the main. For our organization WAI-ARIA
landmarks is really important.

Cheers,

C.

On 28 mar, 13:39, Yarko Tymciurak  wrote:
> A few points I would make (as I write this, I am aware this probably
> should be moved to the development list):
>
> -  ez.css is no more than a layout / framing convention;
>    -  staying compatible is easy (and it provides simple layout
> control);
>    -  it uses a useful convention of css class nameing, namely:  -
> ,  e.g.:  "ez-wr" -
>       - we should stick with that, ie. something like  "w2p" for all
> web2py named css classes and id selectors;
>         - note: the major difference between
>           - class selectors (.something) and
>           - id selectors (#something) is id selectors can link to a
> part of a page, and javascript uses id selectors;
>
> I'm not sure specifically what Massimo meant by "ez.css and jquery.ui
> naming conventions";  we should get specific about this.
>
> ez has the concept of
> - wrappers, (ez-wr, ez-mr)
> - style containers (i.e. layout containers)
> - content containers (i.e. ez-box)
> - sizing elements;
>
> and more...
>
> jquery has at least these conventions:
> -http://jqueryui.com/docs/Theming/API
> -http://wiki.jqueryui.com/Position
>
> Note that ThemeRoller is a way to apply to PARTS of a user layout,
> e.g.:
>
> - font settings;
> - corner radius;
> - header;
> - toolbar;
> - content;
> - clicables;
> - highlight;
> - errors;
> - modal;
> - drop shadoes;
>
> By combining ez (positioning) and jquery-ui (and staying consistent w/
> themeroller), we should be able to build-up a web2py-unique packaging,
> with potentially useful extensions (e.g. for form layout and theming).
>
> This seems, to me, to be a very promising direction.
>
> - Yarko
> Noteab
>
> On Mar 27, 7:44 pm, mdipierro  wrote:
>
> > I like the idea. It would be ideal if you could do it using ez.css and
> > jquery.ui naming conventions.
>
> > Massimo
>
> > On 27 Mar, 15:23, Christopher Steel  wrote:
>
> > > The Zengarden css code is not "open source" but we can easily create
> > > our own. I am just finishing up a css based theme for a client that
> > > uses div's and flow with a two columns (basically the same appearance
> > > as the current web2py default layout). I would be more than happy to
> > > create on using the current web2py names, images and so forth and can
> > > license it as we like.
>
> > > We could include it as a documented option and give it a name like
> > > base-2c-flow.css or base-tableless.css
> > > Let me know soon cause I am moving on to non css stuff in the next few
> > > days.
>
> > > Cheers,
>
> > > Christopher Steel.
>
> > > On Mar 25, 5:33 am, Benigno  wrote:
>
> > > > @mdmcginn: I do think that having a proven flexible div setup that
> > > > allows for so many different options, is precisely what you need on
> > > > the original layout. What Zengarden does, is prove the flexibility of
> > > > CSS but that flexibility is nothing if your div structure is not
> > > > correctly thought out and matured.
>
> > > > On the minus side, however, and this is my personal opinion, I think
> > > > that most Zengarden designs, are mostly oriented towards blogging,
> > > > news/magazine, or marketing presentations, and not so much about
> > > > enterprise applications. (This might be that I have missed the correct
> > > > layouts). However, I have the same opinion about the other layout
> > > > plugin.
>
> > > > Cheers,
> > > > Benigno.
> > > > On Mar 24, 10:23 am, mdmcginn  wrote:> 
> > > > CSS is great, much better than table-based web design, and
> > > > > csszengarden deserves a lot of credit for demonstrating that. But it
> > > > > is just a proof of concept. As you noted, their basic HTML is full of
> > > > > empty divs into which designers can insert fancy images, so it's not a
> > > > > good base for templates.
>
> > > > > On Mar 22, 9:14 am, Wes James  wrote:
>
> > > > > > On Sat, Mar 20, 2010 at 7:27 PM, mdipierro 
> > > > > >  wrote:
> > > > > > > Just for fun:
>
> > > > > > >  http://web2py.com/zengarden
>
> > > > > > > then click on the [zengarden] link under the menu, under the 
> > > > > > > "index"
> > > > > > > link. You can change the skin per user, per session.
> > > > > > > This is a bare bone welcome app with the layout
>
> >

Re: [web2py] Re: webserver slow, misreported

2010-03-29 Thread Timothy Farrell

Perhaps a simpler set of questions:

Did you have this working with Cherrypy beforehand?
If so, is Rocket the only thing to have changed?

The latest changes to Rocket were committed to the Mercurial web2py repo 
on March 18th.  I'm assuming you've run a checkout since then.


-tim

On 3/28/2010 4:23 PM, mdipierro wrote:

One more thing. You ask

   

But a single process doing complex joins should not slow down
all other simple selects and inserts, right?
 

no, except for sqlite. sqlite serializes all requests because locks
the db. That could explain the 0.20s if you have lots of queries per
request, but not the 54s for the server.

On Mar 28, 4:22 pm, mdipierro  wrote:
   

On Mar 28, 3:46 pm, Michael Toomim  wrote:

 

Any idea why there is a discrepancy between Firebug and
httpserver.log?
   

httpserver.log logs the time spend in web2py, not including the time
for sending and receiving the http request/response.
firebug logs the the total time, including time spend by the web
server for communication.

 

I am using postgresql.  What would indicate "model complexity"?  I
have around 9 tables, but most of the requests just do single-object
selects and inserts.  No complex joins are in public-facing pages, but
myself as an administrator periodically load a page that does big
joins.  But a single process doing complex joins should not slow down
all other simple selects and inserts, right?
   

In your case there are two problems (and I do not know what causes
them):
1) web2py is taking  0.20seconds to process a response. That is more
than 10 times what it should be.
2) the communication between the web server and the browser takes very
very long time.

Is the server on localhost? If not this could be a network issue.

 

On Mar 27, 6:48 am, mdipierro  wrote:
   
 

Mind that if you use sqlite there is no concurrency. Still these
numbers are very low.
Are your models very complex?
 
 

On 27 Mar, 00:06, Michael Toomim  wrote:
 
 

I'm using web2py+rocket to serve jobs on mechanical turk. The server
probably gets a hit per second or so by workers on mechanical turk
using it.
   
 

When I have no users, everything is fast. But in active use, I notice
that web pages often load reay slow in my web browser, but the
httpserver.log file reports only small times.
   
 

For instance, I just loaded a page that httpserver.log said took
0.20 seconds, but Firebug said took 54.21 seconds. That's a big
difference. Any idea what's going on? I guess I'll have to try apache?
   
   


--
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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] Some thing wrong when IS_IN_SET contains Chinease characters

2010-03-29 Thread hywang
model file like this ---
db.define_table('options_contain_chinease',
Field('student_name', requires = IS_IN_SET(["小王","小长","老李"])),
)
db.table_contain_chinease.student_name.widget =
CheckboxesWidget.widget


-controller file like this -
def test_chinease():
form = SQLFORM(db.options_contain_chinease)
if form.accepts(request.vars, session):
pass
return dict(form=form)

when  select an item and submit the form, an error will occur. Maybe
web2py can't deal with Chinease character correctly.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: Some thing wrong when IS_IN_SET contains Chinease characters

2010-03-29 Thread hywang
Sorry,
  db.table_contain_chinease.student_name.widget =
CheckboxesWidget.widget
should be :
 db.options_contain_chinease.student_name.widget =
CheckboxesWidget.widget

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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] Something is wrong when IS_IN_SET contains Chinease characters

2010-03-29 Thread hywang
---model file is like this -
db.define_table('options_contain_chinease',
Field('student_name', requires = IS_IN_SET(["Jim","小长","老李"])),
)
db.options_contain_chinease.student_name.widget =
CheckboxesWidget.widget

--controller file is like this -
def options_contain_chinease():
form = SQLFORM(db.options_contain_chinease)
if form.accepts(request.vars, session):
pass
return dict(form=form)

if checked one item and submit, everything is ok, however, when
checked more than one items and submit the form, an error will occur .
Is it a bug ?

thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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] Something is wrong when IS_IN_SET contains Chinease characters

2010-03-29 Thread hywang
---model file is like this -
db.define_table('options_contain_chinease',
Field('student_name', requires = IS_IN_SET(["Jim","小长","老李"],
multiple=True)),
)
db.options_contain_chinease.student_name.widget =
CheckboxesWidget.widget

--controller file is like this -
def options_contain_chinease():
form = SQLFORM(db.options_contain_chinease)
if form.accepts(request.vars, session):
pass
return dict(form=form)

if checked one item and submit, everything is ok, however, when
checked more than one items and submit the form, an error will occur .
Is it a bug ?

thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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] Help with a query

2010-03-29 Thread Jose
Given:

db.define_table('t1',
Field('f11'),
Field('f12', 'integer'),
)

db.define_table('t2',
Field('f21'),
Field('f22', db.t1),
)


I make this query [1] (I see that you can not) but without using a
subselect

[1]
qry1 = (db.t2.f22.f12 == 10)
rows = db(qry1).select(db.t2.ALL)

How would be the simplest way to query?

Jose

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: Something is wrong when IS_IN_SET contains Chinease characters

2010-03-29 Thread hywang
There is something wrong with validators.py in line 289
values = re.compile("[\w\-:]+").findall(str(value))
if I change it with
values = value
everything is ok

Maybe it's a bug

On 3月29日, 下午9时33分, hywang  wrote:
> ---model file is like this -
> db.define_table('options_contain_chinease',
> Field('student_name', requires = IS_IN_SET(["Jim","小长","老李"],
> multiple=True)),
> )
> db.options_contain_chinease.student_name.widget =
> CheckboxesWidget.widget
>
> --controller file is like this -
> def options_contain_chinease():
> form = SQLFORM(db.options_contain_chinease)
> if form.accepts(request.vars, session):
> pass
> return dict(form=form)
>
> if checked one item and submit, everything is ok, however, when
> checked more than one items and submit the form, an error will occur .
> Is it a bug ?
>
> thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: zengarden anybody?

2010-03-29 Thread Yarko Tymciurak
Careful -

HTML5 is behind schedule, and expected to reach standard stage in 2022
(?!)...

Hoewever, the new canvas element is supported already (so that flash /
silverlight, etc. isn't needed) --- and IE-9 might even do will with
this (the preview is out now - it seems pretty fast).

I woulnd't worry about too much more than what everyone else is
expecting in HTML-5:  the things browsers broadly support now, and are
useful (i.e. the canvas element, and more solid svg support, among
them).

- Yarko

On Mar 29, 7:38 am, Christopher Steel  wrote:
> Great!,
>
> I am going to do a little research and then put together some
> options / samples. Two other items I am going to look into (which are
> also suggested on the ez.css page) are html5 semantics and WAI ARIA
> landmark roles. Roles would require a code tweak or flag as some
> (most?)  validation sites do not support it yet, html5 I need to look
> into a bit more. html 5 is semantic and I am wondering if this could
> conflict with our current naming conventions, validation and so
> forth.
>
> Anyway it is a great opportunity to check all this stuff out and we
> could always we could offer some "unsupported" / "off label" options
> that give people more choice while maintaining our compatibility
> commitments first adopters in the main. For our organization WAI-ARIA
> landmarks is really important.
>
> Cheers,
>
> C.
>
> On 28 mar, 13:39, Yarko Tymciurak  wrote:
>
> > A few points I would make (as I write this, I am aware this probably
> > should be moved to the development list):
>
> > -  ez.css is no more than a layout / framing convention;
> >    -  staying compatible is easy (and it provides simple layout
> > control);
> >    -  it uses a useful convention of css class nameing, namely:  -
> > ,  e.g.:  "ez-wr" -
> >       - we should stick with that, ie. something like  "w2p" for all
> > web2py named css classes and id selectors;
> >         - note: the major difference between
> >           - class selectors (.something) and
> >           - id selectors (#something) is id selectors can link to a
> > part of a page, and javascript uses id selectors;
>
> > I'm not sure specifically what Massimo meant by "ez.css and jquery.ui
> > naming conventions";  we should get specific about this.
>
> > ez has the concept of
> > - wrappers, (ez-wr, ez-mr)
> > - style containers (i.e. layout containers)
> > - content containers (i.e. ez-box)
> > - sizing elements;
>
> > and more...
>
> > jquery has at least these conventions:
> > -http://jqueryui.com/docs/Theming/API
> > -http://wiki.jqueryui.com/Position
>
> > Note that ThemeRoller is a way to apply to PARTS of a user layout,
> > e.g.:
>
> > - font settings;
> > - corner radius;
> > - header;
> > - toolbar;
> > - content;
> > - clicables;
> > - highlight;
> > - errors;
> > - modal;
> > - drop shadoes;
>
> > By combining ez (positioning) and jquery-ui (and staying consistent w/
> > themeroller), we should be able to build-up a web2py-unique packaging,
> > with potentially useful extensions (e.g. for form layout and theming).
>
> > This seems, to me, to be a very promising direction.
>
> > - Yarko
> > Noteab
>
> > On Mar 27, 7:44 pm, mdipierro  wrote:
>
> > > I like the idea. It would be ideal if you could do it using ez.css and
> > > jquery.ui naming conventions.
>
> > > Massimo
>
> > > On 27 Mar, 15:23, Christopher Steel  wrote:
>
> > > > The Zengarden css code is not "open source" but we can easily create
> > > > our own. I am just finishing up a css based theme for a client that
> > > > uses div's and flow with a two columns (basically the same appearance
> > > > as the current web2py default layout). I would be more than happy to
> > > > create on using the current web2py names, images and so forth and can
> > > > license it as we like.
>
> > > > We could include it as a documented option and give it a name like
> > > > base-2c-flow.css or base-tableless.css
> > > > Let me know soon cause I am moving on to non css stuff in the next few
> > > > days.
>
> > > > Cheers,
>
> > > > Christopher Steel.
>
> > > > On Mar 25, 5:33 am, Benigno  wrote:
>
> > > > > @mdmcginn: I do think that having a proven flexible div setup that
> > > > > allows for so many different options, is precisely what you need on
> > > > > the original layout. What Zengarden does, is prove the flexibility of
> > > > > CSS but that flexibility is nothing if your div structure is not
> > > > > correctly thought out and matured.
>
> > > > > On the minus side, however, and this is my personal opinion, I think
> > > > > that most Zengarden designs, are mostly oriented towards blogging,
> > > > > news/magazine, or marketing presentations, and not so much about
> > > > > enterprise applications. (This might be that I have missed the correct
> > > > > layouts). However, I have the same opinion about the other layout
> > > > > plugin.
>
> > > > > Cheers,
> > > > > Benigno.
> > > > > On Mar 24, 10:23 am, mdmcginn  wrote:> 
> > > > > CSS is great, much better t

[web2py] Re: Something is wrong when IS_IN_SET contains Chinease characters

2010-03-29 Thread Yarko Tymciurak
On Mar 29, 8:45 am, hywang  wrote:
> There is something wrong with validators.py in line 289
> values = re.compile("[\w\-:]+").findall(str(value))
> if I change it with
> values = value
> everything is ok
>
> Maybe it's a bug

I do not know - but to help you along a little:

See the description of \w on http://docs.python.org/library/re.html

You can quickly reproduce this same effect (at least I did) with
http://www.pythonregex.com/

Can you try this and see if it works:

values = re.compile("[\w\-:]+", re.UNICODE).findall(str(value),
re.UNICODE)

Regards,
- Yarko


>
> On 3月29日, 下午9时33分, hywang  wrote:
>
> > ---model file is like this -
> > db.define_table('options_contain_chinease',
> > Field('student_name', requires = IS_IN_SET(["Jim","小长","老李"],
> > multiple=True)),
> > )
> > db.options_contain_chinease.student_name.widget =
> > CheckboxesWidget.widget
>
> > --controller file is like this -
> > def options_contain_chinease():
> > form = SQLFORM(db.options_contain_chinease)
> > if form.accepts(request.vars, session):
> > pass
> > return dict(form=form)
>
> > if checked one item and submit, everything is ok, however, when
> > checked more than one items and submit the form, an error will occur .
> > Is it a bug ?
>
> > thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: zengarden anybody?

2010-03-29 Thread Yarko Tymciurak
On Mar 29, 8:57 am, Yarko Tymciurak 
wrote:
> Careful -
>
> HTML5 is behind schedule, and expected to reach standard stage in 2022
> (?!)...
>
> Hoewever, the new canvas element is supported already

... that is, supported by many browsers already;  if we are going to
add any new, bleeding edge elements, a couple of things:

*  their definition / implimentation (behavior) in browsers may
change;
*  anything that web2py supports will need to gracefully "fall
back" (at least to the app writer) when something isn't supported

...or we can make selective, incremental support of aspects of HTML5
optional;

WRT to skinning / css, what are your thoughts?   Did you want to try
DOM scripting?  ... not really sure how / why html5 needs to affect
skinning (yet).

(just thinking out loud),
- Yarko

> (so that flash /
> silverlight, etc. isn't needed) --- and IE-9 might even do will with
> this (the preview is out now - it seems pretty fast).
>
> I woulnd't worry about too much more than what everyone else is
> expecting in HTML-5:  the things browsers broadly support now, and are
> useful (i.e. the canvas element, and more solid svg support, among
> them).
>
> - Yarko
>
> On Mar 29, 7:38 am, Christopher Steel  wrote:
>
> > Great!,
>
> > I am going to do a little research and then put together some
> > options / samples. Two other items I am going to look into (which are
> > also suggested on the ez.css page) are html5 semantics and WAI ARIA
> > landmark roles. Roles would require a code tweak or flag as some
> > (most?)  validation sites do not support it yet, html5 I need to look
> > into a bit more. html 5 is semantic and I am wondering if this could
> > conflict with our current naming conventions, validation and so
> > forth.
>
> > Anyway it is a great opportunity to check all this stuff out and we
> > could always we could offer some "unsupported" / "off label" options
> > that give people more choice while maintaining our compatibility
> > commitments first adopters in the main. For our organization WAI-ARIA
> > landmarks is really important.
>
> > Cheers,
>
> > C.
>
> > On 28 mar, 13:39, Yarko Tymciurak  wrote:
>
> > > A few points I would make (as I write this, I am aware this probably
> > > should be moved to the development list):
>
> > > -  ez.css is no more than a layout / framing convention;
> > >    -  staying compatible is easy (and it provides simple layout
> > > control);
> > >    -  it uses a useful convention of css class nameing, namely:  -
> > > ,  e.g.:  "ez-wr" -
> > >       - we should stick with that, ie. something like  "w2p" for all
> > > web2py named css classes and id selectors;
> > >         - note: the major difference between
> > >           - class selectors (.something) and
> > >           - id selectors (#something) is id selectors can link to a
> > > part of a page, and javascript uses id selectors;
>
> > > I'm not sure specifically what Massimo meant by "ez.css and jquery.ui
> > > naming conventions";  we should get specific about this.
>
> > > ez has the concept of
> > > - wrappers, (ez-wr, ez-mr)
> > > - style containers (i.e. layout containers)
> > > - content containers (i.e. ez-box)
> > > - sizing elements;
>
> > > and more...
>
> > > jquery has at least these conventions:
> > > -http://jqueryui.com/docs/Theming/API
> > > -http://wiki.jqueryui.com/Position
>
> > > Note that ThemeRoller is a way to apply to PARTS of a user layout,
> > > e.g.:
>
> > > - font settings;
> > > - corner radius;
> > > - header;
> > > - toolbar;
> > > - content;
> > > - clicables;
> > > - highlight;
> > > - errors;
> > > - modal;
> > > - drop shadoes;
>
> > > By combining ez (positioning) and jquery-ui (and staying consistent w/
> > > themeroller), we should be able to build-up a web2py-unique packaging,
> > > with potentially useful extensions (e.g. for form layout and theming).
>
> > > This seems, to me, to be a very promising direction.
>
> > > - Yarko
> > > Noteab
>
> > > On Mar 27, 7:44 pm, mdipierro  wrote:
>
> > > > I like the idea. It would be ideal if you could do it using ez.css and
> > > > jquery.ui naming conventions.
>
> > > > Massimo
>
> > > > On 27 Mar, 15:23, Christopher Steel  wrote:
>
> > > > > The Zengarden css code is not "open source" but we can easily create
> > > > > our own. I am just finishing up a css based theme for a client that
> > > > > uses div's and flow with a two columns (basically the same appearance
> > > > > as the current web2py default layout). I would be more than happy to
> > > > > create on using the current web2py names, images and so forth and can
> > > > > license it as we like.
>
> > > > > We could include it as a documented option and give it a name like
> > > > > base-2c-flow.css or base-tableless.css
> > > > > Let me know soon cause I am moving on to non css stuff in the next few
> > > > > days.
>
> > > > > Cheers,
>
> > > > > Christopher Steel.
>
> > > > > On Mar 25, 5:33 am, Benigno  wrote:
>
> > > > > > @mdmcginn: I do think that having a proven flex

[web2py] Re: how to troubleshoot admin errors?

2010-03-29 Thread ciastek
I've had the same problem ("unable to create application") on Ubuntu
JeOS 8.04.3 configured as shown at http://vimeo.com/10377947 [
web2py production deployment on vps.net (VIDEO) by mdipierro].
Ubuntu fully upgraded, web2py installed using setup-web2py-ubuntu.sh
script.
Running web2py from console once, resolved the problem.
IMHO the source of problem is absence of web2py/deposit and web2py/
site-packages directories.
mdipierro - web2py rox! :)
-- ciastek

On Mar 22, 4:01 am, KMax  wrote:
> Hello
>   My web2py instalation (1.73 and newer) was affected by the same
> issue.
>   Running on debian by wsgi apache2. Installed by unzipping
> web2py_src.zip in to fresh folder and coping parameters_443.py.
>   Creation of newapplicationgive an error flash "unabletocreateapplication."
>
>   Workaround was found accidently.
>   Starting web2py.by at console ( typing pass and quit ) solve issue
> at apache.
>
> Thank you.
> On 3 ÍÁÒ, 00:13, snfctech  wrote:
>
> > Fedora10 web2py1.76.1 apache2/mod_wsgi
>
> > I thought all errors generated tickets? šWhen I try tocreatean app
> > via the admin over HTTPS on a LAN all I get is an error flash "unable
> > tocreateapplication." šIt's not an apache permission issue because
> > it does the same thing if all my files and dirs have 777 permissions.
> > I don't get any apache errors in the error log and the only funny
> > thing I get in the access log is a 303 code from the POST request to
> > admin/default/site. šSomething must not be working out with
> > gluon.admin.app_create.
>
> > How should I troubleshoot this type of error, or does anybody have an
> > idea what's going on?
>
> > I'm going to start dissecting the app_create function - but my python
> > skills are still pretty weak and I was hoping there would just be a
> > good error log somewhere...
>
> > Thanks in advance for any tips.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: Running DAL oustide web2py

2010-03-29 Thread rfx_labs
Hi Giovanni,

I had the same problem and here is my simple solution:

model.py:
from gluon.dal import DAL, Field

db = DAL("sqlite://storage.db")

db.define_table("reference",
  Field("name", "string", notnull=True),
  Field("L", "double"),
  Field("a", "double"),
  Field("b", "double"))

myApp.py:
from model import db

rows = db().select(db.reference.ALL)

for row in rows:
print row.name, row.L, row.a, row.b, "\n"

If you want to use a model file from a existing web2py application
without adding the import statement (from gluon.dal import DAL,
Field). You could import the model like this:

model.py:
db = DAL("sqlite://storage.db")

db.define_table("reference",
  Field("name", "string", notnull=True),
  Field("L", "double"),
  Field("a", "double"),
  Field("b", "double"))

myApp.py:
from gluon.dal import DAL, Field

model = open("/Users/mhufsky/Desktop/model.py", "rb")
exec model
model.close()

rows = db().select(db.reference.ALL)

for row in rows:
print row.name, row.L, row.a, row.b, "\n"

In my app I prefer the import method.

Hint: To get same output you should first insert something to the db.
Hint2: The db is stored in the working directory. You could specify a
other folder relative to the working dir or absolute (starting
with /):
db = DAL("sqlite://storage.db", folder="/path/to/Folder")


Martin

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: Something is wrong when IS_IN_SET contains Chinease characters

2010-03-29 Thread Yarko Tymciurak

On Mar 29, 8:33 am, hywang  wrote:
> ---model file is like this -
> db.define_table('options_contain_chinease',
> Field('student_name', requires = IS_IN_SET(["Jim","小长","老李"],
> multiple=True)),

Using this last string from your IS_IN_SET example (I hope my copy/
paste did this correctly into iPython!):

In [31]: value=r"老李"
In [32]: value
Out[32]: '\xe8\x80\x81\xe6\x9d\x8e'
In [33]: str(value)
Out[33]: '\xe8\x80\x81\xe6\x9d\x8e'
In [34]: re.compile(r"[\w\-:]+").findall(value)
Out[34]: []
In [35]: re.compile(r"[\w\-:]+").findall(value, re.U)
Out[35]: []
In [36]: re.compile(r"[\w\-:]+",re.U).findall(value)
Out[36]: ['\xe8', '\xe6']
In [37]: re.compile(r"[\w\-:]+",re.U).findall(value,re.U)
Out[37]: []

--->

So it would seem you may need to setup something with LOCALE;  I have
played around with this for just a little bit, but am not sure what it
takes (zh-CN?  zh-cn?  zh_CN.gb2312?   etc.)

Maybe others can add to this...

Regards,
- Yarko

> )
> db.options_contain_chinease.student_name.widget =
> CheckboxesWidget.widget
>
> --controller file is like this -
> def options_contain_chinease():
> form = SQLFORM(db.options_contain_chinease)
> if form.accepts(request.vars, session):
> pass
> return dict(form=form)
>
> if checked one item and submit, everything is ok, however, when
> checked more than one items and submit the form, an error will occur .
> Is it a bug ?
>
> thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: how to troubleshoot admin errors?

2010-03-29 Thread Yarko Tymciurak
On Mar 29, 9:27 am, ciastek  wrote:
> I've had the same problem ("unable to create application") on Ubuntu
> JeOS 8.04.3 configured as shown athttp://vimeo.com/10377947[
> web2py production deployment on vps.net (VIDEO) by mdipierro].
> Ubuntu fully upgraded, web2py installed using setup-web2py-ubuntu.sh
> script.
> Running web2py from console once, resolved the problem.

Just to be sure there is not mystery / this is clear:

When you start web2py from the console with no arguments, you are
asked to config various things (port, admin password);
You can also do this from the command line (in which case, no config-
gui comes up prior to starting the built-in server).

When you run from other than the built-in server, there is no setup:
the port and admin password must exist _somewhere_!

The way you create this information is to run from the console "once"
- because what this does is create a file:
parameters_{port_number}.py, which is then used at startup.

So (for example):

$ python web2py.py -a 'hello'

will create  parameters_80.py   (the default port is 80).

You can edit, or copy this file - if you want to use the same
password, but on port 432, just copy this file (for example) to:
parameters_432.py

In any case, the parameters file is used to supply "command-line"
parameters when not running from the command line.

Hope this takes the mystery out of it.

Regards,
Yarko
> IMHO the source of problem is absence of web2py/deposit and web2py/
> site-packages directories.
> mdipierro - web2py rox! :)
> -- ciastek
>
> On Mar 22, 4:01 am, KMax  wrote:
>
> > Hello
> >   My web2py instalation (1.73 and newer) was affected by the same
> > issue.
> >   Running on debian by wsgi apache2. Installed by unzipping
> > web2py_src.zip in to fresh folder and coping parameters_443.py.
> >   Creation of newapplicationgive an error flash "unabletocreateapplication."
>
> >   Workaround was found accidently.
> >   Starting web2py.by at console ( typing pass and quit ) solve issue
> > at apache.
>
> > Thank you.
> > On 3 ÍÁÒ, 00:13, snfctech  wrote:
>
> > > Fedora10 web2py1.76.1 apache2/mod_wsgi
>
> > > I thought all errors generated tickets? šWhen I try tocreatean app
> > > via the admin over HTTPS on a LAN all I get is an error flash "unable
> > > tocreateapplication." šIt's not an apache permission issue because
> > > it does the same thing if all my files and dirs have 777 permissions.
> > > I don't get any apache errors in the error log and the only funny
> > > thing I get in the access log is a 303 code from the POST request to
> > > admin/default/site. šSomething must not be working out with
> > > gluon.admin.app_create.
>
> > > How should I troubleshoot this type of error, or does anybody have an
> > > idea what's going on?
>
> > > I'm going to start dissecting the app_create function - but my python
> > > skills are still pretty weak and I was hoping there would just be a
> > > good error log somewhere...
>
> > > Thanks in advance for any tips.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: joins, geraldo and possible alias

2010-03-29 Thread jonatron
I tried it with sqlexecute but I would need to do quite a lot of
processing on the results...

Is there any work around you can think of?  Is there any way to use
the DAL with a select statement in the format generated from _select?

Thanks,

J

On Mar 23, 9:35 pm, jonatron  wrote:
> I get the following:
>
> SELECT Calls.id, Calls.CallerName, Calls.CreatedBy, Calls.HandledBy,
> Users.Name, Users.Name FROM Users, Calls LEFT JOIN Users AS created_by
> ON created_by.id=Calls.CreatedBy LEFT JOIN Users AS handled_by ON
> handled_by.id=Calls.HandledBy WHERE Calls.id>0;
>
> On Mar 23, 6:06 pm, mdipierro  wrote:
>
> > hmmm. it could be a bug. What do you get if you do:
>
> > print
> > db(db.Calls.id>0)._select(db.Calls.ALL,db.created_by.name,db.handled_by.name,
> >    left=[created_by.on(created_by.id==db.Calls.CreatedBy),
> >            handled_by.on(handled_by.id==db.Calls.HandledBy)])
>
> > On Mar 23, 11:31 am,jonatron wrote:
>
> > > Thanks,
>
> > > This is close, but it does not quite get the result I'm looking for, I
> > > basically need the following MySQL query:
>
> > > SELECT Calls . * , created_by.Name, handled_by.Name
> > > FROM (
> > > Calls
> > > LEFT JOIN Users AS created_by ON Calls.CreatedBy = created_by.ID
> > > )
> > > LEFT JOIN Users AS handled_by ON Calls.HandledBy = handled_by.ID;
>
> > > I've tried adapting the code you posted but I can't seem to get the
> > > result set I need.  For example a call from 'Helen' created by Bob and
> > > Handled by Sam, I would like to get the results:
>
> > > CallerName      created_by.Name         handled_by.Name
> > > Helen           Bob                             Sam
>
> > > but I get
>
> > > Calls.id        Calls.CallerName        Users.Name      Users.Name
> > > 1               Helen                   Bob                     Bob
> > > 1               Helen                   Sam                     Sam
> > > 1               Helen                   Charlie         Charlie
>
> > > Any ideas?
>
> > > On Mar 20, 3:10 pm, mdipierro  wrote:
>
> > > > created_by=db.Users.with_alias('created_by')
> > > > handled_by=db.Users.with_alias('handled_by')
> > > > rows =
> > > > db(db.Calls.id>0).select(db.Calls.ALL,db.created_by.name,db.handled_by.name,
> > > >    left=[created_by.on(created_by.id==db.Calls.CreatedBy),
> > > >            handled_by.on(handled_by.id==db.Calls.HandledBy)])
>
> > > > On Mar 20, 6:58 am,jonatron wrote:
>
> > > > > Hi,
>
> > > > > I am hoping someone can help with this:
>
> > > > > I have tables setup something like this (this is a simplified
> > > > > representation):
>
> > > > > db.define_table('Users',
> > > > > Field('Name'))
>
> > > > > db.define_table('Calls',
> > > > > Field('CallerName'),
> > > > > Field('CreatedBy', db.Users),
> > > > > Field('HandledBy', db.Users))
>
> > > > > I need to produce a query set to send to geraldo reports that joins
> > > > > both the createdby and handledby fields to db.users.id so that I can
> > > > > display the users name in the report not the id.  I can do one inner
> > > > > join no problem and use Users.Name to get the name.  To do both joins
> > > > > and get useful data I think I need to do something analogue SQL AS on
> > > > > the joins and then access the data using an alias.  I have played with
> > > > > with_alias but don't seem to get what I need.  Can anyone point me in
> > > > > the right direction?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: Something is wrong when IS_IN_SET contains Chinease characters

2010-03-29 Thread Yarko Tymciurak
anyway,  I am sure this is about encoding to unicode - someone who has
done this will hopefully add comments.

On Mar 29, 10:04 am, Yarko Tymciurak 
wrote:
> On Mar 29, 8:33 am, hywang  wrote:
>
> > ---model file is like this -
> > db.define_table('options_contain_chinease',
> > Field('student_name', requires = IS_IN_SET(["Jim","小长","老李"],
> > multiple=True)),
>
> Using this last string from your IS_IN_SET example (I hope my copy/
> paste did this correctly into iPython!):
>
> In [31]: value=r"老李"
> In [32]: value
> Out[32]: '\xe8\x80\x81\xe6\x9d\x8e'
> In [33]: str(value)
> Out[33]: '\xe8\x80\x81\xe6\x9d\x8e'
> In [34]: re.compile(r"[\w\-:]+").findall(value)
> Out[34]: []
> In [35]: re.compile(r"[\w\-:]+").findall(value, re.U)
> Out[35]: []
> In [36]: re.compile(r"[\w\-:]+",re.U).findall(value)
> Out[36]: ['\xe8', '\xe6']
> In [37]: re.compile(r"[\w\-:]+",re.U).findall(value,re.U)
> Out[37]: []
>
> --->
>
> So it would seem you may need to setup something with LOCALE;  I have
> played around with this for just a little bit, but am not sure what it
> takes (zh-CN?  zh-cn?  zh_CN.gb2312?   etc.)
>
> Maybe others can add to this...
>
> Regards,
> - Yarko
>
> > )
> > db.options_contain_chinease.student_name.widget =
> > CheckboxesWidget.widget
>
> > --controller file is like this -
> > def options_contain_chinease():
> > form = SQLFORM(db.options_contain_chinease)
> > if form.accepts(request.vars, session):
> > pass
> > return dict(form=form)
>
> > if checked one item and submit, everything is ok, however, when
> > checked more than one items and submit the form, an error will occur .
> > Is it a bug ?
>
> > thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: zengarden anybody?

2010-03-29 Thread Christopher Steel
What can I say, I am a dreamer.

http://vishpala.com/resources/web2py/images/screenshot.png

C.

On Mar 29, 10:21 am, Yarko Tymciurak 
wrote:
> On Mar 29, 8:57 am, Yarko Tymciurak 
> wrote:
>
> > Careful -
>
> > HTML5 is behind schedule, and expected to reach standard stage in 2022
> > (?!)...
>
> > Hoewever, the new canvas element is supported already
>
> ... that is, supported by many browsers already;  if we are going to
> add any new, bleeding edge elements, a couple of things:
>
> *  their definition / implimentation (behavior) in browsers may
> change;
> *  anything that web2py supports will need to gracefully "fall
> back" (at least to the app writer) when something isn't supported
>
> ...or we can make selective, incremental support of aspects of HTML5
> optional;
>
> WRT to skinning / css, what are your thoughts?   Did you want to try
> DOM scripting?  ... not really sure how / why html5 needs to affect
> skinning (yet).
>
> (just thinking out loud),
> - Yarko
>
> > (so that flash /
> > silverlight, etc. isn't needed) --- and IE-9 might even do will with
> > this (the preview is out now - it seems pretty fast).
>
> > I woulnd't worry about too much more than what everyone else is
> > expecting in HTML-5:  the things browsers broadly support now, and are
> > useful (i.e. the canvas element, and more solid svg support, among
> > them).
>
> > - Yarko
>
> > On Mar 29, 7:38 am, Christopher Steel  wrote:
>
> > > Great!,
>
> > > I am going to do a little research and then put together some
> > > options / samples. Two other items I am going to look into (which are
> > > also suggested on the ez.css page) are html5 semantics and WAI ARIA
> > > landmark roles. Roles would require a code tweak or flag as some
> > > (most?)  validation sites do not support it yet, html5 I need to look
> > > into a bit more. html 5 is semantic and I am wondering if this could
> > > conflict with our current naming conventions, validation and so
> > > forth.
>
> > > Anyway it is a great opportunity to check all this stuff out and we
> > > could always we could offer some "unsupported" / "off label" options
> > > that give people more choice while maintaining our compatibility
> > > commitments first adopters in the main. For our organization WAI-ARIA
> > > landmarks is really important.
>
> > > Cheers,
>
> > > C.
>
> > > On 28 mar, 13:39, Yarko Tymciurak  wrote:
>
> > > > A few points I would make (as I write this, I am aware this probably
> > > > should be moved to the development list):
>
> > > > -  ez.css is no more than a layout / framing convention;
> > > >    -  staying compatible is easy (and it provides simple layout
> > > > control);
> > > >    -  it uses a useful convention of css class nameing, namely:  -
> > > > ,  e.g.:  "ez-wr" -
> > > >       - we should stick with that, ie. something like  "w2p" for all
> > > > web2py named css classes and id selectors;
> > > >         - note: the major difference between
> > > >           - class selectors (.something) and
> > > >           - id selectors (#something) is id selectors can link to a
> > > > part of a page, and javascript uses id selectors;
>
> > > > I'm not sure specifically what Massimo meant by "ez.css and jquery.ui
> > > > naming conventions";  we should get specific about this.
>
> > > > ez has the concept of
> > > > - wrappers, (ez-wr, ez-mr)
> > > > - style containers (i.e. layout containers)
> > > > - content containers (i.e. ez-box)
> > > > - sizing elements;
>
> > > > and more...
>
> > > > jquery has at least these conventions:
> > > > -http://jqueryui.com/docs/Theming/API
> > > > -http://wiki.jqueryui.com/Position
>
> > > > Note that ThemeRoller is a way to apply to PARTS of a user layout,
> > > > e.g.:
>
> > > > - font settings;
> > > > - corner radius;
> > > > - header;
> > > > - toolbar;
> > > > - content;
> > > > - clicables;
> > > > - highlight;
> > > > - errors;
> > > > - modal;
> > > > - drop shadoes;
>
> > > > By combining ez (positioning) and jquery-ui (and staying consistent w/
> > > > themeroller), we should be able to build-up a web2py-unique packaging,
> > > > with potentially useful extensions (e.g. for form layout and theming).
>
> > > > This seems, to me, to be a very promising direction.
>
> > > > - Yarko
> > > > Noteab
>
> > > > On Mar 27, 7:44 pm, mdipierro  wrote:
>
> > > > > I like the idea. It would be ideal if you could do it using ez.css and
> > > > > jquery.ui naming conventions.
>
> > > > > Massimo
>
> > > > > On 27 Mar, 15:23, Christopher Steel  wrote:
>
> > > > > > The Zengarden css code is not "open source" but we can easily create
> > > > > > our own. I am just finishing up a css based theme for a client that
> > > > > > uses div's and flow with a two columns (basically the same 
> > > > > > appearance
> > > > > > as the current web2py default layout). I would be more than happy to
> > > > > > create on using the current web2py names, images and so forth and 
> > > > > > can
> > > > > > license it as we like.
>
> > > > > >

[web2py] Re: zengarden anybody?

2010-03-29 Thread blackthorne
Hey!

Nice to see this layout idea. I think I've suggested it a good while
ago.
One interesting thing about this approach is that you can also great
different grades of complexity. E.g. if you want to create a
minimalistic theme without images, and Tweets on the admin page you
can simply hide those divs (in the CSS) and change whatever you need
so that you can keep what you want while the html remains unmodified.
Another interesting idea would be to create a mobile version so that
you can administrate your framework remotely from your phone.

Yes, I'm not just talking about the welcome.app but the admin too!

Best Regards

On Mar 29, 2:57 pm, Yarko Tymciurak 
wrote:
> Careful -
>
> HTML5 is behind schedule, and expected to reach standard stage in 2022
> (?!)...
That milestone is more "political" than technical. It is expected a
stable HTML5 technical spec way before.

>
> Hoewever, the new canvas element is supported already (so that flash /
> silverlight, etc. isn't needed) --- and IE-9 might even do will with
> this (the preview is out now - it seems pretty fast).
>
> I woulnd't worry about too much more than what everyone else is
> expecting in HTML-5:  the things browsers broadly support now, and are
> useful (i.e. the canvas element, and more solid svg support, among
> them).
>
> - Yarko
>
> On Mar 29, 7:38 am, Christopher Steel  wrote:
>
>
>
> > Great!,
>
> > I am going to do a little research and then put together some
> > options / samples. Two other items I am going to look into (which are
> > also suggested on the ez.css page) are html5 semantics and WAI ARIA
> > landmark roles. Roles would require a code tweak or flag as some
> > (most?)  validation sites do not support it yet, html5 I need to look
> > into a bit more. html 5 is semantic and I am wondering if this could
> > conflict with our current naming conventions, validation and so
> > forth.
>
> > Anyway it is a great opportunity to check all this stuff out and we
> > could always we could offer some "unsupported" / "off label" options
> > that give people more choice while maintaining our compatibility
> > commitments first adopters in the main. For our organization WAI-ARIA
> > landmarks is really important.
>
> > Cheers,
>
> > C.
>
> > On 28 mar, 13:39, Yarko Tymciurak  wrote:
>
> > > A few points I would make (as I write this, I am aware this probably
> > > should be moved to the development list):
>
> > > -  ez.css is no more than a layout / framing convention;
> > >    -  staying compatible is easy (and it provides simple layout
> > > control);
> > >    -  it uses a useful convention of css class nameing, namely:  -
> > > ,  e.g.:  "ez-wr" -
> > >       - we should stick with that, ie. something like  "w2p" for all
> > > web2py named css classes and id selectors;
> > >         - note: the major difference between
> > >           - class selectors (.something) and
> > >           - id selectors (#something) is id selectors can link to a
> > > part of a page, and javascript uses id selectors;
>
> > > I'm not sure specifically what Massimo meant by "ez.css and jquery.ui
> > > naming conventions";  we should get specific about this.
>
> > > ez has the concept of
> > > - wrappers, (ez-wr, ez-mr)
> > > - style containers (i.e. layout containers)
> > > - content containers (i.e. ez-box)
> > > - sizing elements;
>
> > > and more...
>
> > > jquery has at least these conventions:
> > > -http://jqueryui.com/docs/Theming/API
> > > -http://wiki.jqueryui.com/Position
>
> > > Note that ThemeRoller is a way to apply to PARTS of a user layout,
> > > e.g.:
>
> > > - font settings;
> > > - corner radius;
> > > - header;
> > > - toolbar;
> > > - content;
> > > - clicables;
> > > - highlight;
> > > - errors;
> > > - modal;
> > > - drop shadoes;
>
> > > By combining ez (positioning) and jquery-ui (and staying consistent w/
> > > themeroller), we should be able to build-up a web2py-unique packaging,
> > > with potentially useful extensions (e.g. for form layout and theming).
>
> > > This seems, to me, to be a very promising direction.
>
> > > - Yarko
> > > Noteab
>
> > > On Mar 27, 7:44 pm, mdipierro  wrote:
>
> > > > I like the idea. It would be ideal if you could do it using ez.css and
> > > > jquery.ui naming conventions.
>
> > > > Massimo
>
> > > > On 27 Mar, 15:23, Christopher Steel  wrote:
>
> > > > > The Zengarden css code is not "open source" but we can easily create
> > > > > our own. I am just finishing up a css based theme for a client that
> > > > > uses div's and flow with a two columns (basically the same appearance
> > > > > as the current web2py default layout). I would be more than happy to
> > > > > create on using the current web2py names, images and so forth and can
> > > > > license it as we like.
>
> > > > > We could include it as a documented option and give it a name like
> > > > > base-2c-flow.css or base-tableless.css
> > > > > Let me know soon cause I am moving on to non css stuff in the next few
> > > > > days.
>
> > > > > Cheer

[web2py] Re: Something is wrong when IS_IN_SET contains Chinease characters

2010-03-29 Thread Yarko Tymciurak
On Mar 29, 10:54 am, Yarko Tymciurak 
wrote:
> anyway,  I am sure this is about encoding to unicode - someone who has
> done this will hopefully add comments.

For example, looking at 
http://docs.python.org/library/codecs.html#standard-encodings

and searching for Chinese, from your (pasted) example, I found two
decodings that result in unicode results (that is, the codecs
recognize):

In [37]: value=r"老李"
In [38]: value
Out[38]: '\xe8\x80\x81\xe6\x9d\x8e'
In [39]: value.decode('gbk')
Out[39]: u'\u9470\u4f79\u6f55'
In [40]: value.decode('gb18030')
Out[40]: u'\u9470\u4f79\u6f55'


IMPORTANT:  both of these results show a unicode result  (i.e.
u'')

I am not sure if you need to set LOCALE for your environment / browser
so that the regular expression to work as it is (but, with this
encoding, it correctly produces the unicode match when callred with
re.UNICODE flag - but this is without locale set  (off the top of my
head, I am not sure of the proper way to setlocale within an
interpreter, to test this...)

In [44]: val=value.decode('gbk')
In [45]: re.compile(r"[\w\-:]+",re.U).findall(val)
Out[45]: [u'\u9470\u4f79\u6f55']


I hope this helps begin to show the beginning of the way:   All your
strings in your app need to be converted to unicode (one way or
another), and your locale set (normally provided from the browser, in
the request).

- Yarko
>
> On Mar 29, 10:04 am, Yarko Tymciurak 
> wrote:
>
> > On Mar 29, 8:33 am, hywang  wrote:
>
> > > ---model file is like this -
> > > db.define_table('options_contain_chinease',
> > > Field('student_name', requires = IS_IN_SET(["Jim","小长","老李"],
> > > multiple=True)),
>
> > Using this last string from your IS_IN_SET example (I hope my copy/
> > paste did this correctly into iPython!):
>
> > In [31]: value=r"老李"
> > In [32]: value
> > Out[32]: '\xe8\x80\x81\xe6\x9d\x8e'
> > In [33]: str(value)
> > Out[33]: '\xe8\x80\x81\xe6\x9d\x8e'
> > In [34]: re.compile(r"[\w\-:]+").findall(value)
> > Out[34]: []
> > In [35]: re.compile(r"[\w\-:]+").findall(value, re.U)
> > Out[35]: []
> > In [36]: re.compile(r"[\w\-:]+",re.U).findall(value)
> > Out[36]: ['\xe8', '\xe6']
> > In [37]: re.compile(r"[\w\-:]+",re.U).findall(value,re.U)
> > Out[37]: []
>
> > --->
>
> > So it would seem you may need to setup something with LOCALE;  I have
> > played around with this for just a little bit, but am not sure what it
> > takes (zh-CN?  zh-cn?  zh_CN.gb2312?   etc.)
>
> > Maybe others can add to this...
>
> > Regards,
> > - Yarko
>
> > > )
> > > db.options_contain_chinease.student_name.widget =
> > > CheckboxesWidget.widget
>
> > > --controller file is like this -
> > > def options_contain_chinease():
> > > form = SQLFORM(db.options_contain_chinease)
> > > if form.accepts(request.vars, session):
> > > pass
> > > return dict(form=form)
>
> > > if checked one item and submit, everything is ok, however, when
> > > checked more than one items and submit the form, an error will occur .
> > > Is it a bug ?
>
> > > thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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.



Re: [web2py] Re: zengarden anybody?

2010-03-29 Thread Thadeus Burgess
Remotely administer error tickets from your mobile phone!

-Thadeus





On Mon, Mar 29, 2010 at 8:12 AM, blackthorne  wrote:
> Hey!
>
> Nice to see this layout idea. I think I've suggested it a good while
> ago.
> One interesting thing about this approach is that you can also great
> different grades of complexity. E.g. if you want to create a
> minimalistic theme without images, and Tweets on the admin page you
> can simply hide those divs (in the CSS) and change whatever you need
> so that you can keep what you want while the html remains unmodified.
> Another interesting idea would be to create a mobile version so that
> you can administrate your framework remotely from your phone.
>
> Yes, I'm not just talking about the welcome.app but the admin too!
>
> Best Regards
>
> On Mar 29, 2:57 pm, Yarko Tymciurak 
> wrote:
>> Careful -
>>
>> HTML5 is behind schedule, and expected to reach standard stage in 2022
>> (?!)...
> That milestone is more "political" than technical. It is expected a
> stable HTML5 technical spec way before.
>
>>
>> Hoewever, the new canvas element is supported already (so that flash /
>> silverlight, etc. isn't needed) --- and IE-9 might even do will with
>> this (the preview is out now - it seems pretty fast).
>>
>> I woulnd't worry about too much more than what everyone else is
>> expecting in HTML-5:  the things browsers broadly support now, and are
>> useful (i.e. the canvas element, and more solid svg support, among
>> them).
>>
>> - Yarko
>>
>> On Mar 29, 7:38 am, Christopher Steel  wrote:
>>
>>
>>
>> > Great!,
>>
>> > I am going to do a little research and then put together some
>> > options / samples. Two other items I am going to look into (which are
>> > also suggested on the ez.css page) are html5 semantics and WAI ARIA
>> > landmark roles. Roles would require a code tweak or flag as some
>> > (most?)  validation sites do not support it yet, html5 I need to look
>> > into a bit more. html 5 is semantic and I am wondering if this could
>> > conflict with our current naming conventions, validation and so
>> > forth.
>>
>> > Anyway it is a great opportunity to check all this stuff out and we
>> > could always we could offer some "unsupported" / "off label" options
>> > that give people more choice while maintaining our compatibility
>> > commitments first adopters in the main. For our organization WAI-ARIA
>> > landmarks is really important.
>>
>> > Cheers,
>>
>> > C.
>>
>> > On 28 mar, 13:39, Yarko Tymciurak  wrote:
>>
>> > > A few points I would make (as I write this, I am aware this probably
>> > > should be moved to the development list):
>>
>> > > -  ez.css is no more than a layout / framing convention;
>> > >    -  staying compatible is easy (and it provides simple layout
>> > > control);
>> > >    -  it uses a useful convention of css class nameing, namely:  -
>> > > ,  e.g.:  "ez-wr" -
>> > >       - we should stick with that, ie. something like  "w2p" for all
>> > > web2py named css classes and id selectors;
>> > >         - note: the major difference between
>> > >           - class selectors (.something) and
>> > >           - id selectors (#something) is id selectors can link to a
>> > > part of a page, and javascript uses id selectors;
>>
>> > > I'm not sure specifically what Massimo meant by "ez.css and jquery.ui
>> > > naming conventions";  we should get specific about this.
>>
>> > > ez has the concept of
>> > > - wrappers, (ez-wr, ez-mr)
>> > > - style containers (i.e. layout containers)
>> > > - content containers (i.e. ez-box)
>> > > - sizing elements;
>>
>> > > and more...
>>
>> > > jquery has at least these conventions:
>> > > -http://jqueryui.com/docs/Theming/API
>> > > -http://wiki.jqueryui.com/Position
>>
>> > > Note that ThemeRoller is a way to apply to PARTS of a user layout,
>> > > e.g.:
>>
>> > > - font settings;
>> > > - corner radius;
>> > > - header;
>> > > - toolbar;
>> > > - content;
>> > > - clicables;
>> > > - highlight;
>> > > - errors;
>> > > - modal;
>> > > - drop shadoes;
>>
>> > > By combining ez (positioning) and jquery-ui (and staying consistent w/
>> > > themeroller), we should be able to build-up a web2py-unique packaging,
>> > > with potentially useful extensions (e.g. for form layout and theming).
>>
>> > > This seems, to me, to be a very promising direction.
>>
>> > > - Yarko
>> > > Noteab
>>
>> > > On Mar 27, 7:44 pm, mdipierro  wrote:
>>
>> > > > I like the idea. It would be ideal if you could do it using ez.css and
>> > > > jquery.ui naming conventions.
>>
>> > > > Massimo
>>
>> > > > On 27 Mar, 15:23, Christopher Steel  wrote:
>>
>> > > > > The Zengarden css code is not "open source" but we can easily create
>> > > > > our own. I am just finishing up a css based theme for a client that
>> > > > > uses div's and flow with a two columns (basically the same appearance
>> > > > > as the current web2py default layout). I would be more than happy to
>> > > > > create on using the current web2py names, images and so forth and can
>>

Re: [web2py] Re: as_list returns an isoformated time as_dict returns a datetime.time?

2010-03-29 Thread Thadeus Burgess
I almost want to say that as long as it is still a python object it
should stay python objects.

That being said, we already have the datetime_to_str flag, leave the
defaults as they were if someone wants it differently they can alter
the flag.

-Thadeus





On Sun, Mar 28, 2010 at 10:09 AM, Iceberg  wrote:
> Did not really try it yet, just look into the source code here [1]. So
> there are actually three relevant places:
>  Row.as_dict(...,datetime_to_str=False) # was datetime_to_str=True
>  Rows.as_dict(...,datetime_to_str=True) # did not change this time
>  Rows.as_list(...,datetime_to_str=True) # did not change this time
>
> IMO, as long as:
>  a. row.as_dict() is instead used internally (Well, Tito uses it
> anyway, but he is happy with the change.)
>  b. Most people use Rows.as_dict() and Rows.as_list(), and their
> default datetime_to_str=True are not changed.
>
> then this modification is fine ... for me. I don't know what others
> think. Generally speaking, it is not a necessary change since users
> already has a datetime_to_str flag to toggle. So, count me neutral.
>
> Regards,
> Iceberg
>
> [1]:
> http://code.google.com/p/web2py/source/diff?spec=svn5beee338c7dfa1fdbf259f987f5a32460c02a553&r=5beee338c7dfa1fdbf259f987f5a32460c02a553&format=side&path=/gluon/sql.py
>
> On Mar26, 7:21am, mdipierro  wrote:
>> I just made some changes to sql.py in trunk that does what you say.
>> The main purpose it for testing it and see what other people have to
>> say.
>>
>> I have to changes:
>> 1) as_dict now behaves by default as as_list (i.e datetime is
>> converted to string by default)
>> 2) when rows and records are stored in a session, datetime is NOT
>> serialized into a string
>>
>> This may be seen by some as not backward compatible and this behavior
>> was not documented anyway. Yet, I want to hear other people opinions
>> and want if this breaks people applications.
>>
>> Massimo
>>
>> On Mar 25, 5:59 pm, Tito Garrido  wrote:
>>
>>
>>
>> > What about as_dict(datetime_to_str=True)?
>>
>> > On Thu, Mar 25, 2010 at 7:33 PM, mdipierro  wrote:
>> > > On a second though, this cannot be changed, because it will break web
>> > > services example and therefore backward compatibility. @service.xmlrpc
>> > > for example cannot serialize datetime.
>>
>> > > Anyway you can do
>>
>> > > ...select().as_list(datetime_to_str=False)
>>
>> > > On Mar 25, 4:58 pm, Tito Garrido  wrote:
>> > > > I prefer the serialized data on as_dict result :)
>>
>> > > > On Thu, Mar 25, 2010 at 6:36 PM, mdipierro 
>> > > wrote:
>> > > > > That's how it is. There are historical reasons for it.
>>
>> > > > > select().as_dict(...) was designed to return a representation that
>> > > > > could be serialized by simplejson and other serializers. simplejson
>> > > > > cannot serialize date/datetime/time objects. This is no longer the
>> > > > > case since I patched simplejson.
>>
>> > > > > row.as_dict() is instead used internally to compare two records.
>>
>> > > > > I think we can change one or the other and make them consistent. What
>> > > > > do people think?
>>
>> > > > > Massimo
>>
>> > > > > On Mar 25, 4:29 pm, Tito Garrido  wrote:
>> > > > > > as_list on a select returns something like:
>>
>> > > > > > [{'id': 11, 'time': '08:00:00'}]
>>
>> > > > > > using as_dict on a record returns:
>>
>> > > > > > [{'id': 11, 'horario': datetime.time(8, 0)}]
>>
>> > > > > > Is that expected?
>>
>> > > > > > Regards,
>>
>> > > > > > Tito
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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.



Re: [web2py] Re: as_list returns an isoformated time as_dict returns a datetime.time?

2010-03-29 Thread Thadeus Burgess
They should both operate the same in any case.

-Thadeus





On Mon, Mar 29, 2010 at 12:00 PM, Thadeus Burgess  wrote:
> I almost want to say that as long as it is still a python object it
> should stay python objects.
>
> That being said, we already have the datetime_to_str flag, leave the
> defaults as they were if someone wants it differently they can alter
> the flag.
>
> -Thadeus
>
>
>
>
>
> On Sun, Mar 28, 2010 at 10:09 AM, Iceberg  wrote:
>> Did not really try it yet, just look into the source code here [1]. So
>> there are actually three relevant places:
>>  Row.as_dict(...,datetime_to_str=False) # was datetime_to_str=True
>>  Rows.as_dict(...,datetime_to_str=True) # did not change this time
>>  Rows.as_list(...,datetime_to_str=True) # did not change this time
>>
>> IMO, as long as:
>>  a. row.as_dict() is instead used internally (Well, Tito uses it
>> anyway, but he is happy with the change.)
>>  b. Most people use Rows.as_dict() and Rows.as_list(), and their
>> default datetime_to_str=True are not changed.
>>
>> then this modification is fine ... for me. I don't know what others
>> think. Generally speaking, it is not a necessary change since users
>> already has a datetime_to_str flag to toggle. So, count me neutral.
>>
>> Regards,
>> Iceberg
>>
>> [1]:
>> http://code.google.com/p/web2py/source/diff?spec=svn5beee338c7dfa1fdbf259f987f5a32460c02a553&r=5beee338c7dfa1fdbf259f987f5a32460c02a553&format=side&path=/gluon/sql.py
>>
>> On Mar26, 7:21am, mdipierro  wrote:
>>> I just made some changes to sql.py in trunk that does what you say.
>>> The main purpose it for testing it and see what other people have to
>>> say.
>>>
>>> I have to changes:
>>> 1) as_dict now behaves by default as as_list (i.e datetime is
>>> converted to string by default)
>>> 2) when rows and records are stored in a session, datetime is NOT
>>> serialized into a string
>>>
>>> This may be seen by some as not backward compatible and this behavior
>>> was not documented anyway. Yet, I want to hear other people opinions
>>> and want if this breaks people applications.
>>>
>>> Massimo
>>>
>>> On Mar 25, 5:59 pm, Tito Garrido  wrote:
>>>
>>>
>>>
>>> > What about as_dict(datetime_to_str=True)?
>>>
>>> > On Thu, Mar 25, 2010 at 7:33 PM, mdipierro  
>>> > wrote:
>>> > > On a second though, this cannot be changed, because it will break web
>>> > > services example and therefore backward compatibility. @service.xmlrpc
>>> > > for example cannot serialize datetime.
>>>
>>> > > Anyway you can do
>>>
>>> > > ...select().as_list(datetime_to_str=False)
>>>
>>> > > On Mar 25, 4:58 pm, Tito Garrido  wrote:
>>> > > > I prefer the serialized data on as_dict result :)
>>>
>>> > > > On Thu, Mar 25, 2010 at 6:36 PM, mdipierro 
>>> > > wrote:
>>> > > > > That's how it is. There are historical reasons for it.
>>>
>>> > > > > select().as_dict(...) was designed to return a representation that
>>> > > > > could be serialized by simplejson and other serializers. simplejson
>>> > > > > cannot serialize date/datetime/time objects. This is no longer the
>>> > > > > case since I patched simplejson.
>>>
>>> > > > > row.as_dict() is instead used internally to compare two records.
>>>
>>> > > > > I think we can change one or the other and make them consistent. 
>>> > > > > What
>>> > > > > do people think?
>>>
>>> > > > > Massimo
>>>
>>> > > > > On Mar 25, 4:29 pm, Tito Garrido  wrote:
>>> > > > > > as_list on a select returns something like:
>>>
>>> > > > > > [{'id': 11, 'time': '08:00:00'}]
>>>
>>> > > > > > using as_dict on a record returns:
>>>
>>> > > > > > [{'id': 11, 'horario': datetime.time(8, 0)}]
>>>
>>> > > > > > Is that expected?
>>>
>>> > > > > > Regards,
>>>
>>> > > > > > Tito
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To post to this group, send email to web...@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.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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.



Re: [web2py] Re: Running DAL oustide web2py

2010-03-29 Thread Thadeus Burgess
Alternatively if this is just a script (like cron) or a simple program
and you do not mind loading the entire web2py environment

python web2py.py -S welcome -M -R /path/to/my/script.py

-S denotes the app name, -M denotes execute models and -R is the path
to the script to execute in the environment, if you do not specify -R
then you get a python shell in the current environment.

Remember, you will always need to explicitly call db.commit() from scripts.

-Thadeus





On Mon, Mar 29, 2010 at 9:00 AM, rfx_labs  wrote:
> Hi Giovanni,
>
> I had the same problem and here is my simple solution:
>
> model.py:
> from gluon.dal import DAL, Field
>
> db = DAL("sqlite://storage.db")
>
> db.define_table("reference",
>          Field("name", "string", notnull=True),
>          Field("L", "double"),
>          Field("a", "double"),
>          Field("b", "double"))
>
> myApp.py:
> from model import db
>
> rows = db().select(db.reference.ALL)
>
> for row in rows:
>    print row.name, row.L, row.a, row.b, "\n"
>
> If you want to use a model file from a existing web2py application
> without adding the import statement (from gluon.dal import DAL,
> Field). You could import the model like this:
>
> model.py:
> db = DAL("sqlite://storage.db")
>
> db.define_table("reference",
>          Field("name", "string", notnull=True),
>          Field("L", "double"),
>          Field("a", "double"),
>          Field("b", "double"))
>
> myApp.py:
> from gluon.dal import DAL, Field
>
> model = open("/Users/mhufsky/Desktop/model.py", "rb")
> exec model
> model.close()
>
> rows = db().select(db.reference.ALL)
>
> for row in rows:
>    print row.name, row.L, row.a, row.b, "\n"
>
> In my app I prefer the import method.
>
> Hint: To get same output you should first insert something to the db.
> Hint2: The db is stored in the working directory. You could specify a
> other folder relative to the working dir or absolute (starting
> with /):
> db = DAL("sqlite://storage.db", folder="/path/to/Folder")
>
>
> Martin
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: zengarden anybody?

2010-03-29 Thread Yarko Tymciurak
On Mar 29, 1:00 pm, Thadeus Burgess  wrote:
> Remotely administer error tickets from your mobile phone!

You get error tickets?  Really?!   ... ;-)

But, actually - it would be nice to get private tweets from sites you
manage w/ links you could follow remotely if you wanted

>
> -Thadeus
>
> On Mon, Mar 29, 2010 at 8:12 AM, blackthorne  wrote:
> > Hey!
>
> > Nice to see this layout idea. I think I've suggested it a good while
> > ago.
> > One interesting thing about this approach is that you can also great
> > different grades of complexity. E.g. if you want to create a
> > minimalistic theme without images, and Tweets on the admin page you
> > can simply hide those divs (in the CSS) and change whatever you need
> > so that you can keep what you want while the html remains unmodified.
> > Another interesting idea would be to create a mobile version so that
> > you can administrate your framework remotely from your phone.
>
> > Yes, I'm not just talking about the welcome.app but the admin too!
>
> > Best Regards
>
> > On Mar 29, 2:57 pm, Yarko Tymciurak 
> > wrote:
> >> Careful -
>
> >> HTML5 is behind schedule, and expected to reach standard stage in 2022
> >> (?!)...
> > That milestone is more "political" than technical. It is expected a
> > stable HTML5 technical spec way before.
>
> >> Hoewever, the new canvas element is supported already (so that flash /
> >> silverlight, etc. isn't needed) --- and IE-9 might even do will with
> >> this (the preview is out now - it seems pretty fast).
>
> >> I woulnd't worry about too much more than what everyone else is
> >> expecting in HTML-5:  the things browsers broadly support now, and are
> >> useful (i.e. the canvas element, and more solid svg support, among
> >> them).
>
> >> - Yarko
>
> >> On Mar 29, 7:38 am, Christopher Steel  wrote:
>
> >> > Great!,
>
> >> > I am going to do a little research and then put together some
> >> > options / samples. Two other items I am going to look into (which are
> >> > also suggested on the ez.css page) are html5 semantics and WAI ARIA
> >> > landmark roles. Roles would require a code tweak or flag as some
> >> > (most?)  validation sites do not support it yet, html5 I need to look
> >> > into a bit more. html 5 is semantic and I am wondering if this could
> >> > conflict with our current naming conventions, validation and so
> >> > forth.
>
> >> > Anyway it is a great opportunity to check all this stuff out and we
> >> > could always we could offer some "unsupported" / "off label" options
> >> > that give people more choice while maintaining our compatibility
> >> > commitments first adopters in the main. For our organization WAI-ARIA
> >> > landmarks is really important.
>
> >> > Cheers,
>
> >> > C.
>
> >> > On 28 mar, 13:39, Yarko Tymciurak  wrote:
>
> >> > > A few points I would make (as I write this, I am aware this probably
> >> > > should be moved to the development list):
>
> >> > > -  ez.css is no more than a layout / framing convention;
> >> > >    -  staying compatible is easy (and it provides simple layout
> >> > > control);
> >> > >    -  it uses a useful convention of css class nameing, namely:  -
> >> > > ,  e.g.:  "ez-wr" -
> >> > >       - we should stick with that, ie. something like  "w2p" for all
> >> > > web2py named css classes and id selectors;
> >> > >         - note: the major difference between
> >> > >           - class selectors (.something) and
> >> > >           - id selectors (#something) is id selectors can link to a
> >> > > part of a page, and javascript uses id selectors;
>
> >> > > I'm not sure specifically what Massimo meant by "ez.css and jquery.ui
> >> > > naming conventions";  we should get specific about this.
>
> >> > > ez has the concept of
> >> > > - wrappers, (ez-wr, ez-mr)
> >> > > - style containers (i.e. layout containers)
> >> > > - content containers (i.e. ez-box)
> >> > > - sizing elements;
>
> >> > > and more...
>
> >> > > jquery has at least these conventions:
> >> > > -http://jqueryui.com/docs/Theming/API
> >> > > -http://wiki.jqueryui.com/Position
>
> >> > > Note that ThemeRoller is a way to apply to PARTS of a user layout,
> >> > > e.g.:
>
> >> > > - font settings;
> >> > > - corner radius;
> >> > > - header;
> >> > > - toolbar;
> >> > > - content;
> >> > > - clicables;
> >> > > - highlight;
> >> > > - errors;
> >> > > - modal;
> >> > > - drop shadoes;
>
> >> > > By combining ez (positioning) and jquery-ui (and staying consistent w/
> >> > > themeroller), we should be able to build-up a web2py-unique packaging,
> >> > > with potentially useful extensions (e.g. for form layout and theming).
>
> >> > > This seems, to me, to be a very promising direction.
>
> >> > > - Yarko
> >> > > Noteab
>
> >> > > On Mar 27, 7:44 pm, mdipierro  wrote:
>
> >> > > > I like the idea. It would be ideal if you could do it using ez.css 
> >> > > > and
> >> > > > jquery.ui naming conventions.
>
> >> > > > Massimo
>
> >> > > > On 27 Mar, 15:23, Christopher Steel  wrote:
>
> >> > > > > The Z

Re: [web2py] Re: zengarden anybody?

2010-03-29 Thread Thadeus Burgess
I don't, but in any case its still a nice bargaining chip for a company iphone.

-Thadeus





On Mon, Mar 29, 2010 at 12:17 PM, Yarko Tymciurak
 wrote:
>
> You get error tickets?  Really?!   ...     ;-)
>
> But, actually - it would be nice to get private tweets from sites you
> manage w/ links you could follow remotely if you wanted

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: webserver slow, misreported

2010-03-29 Thread Michael Toomim
I was having slowness problems with cherrypy too!  That's why I
switched to rocket.  So perhaps it's something common to cherrypy and
rocket, or perhaps they are both slow in their own ways?

This is using web2py from march 16th, so it's not the latest rocket.
Do you think something important changed for concurrency?

On Mar 29, 5:56 am, Timothy Farrell  wrote:
> Perhaps a simpler set of questions:
>
> Did you have this working with Cherrypy beforehand?
> If so, is Rocket the only thing to have changed?
>
> The latest changes to Rocket were committed to the Mercurial web2py repo
> on March 18th.  I'm assuming you've run a checkout since then.
>
> -tim
>
> On 3/28/2010 4:23 PM, mdipierro wrote:
>
>
>
> > One more thing. You ask
>
> >> But a single process doing complex joins should not slow down
> >> all other simple selects and inserts, right?
>
> > no, except for sqlite. sqlite serializes all requests because locks
> > the db. That could explain the 0.20s if you have lots of queries per
> > request, but not the 54s for the server.
>
> > On Mar 28, 4:22 pm, mdipierro  wrote:
>
> >> On Mar 28, 3:46 pm, Michael Toomim  wrote:
>
> >>> Any idea why there is a discrepancy between Firebug and
> >>> httpserver.log?
>
> >> httpserver.log logs the time spend in web2py, not including the time
> >> for sending and receiving the http request/response.
> >> firebug logs the the total time, including time spend by the web
> >> server for communication.
>
> >>> I am using postgresql.  What would indicate "model complexity"?  I
> >>> have around 9 tables, but most of the requests just do single-object
> >>> selects and inserts.  No complex joins are in public-facing pages, but
> >>> myself as an administrator periodically load a page that does big
> >>> joins.  But a single process doing complex joins should not slow down
> >>> all other simple selects and inserts, right?
>
> >> In your case there are two problems (and I do not know what causes
> >> them):
> >> 1) web2py is taking  0.20seconds to process a response. That is more
> >> than 10 times what it should be.
> >> 2) the communication between the web server and the browser takes very
> >> very long time.
>
> >> Is the server on localhost? If not this could be a network issue.
>
> >>> On Mar 27, 6:48 am, mdipierro  wrote:
>
>  Mind that if you use sqlite there is no concurrency. Still these
>  numbers are very low.
>  Are your models very complex?
>
>  On 27 Mar, 00:06, Michael Toomim  wrote:
>
> > I'm using web2py+rocket to serve jobs on mechanical turk. The server
> > probably gets a hit per second or so by workers on mechanical turk
> > using it.
>
> > When I have no users, everything is fast. But in active use, I notice
> > that web pages often load reay slow in my web browser, but the
> > httpserver.log file reports only small times.
>
> > For instance, I just loaded a page that httpserver.log said took
> > 0.20 seconds, but Firebug said took 54.21 seconds. That's a big
> > difference. Any idea what's going on? I guess I'll have to try apache?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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.



Re: [web2py] Re: webserver slow, misreported

2010-03-29 Thread Timothy Farrell

On 3/29/2010 1:39 PM, Michael Toomim wrote:

I was having slowness problems with cherrypy too!  That's why I
switched to rocket.  So perhaps it's something common to cherrypy and
rocket, or perhaps they are both slow in their own ways?

This is using web2py from march 16th, so it's not the latest rocket.
Do you think something important changed for concurrency?
   


I'm the author of Rocket.  I _know_ something important changed on March 
18th. =)  But that important change only really affects the *nix 
platform.  You haven't said what you're running on.


I'm not familiar with MTurk very well.  Is it directly connected to your 
web2py setup?  Does it run on Windows/Linux?


You said that you were having trouble with Cherrypy too.  Is Rocket 
better or worse than Cherrypy?


The one hang-up that I can see here is if you're server is 
memory-limited then multiple concurrent connections will cause thrashing 
due to swapping.  This situation would be fast with one but slow with 
multiple connections.


We need some more information before we can help you further.  But if 
Cherrypy wasn't cutting it then perhaps you should look into some of the 
native code solutions such as Apache.  This sounds like something wider 
than just the webserver.


-tim


On Mar 29, 5:56 am, Timothy Farrell  wrote:
   

Perhaps a simpler set of questions:

Did you have this working with Cherrypy beforehand?
If so, is Rocket the only thing to have changed?

The latest changes to Rocket were committed to the Mercurial web2py repo
on March 18th.  I'm assuming you've run a checkout since then.

-tim

On 3/28/2010 4:23 PM, mdipierro wrote:



 

One more thing. You ask
   
 

But a single process doing complex joins should not slow down
all other simple selects and inserts, right?
 
 

no, except for sqlite. sqlite serializes all requests because locks
the db. That could explain the 0.20s if you have lots of queries per
request, but not the 54s for the server.
   
 

On Mar 28, 4:22 pm, mdipierrowrote:
   
 

On Mar 28, 3:46 pm, Michael Toomimwrote:
 
 

Any idea why there is a discrepancy between Firebug and
httpserver.log?
   
 

httpserver.log logs the time spend in web2py, not including the time
for sending and receiving the http request/response.
firebug logs the the total time, including time spend by the web
server for communication.
 
 

I am using postgresql.  What would indicate "model complexity"?  I
have around 9 tables, but most of the requests just do single-object
selects and inserts.  No complex joins are in public-facing pages, but
myself as an administrator periodically load a page that does big
joins.  But a single process doing complex joins should not slow down
all other simple selects and inserts, right?
   
 

In your case there are two problems (and I do not know what causes
them):
1) web2py is taking  0.20seconds to process a response. That is more
than 10 times what it should be.
2) the communication between the web server and the browser takes very
very long time.
 
 

Is the server on localhost? If not this could be a network issue.
 
 

On Mar 27, 6:48 am, mdipierrowrote:
   
 

Mind that if you use sqlite there is no concurrency. Still these
numbers are very low.
Are your models very complex?
 
 

On 27 Mar, 00:06, Michael Toomimwrote:
 
 

I'm using web2py+rocket to serve jobs on mechanical turk. The server
probably gets a hit per second or so by workers on mechanical turk
using it.
   
 

When I have no users, everything is fast. But in active use, I notice
that web pages often load reay slow in my web browser, but the
httpserver.log file reports only small times.
   
 

For instance, I just loaded a page that httpserver.log said took
0.20 seconds, but Firebug said took 54.21 seconds. That's a big
difference. Any idea what's going on? I guess I'll have to try apache?
   
   


--
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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] Custom 404 Pages

2010-03-29 Thread Chris
Hi,
Is there a way to override the template used by the error pages so
that they match my site by extending the base template? I tried to use
the routes_onerror in routes.py to redirect on error, however, this
removes the proper status codes (400, 404 etc.) which the site should
return.

Chris

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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.



Re: [web2py] Custom 404 Pages

2010-03-29 Thread Thadeus Burgess
Now that you mention this, this is an issue. My google analytics on my
blog I have noticed lots of pages being request down the rabbit hole,
since I have the error redirecting.

Except for overriding the template in routes, not sure how to make it
look the same as the site.

-Thadeus





On Mon, Mar 29, 2010 at 1:36 PM, Chris  wrote:
> Hi,
> Is there a way to override the template used by the error pages so
> that they match my site by extending the base template? I tried to use
> the routes_onerror in routes.py to redirect on error, however, this
> removes the proper status codes (400, 404 etc.) which the site should
> return.
>
> Chris
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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] web2py.com down or something else?

2010-03-29 Thread Feng
Hi, I started to learn and use web2py recently. It's a great web
development framework, simple and easy to start.

Though for me, starting from yesterday, web2py.com seems to be down on
me.

I read some past articles about filtering. So is it the site down or
my ip is being blocked?

Thanks!

Feng

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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.



Re: [web2py] web2py.com down or something else?

2010-03-29 Thread Thadeus Burgess
It works for me.

-Thadeus





On Mon, Mar 29, 2010 at 2:03 PM, Feng  wrote:
> Hi, I started to learn and use web2py recently. It's a great web
> development framework, simple and easy to start.
>
> Though for me, starting from yesterday, web2py.com seems to be down on
> me.
>
> I read some past articles about filtering. So is it the site down or
> my ip is being blocked?
>
> Thanks!
>
> Feng
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to web...@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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: Custom 404 Pages

2010-03-29 Thread Chris
It would be great if this could fixed or an added feature. It's how a
lot of sites function.

On Mar 29, 3:43 pm, Thadeus Burgess  wrote:
> Now that you mention this, this is an issue. My google analytics on my
> blog I have noticed lots of pages being request down the rabbit hole,
> since I have the error redirecting.
>
> Except for overriding the template in routes, not sure how to make it
> look the same as the site.
>
> -Thadeus
>
> On Mon, Mar 29, 2010 at 1:36 PM, Chris  wrote:
> > Hi,
> > Is there a way to override the template used by the error pages so
> > that they match my site by extending the base template? I tried to use
> > the routes_onerror in routes.py to redirect on error, however, this
> > removes the proper status codes (400, 404 etc.) which the site should
> > return.
>
> > Chris
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: appliance typo

2010-03-29 Thread Richard
would be good not to have a catch all except too, which can mask other
errors.


On Mar 29, 8:29 pm, "hamdy.a.farag"  wrote:
> Hi
>
> in the appliacnce 'appliances'
>
> http://web2py.com/appliances/default/show/4
>
>  there's a typo in appadmin.py line 125
>
> except: reponse.flash='unable to parse csv file'  should be except:
> response.flash='unable to parse csv file'

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: problem with belongs

2010-03-29 Thread Richard
Try this:

animals = request.vars.animals
if not isinstance(animals, list):
animals = [animals]
res = db(db.table.field.belongs(animals)).select(db.table.ALL)



On Mar 29, 10:59 pm, pacopyc  wrote:
> With this code works, but I don't like this:
>
> if type(animals) == str:
>   res = db(db.table.field==animals).select(db.table.ALL)
> else:
>   res = db(db.table.field.belongs(animals)).select(db.table.ALL)
>
> Can you say me a better method?
>
> Thank you
>
> On 29 Mar, 13:29, pacopyc  wrote:
>
> > Hi, I've a problem with belongs. I've a page with a list of checkbox
> > (dog, cat, mouse, ...). For example If I choose dog and cat I'd like
> > execute:
>
> > select * from table where field in ('dog', 'cat')
>
> > I've written this code:
>
> > animals = request.vars.animals
> > res = db(db.table.field.belongs(animals)).select(db.table.ALL)
>
> > This works very good!!!
> > But If I choose only dog (for example) the code don't work. If I print
> > sql query I get this
>
> > select * from table where field in (do)
>
> > There aren't characters " ' " and last letter " g ". I don't
> > understand. Can you help me?
>
> > Thank you very much

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: Custom 404 Pages

2010-03-29 Thread Richard
add the idea here so people can vote on its importance:
http://web2py.uservoice.com/forums/42577-general



On Mar 30, 9:40 am, Chris  wrote:
> It would be great if this could fixed or an added feature. It's how a
> lot of sites function.
>
> On Mar 29, 3:43 pm, Thadeus Burgess  wrote:
>
> > Now that you mention this, this is an issue. My google analytics on my
> > blog I have noticed lots of pages being request down the rabbit hole,
> > since I have the error redirecting.
>
> > Except for overriding the template in routes, not sure how to make it
> > look the same as the site.
>
> > -Thadeus
>
> > On Mon, Mar 29, 2010 at 1:36 PM, Chris  wrote:
> > > Hi,
> > > Is there a way to override the template used by the error pages so
> > > that they match my site by extending the base template? I tried to use
> > > the routes_onerror in routes.py to redirect on error, however, this
> > > removes the proper status codes (400, 404 etc.) which the site should
> > > return.
>
> > > Chris
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > web2py+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: web2py.com down or something else?

2010-03-29 Thread Feng
oh, my IP now is 98.111.83.0
so far, I still can't reach www.web2py.com

Does anybody know how I can access the website?

Thanks,
- Feng

On Mar 29, 2:22 pm, Thadeus Burgess  wrote:
> It works for me.
>
> -Thadeus
>
> On Mon, Mar 29, 2010 at 2:03 PM, Feng  wrote:
> > Hi, I started to learn and use web2py recently. It's a great web
> > development framework, simple and easy to start.
>
> > Though for me, starting from yesterday, web2py.com seems to be down on
> > me.
>
> > I read some past articles about filtering. So is it the site down or
> > my ip is being blocked?
>
> > Thanks!
>
> > Feng
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "web2py-users" group.
> > To post to this group, send email to web...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > web2py+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: web2py.com down or something else?

2010-03-29 Thread mr.freeze
Massimo has an (overly) aggressive intrusion detection system. Try
using a public proxy to see if you can reach it. If it still doesn't
work then it may be on your end.


On Mar 29, 5:55 pm, Feng  wrote:
> oh, my IP now is 98.111.83.0
> so far, I still can't reachwww.web2py.com
>
> Does anybody know how I can access the website?
>
> Thanks,
> - Feng
>
> On Mar 29, 2:22 pm, Thadeus Burgess  wrote:
>
> > It works for me.
>
> > -Thadeus
>
> > On Mon, Mar 29, 2010 at 2:03 PM, Feng  wrote:
> > > Hi, I started to learn and use web2py recently. It's a great web
> > > development framework, simple and easy to start.
>
> > > Though for me, starting from yesterday, web2py.com seems to be down on
> > > me.
>
> > > I read some past articles about filtering. So is it the site down or
> > > my ip is being blocked?
>
> > > Thanks!
>
> > > Feng
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > web2py+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: web2py.com down or something else?

2010-03-29 Thread mdipierro
I think I unblocked it. Please check.


On Mar 29, 5:55 pm, Feng  wrote:
> oh, my IP now is 98.111.83.0
> so far, I still can't reachwww.web2py.com
>
> Does anybody know how I can access the website?
>
> Thanks,
> - Feng
>
> On Mar 29, 2:22 pm, Thadeus Burgess  wrote:
>
> > It works for me.
>
> > -Thadeus
>
> > On Mon, Mar 29, 2010 at 2:03 PM, Feng  wrote:
> > > Hi, I started to learn and use web2py recently. It's a great web
> > > development framework, simple and easy to start.
>
> > > Though for me, starting from yesterday, web2py.com seems to be down on
> > > me.
>
> > > I read some past articles about filtering. So is it the site down or
> > > my ip is being blocked?
>
> > > Thanks!
>
> > > Feng
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > web2py+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: webserver slow, misreported

2010-03-29 Thread Michael Toomim
Yes, this is on linux!  Do you recommend upgrading and trying again?

mturk doesn't affect anything, I am just serving webpages that appear
in iframes on the mturk website.  From our perspective, I'm serving
webpages.

Do you have a method of logging how much time it takes to serve a page
with rocket?  Something that I can use instead of httpserver.log?  It
seems important for me to measure real-world performance, which ab
does not do.

My server has 768MB ram, and the only thing it does is run this web2py
server.  I assumed ram was not full, but did not check.  I will check
next time.

On Mar 29, 12:10 pm, Timothy Farrell  wrote:
> On 3/29/2010 1:39 PM, Michael Toomim wrote:
>
> > I was having slowness problems with cherrypy too!  That's why I
> > switched to rocket.  So perhaps it's something common to cherrypy and
> > rocket, or perhaps they are both slow in their own ways?
>
> > This is using web2py from march 16th, so it's not the latest rocket.
> > Do you think something important changed for concurrency?
>
> I'm the author of Rocket.  I _know_ something important changed on March
> 18th. =)  But that important change only really affects the *nix
> platform.  You haven't said what you're running on.
>
> I'm not familiar with MTurk very well.  Is it directly connected to your
> web2py setup?  Does it run on Windows/Linux?
>
> You said that you were having trouble with Cherrypy too.  Is Rocket
> better or worse than Cherrypy?
>
> The one hang-up that I can see here is if you're server is
> memory-limited then multiple concurrent connections will cause thrashing
> due to swapping.  This situation would be fast with one but slow with
> multiple connections.
>
> We need some more information before we can help you further.  But if
> Cherrypy wasn't cutting it then perhaps you should look into some of the
> native code solutions such as Apache.  This sounds like something wider
> than just the webserver.
>
> -tim
>
>
>
> > On Mar 29, 5:56 am, Timothy Farrell  wrote:
>
> >> Perhaps a simpler set of questions:
>
> >> Did you have this working with Cherrypy beforehand?
> >> If so, is Rocket the only thing to have changed?
>
> >> The latest changes to Rocket were committed to the Mercurial web2py repo
> >> on March 18th.  I'm assuming you've run a checkout since then.
>
> >> -tim
>
> >> On 3/28/2010 4:23 PM, mdipierro wrote:
>
> >>> One more thing. You ask
>
>  But a single process doing complex joins should not slow down
>  all other simple selects and inserts, right?
>
> >>> no, except for sqlite. sqlite serializes all requests because locks
> >>> the db. That could explain the 0.20s if you have lots of queries per
> >>> request, but not the 54s for the server.
>
> >>> On Mar 28, 4:22 pm, mdipierro    wrote:
>
>  On Mar 28, 3:46 pm, Michael Toomim    wrote:
>
> > Any idea why there is a discrepancy between Firebug and
> > httpserver.log?
>
>  httpserver.log logs the time spend in web2py, not including the time
>  for sending and receiving the http request/response.
>  firebug logs the the total time, including time spend by the web
>  server for communication.
>
> > I am using postgresql.  What would indicate "model complexity"?  I
> > have around 9 tables, but most of the requests just do single-object
> > selects and inserts.  No complex joins are in public-facing pages, but
> > myself as an administrator periodically load a page that does big
> > joins.  But a single process doing complex joins should not slow down
> > all other simple selects and inserts, right?
>
>  In your case there are two problems (and I do not know what causes
>  them):
>  1) web2py is taking  0.20seconds to process a response. That is more
>  than 10 times what it should be.
>  2) the communication between the web server and the browser takes very
>  very long time.
>
>  Is the server on localhost? If not this could be a network issue.
>
> > On Mar 27, 6:48 am, mdipierro    wrote:
>
> >> Mind that if you use sqlite there is no concurrency. Still these
> >> numbers are very low.
> >> Are your models very complex?
>
> >> On 27 Mar, 00:06, Michael Toomim    wrote:
>
> >>> I'm using web2py+rocket to serve jobs on mechanical turk. The server
> >>> probably gets a hit per second or so by workers on mechanical turk
> >>> using it.
>
> >>> When I have no users, everything is fast. But in active use, I notice
> >>> that web pages often load reay slow in my web browser, but the
> >>> httpserver.log file reports only small times.
>
> >>> For instance, I just loaded a page that httpserver.log said took
> >>> 0.20 seconds, but Firebug said took 54.21 seconds. That's a big
> >>> difference. Any idea what's going on? I guess I'll have to try apache?

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@goo

[web2py] Re: web2py.com down or something else?

2010-03-29 Thread Feng
Thank you all. I can access the website now!

On Mar 29, 5:39 pm, mdipierro  wrote:
> I think I unblocked it. Please check.
>
> On Mar 29, 5:55 pm, Feng  wrote:
>
> > oh, my IP now is 98.111.83.0
> > so far, I still can't reachwww.web2py.com
>
> > Does anybody know how I can access the website?
>
> > Thanks,
> > - Feng
>
> > On Mar 29, 2:22 pm, Thadeus Burgess  wrote:
>
> > > It works for me.
>
> > > -Thadeus
>
> > > On Mon, Mar 29, 2010 at 2:03 PM, Feng  wrote:
> > > > Hi, I started to learn and use web2py recently. It's a great web
> > > > development framework, simple and easy to start.
>
> > > > Though for me, starting from yesterday, web2py.com seems to be down on
> > > > me.
>
> > > > I read some past articles about filtering. So is it the site down or
> > > > my ip is being blocked?
>
> > > > Thanks!
>
> > > > Feng
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "web2py-users" group.
> > > > To post to this group, send email to web...@googlegroups.com.
> > > > To unsubscribe from this group, send email to 
> > > > web2py+unsubscr...@googlegroups.com.
> > > > For more options, visit this group 
> > > > athttp://groups.google.com/group/web2py?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: webserver slow, misreported

2010-03-29 Thread Yarko Tymciurak
On Mar 29, 7:59 pm, Michael Toomim  wrote:
> Yes, this is on linux!  Do you recommend upgrading and trying again?
>
> mturk doesn't affect anything, I am just serving webpages that appear
> in iframes on the mturk website.  From our perspective, I'm serving
> webpages.
>
> Do you have a method of logging how much time it takes to serve a page
> with rocket?  Something that I can use instead of httpserver.log?  It
> seems important for me to measure real-world performance, which ab
> does not do.

Have you used / looked at  yslow, or page-speed?

Have you tried timing it by removing the browser from the equation?
(I.e. use curl to get the output from a controller)?

How slow is this if you DO NOT go thru iframes in mturk?

Sound to me like getting to the right question is the first step -
instead of "why is web2py" or "why is rocket" slow (which it doesn't
seem you know at all), the question should start with "why is my
application slow?" --- draw a map of all that's involved with serving
your app, and figure out ways to measure where the bottleneck is, then
focus on that.

When you can show some data, layout your suspicions per component,
then your questions wil likely provide fruit.

- Yarko

>
> My server has 768MB ram, and the only thing it does is run this web2py
> server.  I assumed ram was not full, but did not check.  I will check
> next time.
>
> On Mar 29, 12:10 pm, Timothy Farrell  wrote:
>
> > On 3/29/2010 1:39 PM, Michael Toomim wrote:
>
> > > I was having slowness problems with cherrypy too!  That's why I
> > > switched to rocket.  So perhaps it's something common to cherrypy and
> > > rocket, or perhaps they are both slow in their own ways?
>
> > > This is using web2py from march 16th, so it's not the latest rocket.
> > > Do you think something important changed for concurrency?
>
> > I'm the author of Rocket.  I _know_ something important changed on March
> > 18th. =)  But that important change only really affects the *nix
> > platform.  You haven't said what you're running on.
>
> > I'm not familiar with MTurk very well.  Is it directly connected to your
> > web2py setup?  Does it run on Windows/Linux?
>
> > You said that you were having trouble with Cherrypy too.  Is Rocket
> > better or worse than Cherrypy?
>
> > The one hang-up that I can see here is if you're server is
> > memory-limited then multiple concurrent connections will cause thrashing
> > due to swapping.  This situation would be fast with one but slow with
> > multiple connections.
>
> > We need some more information before we can help you further.  But if
> > Cherrypy wasn't cutting it then perhaps you should look into some of the
> > native code solutions such as Apache.  This sounds like something wider
> > than just the webserver.
>
> > -tim
>
> > > On Mar 29, 5:56 am, Timothy Farrell  wrote:
>
> > >> Perhaps a simpler set of questions:
>
> > >> Did you have this working with Cherrypy beforehand?
> > >> If so, is Rocket the only thing to have changed?
>
> > >> The latest changes to Rocket were committed to the Mercurial web2py repo
> > >> on March 18th.  I'm assuming you've run a checkout since then.
>
> > >> -tim
>
> > >> On 3/28/2010 4:23 PM, mdipierro wrote:
>
> > >>> One more thing. You ask
>
> >  But a single process doing complex joins should not slow down
> >  all other simple selects and inserts, right?
>
> > >>> no, except for sqlite. sqlite serializes all requests because locks
> > >>> the db. That could explain the 0.20s if you have lots of queries per
> > >>> request, but not the 54s for the server.
>
> > >>> On Mar 28, 4:22 pm, mdipierro    wrote:
>
> >  On Mar 28, 3:46 pm, Michael Toomim    wrote:
>
> > > Any idea why there is a discrepancy between Firebug and
> > > httpserver.log?
>
> >  httpserver.log logs the time spend in web2py, not including the time
> >  for sending and receiving the http request/response.
> >  firebug logs the the total time, including time spend by the web
> >  server for communication.
>
> > > I am using postgresql.  What would indicate "model complexity"?  I
> > > have around 9 tables, but most of the requests just do single-object
> > > selects and inserts.  No complex joins are in public-facing pages, but
> > > myself as an administrator periodically load a page that does big
> > > joins.  But a single process doing complex joins should not slow down
> > > all other simple selects and inserts, right?
>
> >  In your case there are two problems (and I do not know what causes
> >  them):
> >  1) web2py is taking  0.20seconds to process a response. That is more
> >  than 10 times what it should be.
> >  2) the communication between the web server and the browser takes very
> >  very long time.
>
> >  Is the server on localhost? If not this could be a network issue.
>
> > > On Mar 27, 6:48 am, mdipierro    wrote:
>
> > >> Mind that if you use sqlite there is no concurrency. Still these
> >

[web2py] Re: Something is wrong when IS_IN_SET contains Chinease characters

2010-03-29 Thread hywang
thanks for your kindly help.


On 3月30日, 上午1时47分, Yarko Tymciurak 
wrote:
> On Mar 29, 10:54 am, Yarko Tymciurak 
> wrote:
>
> > anyway,  I am sure this is about encoding to unicode - someone who has
> > done this will hopefully add comments.
>
> For example, looking 
> athttp://docs.python.org/library/codecs.html#standard-encodings
>
> and searching for Chinese, from your (pasted) example, I found two
> decodings that result in unicode results (that is, the codecs
> recognize):
>
> In [37]: value=r"老李"
> In [38]: value
> Out[38]: '\xe8\x80\x81\xe6\x9d\x8e'
> In [39]: value.decode('gbk')
> Out[39]: u'\u9470\u4f79\u6f55'
> In [40]: value.decode('gb18030')
> Out[40]: u'\u9470\u4f79\u6f55'
>
> IMPORTANT:  both of these results show a unicode result  (i.e.
> u'')
>
> I am not sure if you need to set LOCALE for your environment / browser
> so that the regular expression to work as it is (but, with this
> encoding, it correctly produces the unicode match when callred with
> re.UNICODE flag - but this is without locale set  (off the top of my
> head, I am not sure of the proper way to setlocale within an
> interpreter, to test this...)
>
> In [44]: val=value.decode('gbk')
> In [45]: re.compile(r"[\w\-:]+",re.U).findall(val)
> Out[45]: [u'\u9470\u4f79\u6f55']
>
> I hope this helps begin to show the beginning of the way:   All your
> strings in your app need to be converted to unicode (one way or
> another), and your locale set (normally provided from the browser, in
> the request).
>
> - Yarko
>
>
>
> > On Mar 29, 10:04 am, Yarko Tymciurak 
> > wrote:
>
> > > On Mar 29, 8:33 am, hywang  wrote:
>
> > > > ---model file is like this -
> > > > db.define_table('options_contain_chinease',
> > > > Field('student_name', requires = IS_IN_SET(["Jim","小长","老李"],
> > > > multiple=True)),
>
> > > Using this last string from your IS_IN_SET example (I hope my copy/
> > > paste did this correctly into iPython!):
>
> > > In [31]: value=r"老李"
> > > In [32]: value
> > > Out[32]: '\xe8\x80\x81\xe6\x9d\x8e'
> > > In [33]: str(value)
> > > Out[33]: '\xe8\x80\x81\xe6\x9d\x8e'
> > > In [34]: re.compile(r"[\w\-:]+").findall(value)
> > > Out[34]: []
> > > In [35]: re.compile(r"[\w\-:]+").findall(value, re.U)
> > > Out[35]: []
> > > In [36]: re.compile(r"[\w\-:]+",re.U).findall(value)
> > > Out[36]: ['\xe8', '\xe6']
> > > In [37]: re.compile(r"[\w\-:]+",re.U).findall(value,re.U)
> > > Out[37]: []
>
> > > --->
>
> > > So it would seem you may need to setup something with LOCALE;  I have
> > > played around with this for just a little bit, but am not sure what it
> > > takes (zh-CN?  zh-cn?  zh_CN.gb2312?   etc.)
>
> > > Maybe others can add to this...
>
> > > Regards,
> > > - Yarko
>
> > > > )
> > > > db.options_contain_chinease.student_name.widget =
> > > > CheckboxesWidget.widget
>
> > > > --controller file is like this -
> > > > def options_contain_chinease():
> > > > form = SQLFORM(db.options_contain_chinease)
> > > > if form.accepts(request.vars, session):
> > > > pass
> > > > return dict(form=form)
>
> > > > if checked one item and submit, everything is ok, however, when
> > > > checked more than one items and submit the form, an error will occur .
> > > > Is it a bug ?
>
> > > > thanks !

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: Something is wrong when IS_IN_SET contains Chinease characters

2010-03-29 Thread hywang
Rewrite IS_IN_SET, everything is ok. But I don't know how to submit a
branch .

class IS_IN_SET(Validator):
def __init__(
self,
theset,
labels=None,
error_message='value not allowed',
multiple=False,
zero='',
sort=False,
):
self.multiple = multiple
if isinstance(theset, dict):
self.theset = [str(item) for item in theset.keys()]
self.labels = theset.values()
elif theset and isinstance(theset, (tuple,list)) \
and isinstance(theset[0], (tuple,list)) and
len(theset[0])==2:
self.theset = [str(item) for item,label in theset]
self.labels = [str(label) for item,label in theset]
else:
self.theset = [str(item) for item in theset]
self.labels = labels
self.error_message = error_message
self.zero = zero
self.sort = sort

def options(self):
if not self.labels:
items = [(k, k) for (i, k) in enumerate(self.theset)]
else:
items = [(k, self.labels[i]) for (i, k) in
enumerate(self.theset)]
if self.sort:
items.sort(options_sorter)
if self.zero != None and not self.multiple:
items.insert(0,('',self.zero))
return items

def __call__(self, value):
if self.multiple:
if isinstance(value, str):
values = [value]
elif isinstance(value, (tuple, list)):
values = value
else:
values = [value]
failures = [x for x in values if not x in self.theset]
if failures:
if self.multiple and value == None:
return (value, None)
return (value, self.error_message)
if self.multiple:
return ('|%s|' % '|'.join(values), None)
return (value, None)


On 3月30日, 上午11时12分, hywang  wrote:
> thanks for your kindly help.
>
> On 3月30日, 上午1时47分, Yarko Tymciurak 
> wrote:
>
> > On Mar 29, 10:54 am, Yarko Tymciurak 
> > wrote:
>
> > > anyway,  I am sure this is about encoding to unicode - someone who has
> > > done this will hopefully add comments.
>
> > For example, looking 
> > athttp://docs.python.org/library/codecs.html#standard-encodings
>
> > and searching for Chinese, from your (pasted) example, I found two
> > decodings that result in unicode results (that is, the codecs
> > recognize):
>
> > In [37]: value=r"老李"
> > In [38]: value
> > Out[38]: '\xe8\x80\x81\xe6\x9d\x8e'
> > In [39]: value.decode('gbk')
> > Out[39]: u'\u9470\u4f79\u6f55'
> > In [40]: value.decode('gb18030')
> > Out[40]: u'\u9470\u4f79\u6f55'
>
> > IMPORTANT:  both of these results show a unicode result  (i.e.
> > u'')
>
> > I am not sure if you need to set LOCALE for your environment / browser
> > so that the regular expression to work as it is (but, with this
> > encoding, it correctly produces the unicode match when callred with
> > re.UNICODE flag - but this is without locale set  (off the top of my
> > head, I am not sure of the proper way to setlocale within an
> > interpreter, to test this...)
>
> > In [44]: val=value.decode('gbk')
> > In [45]: re.compile(r"[\w\-:]+",re.U).findall(val)
> > Out[45]: [u'\u9470\u4f79\u6f55']
>
> > I hope this helps begin to show the beginning of the way:   All your
> > strings in your app need to be converted to unicode (one way or
> > another), and your locale set (normally provided from the browser, in
> > the request).
>
> > - Yarko
>
> > > On Mar 29, 10:04 am, Yarko Tymciurak 
> > > wrote:
>
> > > > On Mar 29, 8:33 am, hywang  wrote:
>
> > > > > ---model file is like this -
> > > > > db.define_table('options_contain_chinease',
> > > > > Field('student_name', requires = IS_IN_SET(["Jim","小长","老李"],
> > > > > multiple=True)),
>
> > > > Using this last string from your IS_IN_SET example (I hope my copy/
> > > > paste did this correctly into iPython!):
>
> > > > In [31]: value=r"老李"
> > > > In [32]: value
> > > > Out[32]: '\xe8\x80\x81\xe6\x9d\x8e'
> > > > In [33]: str(value)
> > > > Out[33]: '\xe8\x80\x81\xe6\x9d\x8e'
> > > > In [34]: re.compile(r"[\w\-:]+").findall(value)
> > > > Out[34]: []
> > > > In [35]: re.compile(r"[\w\-:]+").findall(value, re.U)
> > > > Out[35]: []
> > > > In [36]: re.compile(r"[\w\-:]+",re.U).findall(value)
> > > > Out[36]: ['\xe8', '\xe6']
> > > > In [37]: re.compile(r"[\w\-:]+",re.U).findall(value,re.U)
> > > > Out[37]: []
>
> > > > --->
>
> > > > So it would seem you may need to setup something with LOCALE;  I have
> > > > played around with this for just a little bit, but am not sure what it
> > > > takes (zh-CN?  zh-cn?  zh_CN.gb2312?   etc.)
>
> > > > Maybe others can add to this...
>
> > > > Regards,
> > > > - Yarko
>
> > > > > )
> > > > > db.options_contain_chinease.student_name.widget =
> > > > > CheckboxesWidget.widget
>
> > > > > --controller file is like this -
> > > > > def options_contain_chinease(

[web2py] Re: Help with a query

2010-03-29 Thread weheh
You need a left outer join. Here are a couple of examples that I think
should work (caveat: I didn't test them):

#way1
qry1=((db.t2.f22==db.t1.id) && (db.t1.f12==10))
rows = db(qry1).select(db.t2.ALL)

#way2
qry1=(db.t1.f12==10)
leftjoin=db.t2.on(db.t2.f22==db.t1.id)
rows=db(qry1).select(db.t2.ALL,left=leftjoin)



On Mar 29, 9:44 am, Jose  wrote:
> Given:
>
> db.define_table('t1',
>     Field('f11'),
>     Field('f12', 'integer'),
> )
>
> db.define_table('t2',
>     Field('f21'),
>     Field('f22', db.t1),
> )
>
> I make this query [1] (I see that you can not) but without using a
> subselect
>
> [1]
> qry1 = (db.t2.f22.f12 == 10)
> rows = db(qry1).select(db.t2.ALL)
>
> How would be the simplest way to query?
>
> Jose

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: wiki features/bugs

2010-03-29 Thread Richard
I would like to add a list of web2py hosting providers that people can
contribute to. Wiki doesn't seem ready (see above) - any other
options?

Richard


On Mar 25, 11:54 am, Richard  wrote:
> I tried using the wiki and have some feedback:
>
> How do I create a new page? The front page suggests going to "Pages
> section and clicking on the create new page link", but this link does
> not exist.
>
> How do I edit a page? When I try editing I get "The page isn't
> redirecting properly".
>
> By default accounts do not have edit/create privileges. I guess this
> would reduce abuse but it will also reduce input by genuine users.
> Could this be reconsidered?
> Also what is the current process for requesting edit/create
> privileges? This is not covered on the front page.
>
> If I go to a page that does not exist 
> (eghttp://wiki.web2py.com/page_that_does_not_exist)
> I get a redirect error. Would it be possible to redirect to a create
> new page form with this name, Wikipedia style?
>
> The "forgot password" feature lets me reset the password of any email
> address. Could an email instead be sent with a link to reset the
> password?
> Also the reminder was classified as spam by gmail. Perhaps including
> their profile name in the email would minimize this.
>
> Page links text are showed as "How_to_Geolocate" - could these
> underscores be changed to spaces? ("How to Geolocate")

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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: JqGrid Plugin

2010-03-29 Thread parroit
Interesting, thank you. I will add autoencode parameters to
the grid construnctor.

I saw that setting the parameter to true will enable the encoding
for all columns of the grid. Maybe, if we want to have some column
with html data,
it's better to encode the data in w2p?
Massimo, you know an easy way to do so?

Andrea


On 28 Mar, 16:57, "ont.rif"  wrote:
> :-)  same bug as 
> forhttp://groups.google.ru/group/web2py/browse_thread/thread/96877110aa8...
> I have found intresting feature 
> forJqGrid3.5.2http://blogs.teamb.com/craigstuntz/2010/02/08/38548/
> May be it is useful to add this option to this plugin ?
>
> On 28 ÜÐà, 21:35, mdipierro  wrote:
>
> > :-)
>
> > On Mar 28, 4:04 am, parroit  wrote:
>
> > > Thank you. Yes, I can merge with it.
> > > I look at the existingjqgridplugin files.
> > > I'll add the search feature and the parameters
> > > for columns width, names etc...
>
> > > I'll add a post here when I'll done with the work.
>
> > > Bye
>
> > > Andrea
>
> > > On 28 Mar, 03:18, mdipierro  wrote:
>
> > > > I looked at it and you did excellent work.
>
> > > > I have one issue and one proposal.
>
> > > > The issue is that plugin_editable_jqgrid.py exposes classes and
> > > > methods that do not start with plugin_editable_jqgrid and that is a
> > > > problem because can potentially conflict with other plugins.
>
> > > > The proposal is that we merge it with the existingjqgridplugin.
>
> > > > Can you take a first crack at merging them?
> > > > I will be happy to do any required cleanup work and post it.
>
> > > > Massimo
>
> > > > On 27 Mar, 19:38, mdipierro  wrote:
>
> > > > > I will look at it asap. Thank you!
>
> > > > > Massimo
>
> > > > > On 27 Mar, 11:51, parroit  wrote:
>
> > > > > > Hi. I've developed a plugin to useJqGridwith inline editing and json
> > > > > > updates.
> > > > > > I've published some help at this page:http://app.ebansoftware.net,
> > > > > > but I think it be more useful
> > > > > > to publish it also onhttp://www.web2py.com/plugins. What is the
> > > > > > correct procedure
> > > > > > to publish the plugin on that site?
>
> > > > > > Thanks
>
> > > > > > Andrea

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@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.