Re: [web2py] delicious is closing

2010-12-17 Thread LightDot
SEO experts and SEO experts who use Delicious for ranking optimization 
will have a lot of work on their hands these days :)

Yahooo should have sold the service rather than close it, IMHO.


[web2py] error in using captcha in crud

2010-12-17 Thread Markus Schmitz
Hi everybody,

I was trying to use the recaptcha feature with a crud form and I am
hitting an error:

  File D:\My Dropbox\InterManager\web2py\gluon\tools.py, line 2808,
in update
self._addrow(form, captcha.label, captcha, captcha.comment,
AttributeError: 'Crud' object has no attribute '_addrow'

I checked and indeed the Crud object did not seem to have an _addrow
method.

For a quick fix I copied the _addRow method from the Auth class in the
same file to the Crud class and it seems to work. But this duplication
of code sounds not right to me.

Do others have the same problem or am I sitting on some old code here?
My code is quite simple:

crud.settings.captcha = Recaptcha(request,'Public Key', 'Private
Key')
form=crud.create(db.faq_entries, next=nextStr)

Regards

Markus



[web2py] LEFT JOIN in web2py

2010-12-17 Thread annet
In my model I have a company table and a person table and a
combination table that links the two together. Some companies allow
there people to maintain a profile text, in addition some companies
allow there people to also upload a picture of themselves. To meet
these requirements I defined a table profiletext and a table avatar
referencing the person table.

In my view I would like to list the people that work for a company,
and in case they wrote a profile text and/or uploaded a picture show
that picture. The problem is, I am struggling with the left join
needed to accomplish this. I tried:


print
db((db.companyperson.person_id==db.person.id)(db.companyperson.bedrijf_id==2))
\ 
._select(db.person.first_name,db.person.last_name,db.profiletext.text,db.avatar.link,
\
left=((db.avatar.on(db.companyperson.person_id==db.avatar.person_id)\
(db.profiletext.on(db.companyperson.person_id==db.profiletext.person_id
\
,orderby=db.profiletext.order)


Running this code results in the following error:

Traceback (most recent call last):
  File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
restricted.py, line 188, in restricted
exec ccode in environment
  File /Library/Python/2.5/site-packages/web2py_1.87.3/applications/
demo/controllers/default.py, line 72, in module
  File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
globals.py, line 96, in lambda
self._caller = lambda f: f()
  File /Library/Python/2.5/site-packages/web2py_1.87.3/applications/
demo/controllers/default.py, line 26, in print_team
 
(db.profieltekst.on(db.bedrijfcontactpersoon.contactpersoon_id==db.profieltekst.contactpersoon_id
\
TypeError: unsupported operand type(s) for : 'SQLJoin' and 'SQLJoin'


This is the SQL query:

SELECT *
FROM companyperson JOIN person ON companyperson.person_id=person.id
LEFT JOIN profiletext ON companyperson.person_id=profiletext.person_id
LEFT JOIN
avatar ON companyperson.person_id=avatar.person_id

What is the correcet syntax for this query in web2py?


Kind regards,

Annet


[web2py] Powertable remarks

2010-12-17 Thread Johann Spies
I have downloaded Powertable and like most of what I see.

What I like:

*  The ability to use more datasources than just a table and a single-column
query.
*   The layout which is more readable and understandable than jqgrid from
plugin_wiki

I have certain questions and concerns though:

* Is there documentation somewhere explaining the options?  I could only see
the demo-code.  Some of the links on the page referring to the API does not
work.

* I have tested it this morning on a table with more  just over 8200 entries
and it took 70-90  seconds on Firefox and 30-35 secondes no Chrome to reload
the page from localhost.  That is not usable.  Plugin_wiki's jqgrid does
this in less than a second.
  It seems that it loads the whole table and does not make use of paging
while executing the query.

I have used the following settings:


powerTable = plugins.powerTable
powerTable.dtfeatures['sScrollY'] = '338'
powerTable.dtfeatures['sScrollX'] = '100%'
#powerTable.virtualfields = Virtual()
powerTable.headers = 'fieldname:capitalize'
powerTable.showkeycolumn = True
powerTable.dtfeatures['bJQueryUI'] = request.vars.get('jqueryui',True)
powerTable.uitheme = request.vars.get('theme','redmond')#'smoothness' /
'redmond' /'cupertino'
powerTable.dtfeatures['sPaginationType'] =
request.vars.get('pager','scrolling') # two_button scrolling
powerTable.datasource = db.joernaal


Regards
Johann
-- 
 May grace and peace be yours in abundance through the full knowledge of God
and of Jesus our Lord!  His divine power has given us everything we need for
life and godliness through the full knowledge of the one who called us by
his own glory and excellence.
2 Pet. 1:2b,3a


Re: [web2py] Powertable remarks

2010-12-17 Thread rochacbruno
Hi, thank you for testing the plugin.

I am writing the documentation explaining every option of the API. 

In this First alpha release only client side is available, the table is 
entirely loaded to the client, which is really not usable if you has more than 
500 rows.

I am working right now on Json/XML parser, the table will render only visible 
columns on the first load and take the rest of the data from the server via 
ajax callback (in the same way jqgrid does). Server side processing will be 
available for searching, sorting and pagination too. 

I hope to finish this soon.

In my TODO is:

Server Side processing. 
Inline editings
Nested powertables( now you can only have a simple sqltable, a div or a form as 
details)
Fixed headers and columns. 
More from datatables.net API

Thank you for testing, your feedback will help me so much to continue this 
development. I appreciate every help or suggestion to this plugin. 

I will create a project on Google code to track the issues and host the docs. 

Thank you

Bruno



Em 17/12/2010, às 08:11, Johann Spies johann.sp...@gmail.com escreveu:

 I have downloaded Powertable and like most of what I see.
 
 What I like:
 
 *  The ability to use more datasources than just a table and a single-column 
 query.
 *   The layout which is more readable and understandable than jqgrid from 
 plugin_wiki
 
 I have certain questions and concerns though:
 
 * Is there documentation somewhere explaining the options?  I could only see 
 the demo-code.  Some of the links on the page referring to the API does not 
 work.
 
 * I have tested it this morning on a table with more  just over 8200 entries 
 and it took 70-90  seconds on Firefox and 30-35 secondes no Chrome to reload 
 the page from localhost.  That is not usable.  Plugin_wiki's jqgrid does this 
 in less than a second.
   It seems that it loads the whole table and does not make use of paging 
 while executing the query.  
 
 I have used the following settings:
 
 
 powerTable = plugins.powerTable
 powerTable.dtfeatures['sScrollY'] = '338'
 powerTable.dtfeatures['sScrollX'] = '100%' 
 #powerTable.virtualfields = Virtual()
 powerTable.headers = 'fieldname:capitalize'
 powerTable.showkeycolumn = True
 powerTable.dtfeatures['bJQueryUI'] = request.vars.get('jqueryui',True)
 powerTable.uitheme = request.vars.get('theme','redmond')#'smoothness' / 
 'redmond' /'cupertino'
 powerTable.dtfeatures['sPaginationType'] = 
 request.vars.get('pager','scrolling') # two_button scrolling
 powerTable.datasource = db.joernaal

 
 Regards
 Johann
 -- 
  May grace and peace be yours in abundance through the full knowledge of God 
 and of Jesus our Lord!  His divine power has given us everything we need for 
 life and godliness through the full knowledge of the one who called us by his 
 own glory and excellence. 
 2 Pet. 1:2b,3a
 


Re: [web2py] Powertable remarks

2010-12-17 Thread Phyo Arkar
* I have tested it this morning on a table with more  just over 8200 entries 
and it took 70-90
seconds on Firefox and 30-35 secondes no Chrome to reload the page from 
localhost.  That is
not usable.  Plugin_wiki's jqgrid does this in less than a second.
  It seems that it loads the whole table and does not make use of paging while 
 executing the
query.


WIth jqgrid even without paging , i had successfully loaded 40k
records  within 6 - 8 secs . And local searching , sorting can do in a
snap. jqGrid also supports progressive loading (without paging , it
does ajax to load while scrolling down).

I do not see those features exist in datatables.

On 12/17/10, rochacbruno rochacbr...@gmail.com wrote:
 Hi, thank you for testing the plugin.

 I am writing the documentation explaining every option of the API.

 In this First alpha release only client side is available, the table is
 entirely loaded to the client, which is really not usable if you has more
 than 500 rows.

 I am working right now on Json/XML parser, the table will render only
 visible columns on the first load and take the rest of the data from the
 server via ajax callback (in the same way jqgrid does). Server side
 processing will be available for searching, sorting and pagination too.

 I hope to finish this soon.

 In my TODO is:

 Server Side processing.
 Inline editings
 Nested powertables( now you can only have a simple sqltable, a div or a form
 as details)
 Fixed headers and columns.
 More from datatables.net API

 Thank you for testing, your feedback will help me so much to continue this
 development. I appreciate every help or suggestion to this plugin.

 I will create a project on Google code to track the issues and host the
 docs.

 Thank you

 Bruno



 Em 17/12/2010, às 08:11, Johann Spies johann.sp...@gmail.com escreveu:

 I have downloaded Powertable and like most of what I see.

 What I like:

 *  The ability to use more datasources than just a table and a
 single-column query.
 *   The layout which is more readable and understandable than jqgrid from
 plugin_wiki

 I have certain questions and concerns though:

 * Is there documentation somewhere explaining the options?  I could only
 see the demo-code.  Some of the links on the page referring to the API
 does not work.

 * I have tested it this morning on a table with more  just over 8200
 entries and it took 70-90  seconds on Firefox and 30-35 secondes no Chrome
 to reload the page from localhost.  That is not usable.  Plugin_wiki's
 jqgrid does this in less than a second.
   It seems that it loads the whole table and does not make use of paging
 while executing the query.

 I have used the following settings:


 powerTable = plugins.powerTable
 powerTable.dtfeatures['sScrollY'] = '338'
 powerTable.dtfeatures['sScrollX'] = '100%'
 #powerTable.virtualfields = Virtual()
 powerTable.headers = 'fieldname:capitalize'
 powerTable.showkeycolumn = True
 powerTable.dtfeatures['bJQueryUI'] = request.vars.get('jqueryui',True)
 powerTable.uitheme = request.vars.get('theme','redmond')#'smoothness'
 / 'redmond' /'cupertino'
 powerTable.dtfeatures['sPaginationType'] =
 request.vars.get('pager','scrolling') # two_button scrolling
 powerTable.datasource = db.joernaal


 Regards
 Johann
 --
  May grace and peace be yours in abundance through the full knowledge of
 God and of Jesus our Lord!  His divine power has given us everything we
 need for life and godliness through the full knowledge of the one who
 called us by his own glory and excellence.
 2 Pet. 1:2b,3a




Re: [web2py] Powertable remarks

2010-12-17 Thread Martín Mulone
You fetch 8200 records, this is not good for the server side and
client browser. Perhaps need some tutorial about pagination or
integrated with the plugin.

2010/12/17 Johann Spies johann.sp...@gmail.com:
 I have downloaded Powertable and like most of what I see.

 What I like:

 *  The ability to use more datasources than just a table and a single-column
 query.
 *   The layout which is more readable and understandable than jqgrid from
 plugin_wiki

 I have certain questions and concerns though:

 * Is there documentation somewhere explaining the options?  I could only see
 the demo-code.  Some of the links on the page referring to the API does not
 work.

 * I have tested it this morning on a table with more  just over 8200 entries
 and it took 70-90  seconds on Firefox and 30-35 secondes no Chrome to reload
 the page from localhost.  That is not usable.  Plugin_wiki's jqgrid does
 this in less than a second.
   It seems that it loads the whole table and does not make use of paging
 while executing the query.

 I have used the following settings:


     powerTable = plugins.powerTable
     powerTable.dtfeatures['sScrollY'] = '338'
     powerTable.dtfeatures['sScrollX'] = '100%'
     #powerTable.virtualfields = Virtual()
     powerTable.headers = 'fieldname:capitalize'
     powerTable.showkeycolumn = True
     powerTable.dtfeatures['bJQueryUI'] = request.vars.get('jqueryui',True)
     powerTable.uitheme = request.vars.get('theme','redmond')#'smoothness' /
 'redmond' /'cupertino'
     powerTable.dtfeatures['sPaginationType'] =
 request.vars.get('pager','scrolling') # two_button scrolling
     powerTable.datasource = db.joernaal


 Regards
 Johann
 --
  May grace and peace be yours in abundance through the full knowledge of God
 and of Jesus our Lord!  His divine power has given us everything we need for
 life and godliness through the full knowledge of the one who called us by
 his own glory and excellence.
                                                     2 Pet. 1:2b,3a





-- 
My blog: http://martin.tecnodoc.com.ar
My portfolio *spanish*: http://www.tecnodoc.com.ar
Checkout my last proyect instant-press: http://www.instant2press.com


Re: [web2py] Powertable remarks

2010-12-17 Thread rochacbruno
 WIth jqgrid even without paging , i had successfully loaded 40k records  
 within 6 - 8 secs . 

That is because jqgrid loads limited amount of data per request, i am doing 
this with datatables. And I am working to incorporaye it to the plugin. 

http://www.datatables.net/examples/server_side/pipeline.html

Take a look at other server side examples 

 supports progressive loading (without paging , it does ajax to load while 
 scrolling down). I do not see those features exist in datatables.

Datatables has API events for pagination, its  just a matter of javaScript 
scrolling events calling pagination events. Can be done with datatables.

http://www.datatables.net/development/pagination

As I said, I just started a plugin 6 days ago, this was released soon to be in 
WAE. It is pre-alpha version. Too much work in progress. 

I hope this could be quickly as jqgrid. 

Bruno

Re: [web2py] Powertable remarks

2010-12-17 Thread Phyo Arkar
That is because jqgrid loads limited amount of data per request, i am doing 
this with datatables. And I am working to incorporaye it to the plugin.

Nope , i did loadonce option which load all records atonce.

and my database now is 500k records+

On 12/17/10, rochacbruno rochacbr...@gmail.com wrote:
 WIth jqgrid even without paging , i had successfully loaded 40k records
 within 6 - 8 secs .

 That is because jqgrid loads limited amount of data per request, i am doing
 this with datatables. And I am working to incorporaye it to the plugin.

 http://www.datatables.net/examples/server_side/pipeline.html

 Take a look at other server side examples

 supports progressive loading (without paging , it does ajax to load while
 scrolling down). I do not see those features exist in datatables.

 Datatables has API events for pagination, its  just a matter of javaScript
 scrolling events calling pagination events. Can be done with datatables.

 http://www.datatables.net/development/pagination

 As I said, I just started a plugin 6 days ago, this was released soon to be
 in WAE. It is pre-alpha version. Too much work in progress.

 I hope this could be quickly as jqgrid.

 Bruno


Re: [web2py] Powertable remarks

2010-12-17 Thread Bruno Rocha



 Nope , i did loadonce option which load all records atonce.

 and my database now is 500k records+


Is it loading all this records into a JSON?

I just tested 20k of data loaded in to Java Script Array with this approach
http://www.datatables.net/examples/data_sources/js_array.html

Works well.

-- 

Bruno Rocha
http://about.me/rochacbruno/bio


Re: [web2py] Powertable remarks

2010-12-17 Thread Branko Vukelic
 - Original Message -
 From: rochacbruno
 Sent: 12/17/10 01:38 PM
 To: web2py@googlegroups.com
 Subject: Re: [web2py] Powertable remarks
 
  WIth jqgrid even without paging , i had successfully loaded 40k records 
  within 6 - 8 secs . 
 
 That is because jqgrid loads limited amount of data per request, i am doing 
 this with datatables. And I am working to incorporaye it to the plugin. 

Well, qooxdoo grid loads up 10k records like nothing, so it must be possible. 
Once those records are loaded, you can scroll down and see for yourself.

http://demo.qooxdoo.org/current/demobrowser/#table~Table_Remote_Model.html

--
Branko Vukelic

branko.vuke...@gmx.com

http://www.brankovukelic.com/
http://flickr.com/photos/foxbunny


Re: [web2py] Powertable remarks

2010-12-17 Thread Bruno Rocha
Nice library! I didn't know http://demo.qooxdoo.org/

I just loaded 40k records in just 5 secs (locally) using JavaScript
Array+Pipeline as data source for datatables.

Now I am thinking in a way to use Rows.as_dict() to automate that.


2010/12/17 Branko Vukelic branko.vuke...@gmx.com

  - Original Message -
  From: rochacbruno
  Sent: 12/17/10 01:38 PM
  To: web2py@googlegroups.com
  Subject: Re: [web2py] Powertable remarks
 
   WIth jqgrid even without paging , i had successfully loaded 40k records
 within 6 - 8 secs .
 
  That is because jqgrid loads limited amount of data per request, i am
 doing this with datatables. And I am working to incorporaye it to the
 plugin.

 Well, qooxdoo grid loads up 10k records like nothing, so it must be
 possible. Once those records are loaded, you can scroll down and see for
 yourself.

 http://demo.qooxdoo.org/current/demobrowser/#table~Table_Remote_Model.html

 --
 Branko Vukelic

 branko.vuke...@gmx.com

 http://www.brankovukelic.com/
 http://flickr.com/photos/foxbunny




-- 

Bruno Rocha
http://about.me/rochacbruno/bio


Re: [web2py] Powertable remarks

2010-12-17 Thread Branko Vukelic
 - Original Message -
 From: Bruno Rocha
 Sent: 12/17/10 03:08 PM
 To: web2py@googlegroups.com
 Subject: Re: [web2py] Powertable remarks
 
 Nice library! I didn't know http://demo.qooxdoo.org/

Well, check out their tag line on the homepage http://www.qooxdoo.org/. It's 
not a lie, definitely. It lives up to expectations.

The way qooxdoo works is it has its own model layer wich handles data retrieval 
and conversion. Then you can add this model to any widget, and the widget 
consumes the data. Basically, this means that the table data can be loaded from 
any kind of source. You can ping your server, or you can use a JSONP service, 
or XML, whatever you want. Tehcnically, you could write a model that parses 
HTML pages and extracts data from them. There's no need to adapt your server to 
qooxdoo thanks to this.




--
Branko Vukelic

branko.vuke...@gmx.com

http://www.brankovukelic.com/
http://flickr.com/photos/foxbunny


Re: [web2py] Powertable remarks

2010-12-17 Thread Bruno Rocha
Just wanted to add a detail:

I have not started to develop the plugin to replace or compete jqGrid. I
do not use jQgrid just because I do not like its layout and i've never read
its documentation.

JqGrid or webgrid does not use PluginManager() to config grid option, and I
like the way we do with PluginManager, instead of a method calling as:

 plugin_powerTable(option=,option=)

I prefer line by line:

 mytable = plugins.powerTable
 mytable.datasource = xxx
 mytable.create()

I tried to use Virtual Fields, Virtual Labels and tooltips with Jqgrid and I
got no success.

but, after a post about tables here(6 days ago), I've found in the
dataTables library almost everything I need for most of my projects. and I
use it in a way to improve web2py SQLTABLES (my appadmins is already running
with powerTable). I used too much code from sqlhtml.py SQLTABLE class, I did
not see any code from jqGrid, but I'll do it now to figure out how it loads
data faster and try to bring that to the powerTable plugin.

I think we should always have more options, and certainly jqGrid, Flexigrid
or webgrid or another will be better depending on the project needs.

By now, powerTable is ALPHA not well tested, if you just need to replace
web2py simple SQLTABLEs use powerTable. if you need to load large ammount of
data you have to use a better well tested plugin as jQgrid or webgrid.

If the creators of jQgrid or webgrid plugins or someose else could help me
contributing on server side processing in powerTable will be great
contribution!

The plugin is already compatilble with any option of datatables API:
http://datatables.net/usage/options
http://www.sprymedia.co.uk/article/DataTables+1.4

-- 

Bruno Rocha
http://about.me/rochacbruno/bio


[web2py] Re: delicious is closing

2010-12-17 Thread Tomeu
Ohh zootool is down !!

in his page:

We are offline

The Delicious rumors hit us pretty hard. We are currently working on
the import system and the whole infrastructure to be able to handle
that better. Sorry for the downtime and thanks for your patience!


On 17 dic, 09:19, LightDot light...@gmail.com wrote:
 SEO experts and SEO experts who use Delicious for ranking optimization
 will have a lot of work on their hands these days :)

 Yahooo should have sold the service rather than close it, IMHO.


Re: [web2py] Re: delicious is closing

2010-12-17 Thread Branko Vukelic
Hehe, yeah. Should've seen it coming. :D

 - Original Message -
 From: Tomeu
 Sent: 12/17/10 03:49 PM
 To: web2py-users
 Subject: [web2py] Re: delicious is closing
 
 Ohh zootool is down !!
 
 in his page:
 
 We are offline
 
 The Delicious rumors hit us pretty hard. We are currently working on
 the import system and the whole infrastructure to be able to handle
 that better. Sorry for the downtime and thanks for your patience!
 
 
 On 17 dic, 09:19, LightDot light...@gmail.com wrote:
  SEO experts and SEO experts who use Delicious for ranking optimization
  will have a lot of work on their hands these days :)
 
  Yahooo should have sold the service rather than close it, IMHO.


--
Branko Vukelic

branko.vuke...@gmx.com

http://www.brankovukelic.com/
http://flickr.com/photos/foxbunny


Re: [web2py] Re: delicious is closing

2010-12-17 Thread Bruno Rocha
Hehe, I Imagine that will happen. they are running now to upgrade their Vm's

Nice! hope this come back soon.

2010/12/17 Branko Vukelic branko.vuke...@gmx.com

 Hehe, yeah. Should've seen it coming. :D

  - Original Message -
  From: Tomeu
  Sent: 12/17/10 03:49 PM
  To: web2py-users
  Subject: [web2py] Re: delicious is closing
 
  Ohh zootool is down !!
 
  in his page:
 
  We are offline
 
  The Delicious rumors hit us pretty hard. We are currently working on
  the import system and the whole infrastructure to be able to handle
  that better. Sorry for the downtime and thanks for your patience!
 
 
  On 17 dic, 09:19, LightDot light...@gmail.com wrote:
   SEO experts and SEO experts who use Delicious for ranking
 optimization
   will have a lot of work on their hands these days :)
  
   Yahooo should have sold the service rather than close it, IMHO.


 --
 Branko Vukelic

 branko.vuke...@gmx.com

 http://www.brankovukelic.com/
 http://flickr.com/photos/foxbunny




-- 

Bruno Rocha
http://about.me/rochacbruno/bio


Re: [web2py] Re: delicious is closing

2010-12-17 Thread Branko Vukelic
At least something good happened to zootools. I actually like it a lot. Thanks, 
Bruno.

 - Original Message -
 From: Bruno Rocha
 Sent: 12/17/10 04:48 PM
 To: web2py@googlegroups.com
 Subject: Re: [web2py] Re: delicious is closing
 
 Hehe, I Imagine that will happen. they are running now to upgrade their Vm's
 
 Nice! hope this come back soon.
 
 2010/12/17 Branko Vukelic branko.vuke...@gmx.com
 
  Hehe, yeah. Should've seen it coming. :D
 
   - Original Message -
   From: Tomeu
   Sent: 12/17/10 03:49 PM
   To: web2py-users
   Subject: [web2py] Re: delicious is closing
  
   Ohh zootool is down !!
  
   in his page:
  
   We are offline
  
   The Delicious rumors hit us pretty hard. We are currently working on
   the import system and the whole infrastructure to be able to handle
   that better. Sorry for the downtime and thanks for your patience!
  
  
   On 17 dic, 09:19, LightDot light...@gmail.com wrote:
SEO experts and SEO experts who use Delicious for ranking
  optimization
will have a lot of work on their hands these days :)
   
Yahooo should have sold the service rather than close it, IMHO.
 
 
  --
  Branko Vukelic
 
  branko.vuke...@gmx.com
 
  http://www.brankovukelic.com/
  http://flickr.com/photos/foxbunny
 
 
 
 
 -- 
 
 Bruno Rocha
 http://about.me/rochacbruno/bio


--
Branko Vukelic

branko.vuke...@gmx.com

http://www.brankovukelic.com/
http://flickr.com/photos/foxbunny


Re: [web2py] Powertable remarks

2010-12-17 Thread ron_m
This is a tiny nit pick so my apologies in advance but I thought it might be 
worth mentioning.

I went to the demo page, picked Products and hit the green plus to open the 
details on the last item in the list. The control turned red but nothing 
else appeared to happen. Second time I noticed a scroll bar activated on the 
right side of the form and sure enough if you scroll down there it is. I 
don't know how difficult it would be to expose the part that opened if it is 
out of the current view area. Now that I know not a big deal, just the first 
time I used it I though hmm didn't work.

Thanks for what I think will be a nice addition to the tool set.

Ron


[web2py] Re: Creating database tables tutorial?

2010-12-17 Thread Hybride
Actually, that was the example I tried following. I still have
previous tables from the wizard generator the first time around I
tried to actually create them.

So, I inserted the example into the models/db.py, saved and go to
database administration, but it still shows the previous tables
generated by the wizard:
db.auth_user
db.auth_group
db.auth_membership
db.auth_permission
db.auth_event

Is there some other way of creating/viewing these tables, then
constantly going/creating the tables with the database wizard?
On Dec 15, 4:30 pm, JmiXIII sylvn.p...@gmail.com wrote:
 I suggest you to have a look there 
 :http://web2py.com/examples/default/examples
 = go to example 29

 Your first try is a bit 'curious' and I dont think it this what you
 want to do.
 Another easy way to experiment web2py is using the wizard:
 _ Launch the wizard
 _ Create tables (read the comments)
 _ Create the fields

 = generate and have a look to db_wizard.py

 

 On 15 déc, 23:02, Hybride mshybr...@gmail.com wrote:

  Hi everyone,

  Am currently using SQLite3 but have no issues moving over to MySQL,
  whichever is easier I guess. I've been trying to create the database
  tables using the examples on web2py (like the whole pets/dog example),
  copying and pasting the code from that example into my own
  application, then trying to generate the tables. I've also tried to
  create my own tables, with the code:

  db.define_table('person',Field('person'))

  Placing that in the controller, and letting it go free. I think you
  can guess that it was unsuccessful. Is there any tutorial on web2py
  that shows how to step-by-step create the tables? Do you have to first
  create the tables in the database itself, then use define_table (I've
  tried, unsuccessful)?

  In any case, if anyone could point me in the right direction to said
  tutorials (or give me the gist of it themselves, in MySQL preferably),
  that would be greatly appreciated.




[web2py] Re: How to fetch already exiting table data with out defining new table

2010-12-17 Thread sushanth
Thank you for the info, i am doing the same.but only problem i found i
am not able to run
return dict(records=db().select(db.tablename.ALL))

it throws below error

Traceback (most recent call last):
  File /home/sushanth/Desktop/web2py/gluon/restricted.py, line 188,
in restricted
exec ccode in environment
  File /home/sushanth/Desktop/web2py/applications/welcome/controllers/
default.py, line 104, in module
  File /home/sushanth/Desktop/web2py/gluon/globals.py, line 96, in
lambda
self._caller = lambda f: f()
  File /home/sushanth/Desktop/web2py/applications/welcome/controllers/
default.py, line 66, in contacts
return dict(records=db().select(db.gtmaster.ALL))
  File /home/sushanth/Desktop/web2py/gluon/sql.py, line 1400, in
__getattr__
return dict.__getitem__(self,key)
KeyError: 'tablename'

On Dec 16, 11:47 pm, pbreit pbreitenb...@gmail.com wrote:
 Here's one:https://groups.google.com/d/topic/web2py/mH5Toup0vwk/discussion


Re: [web2py] Powertable remarks

2010-12-17 Thread rochacbruno
  I noticed a scroll bar activated on the right side of the form and sure 
 enough if you scroll down there it is. I don't know how difficult it would be 
 to expose the part that opened if it is out of the current view area.

I'll try to bring it up to the viewport. 

Thank you for mentioning. 

[web2py] parse_get_post_vars change

2010-12-17 Thread NuclearDragon
So, I am in the process of upgrading Web2py from version 1.67 to
1.89.5. Ouch. One of the things I encountered is that request.vars
will now include a list of duplicate values, rather than a single
value (not a list) as it previously did. For example, our url includes
a _next variable. So does the form when posting, including the Cancel
action. So now I end up with a list of 2 duplicate values when I test
set  redirurl = request.vars.get('_next'). Rather than change that
umpteen times in our app, I am proposing a change to the function
'parse_get_post_vars' in main.py.

def parse_get_post_vars(request, environ):

# always parse variables in URL for GET, POST, PUT, DELETE, etc.
in get_vars
dget = cgi.parse_qsl(request.env.query_string,
keep_blank_values=1)
for (key, value) in dget:
if key in request.get_vars:
if isinstance(request.get_vars[key], list):
request.get_vars[key] += [value]
else:
request.get_vars[key] = [request.get_vars[key]] +
[value]
else:
request.get_vars[key] = value
request.vars[key] = request.get_vars[key]

# parse POST variables on POST, PUT, BOTH only in post_vars
request.body = copystream_progress(request) ### stores request
body
if (request.body and request.env.request_method in ('POST', 'PUT',
'BOTH')):
dpost =
cgi.FieldStorage(fp=request.body,environ=environ,keep_blank_values=1)
# The same detection used by FieldStorage to detect multipart
POSTs
is_multipart = dpost.type[:10] == 'multipart/'
request.body.seek(0)
isle25 = sys.version_info[1] = 5

def listify(a):
return (not isinstance(a,list) and [a]) or a
try:
keys = sorted(dpost)
except TypeError:
keys = []
for key in keys:
dpk = dpost[key]
# if en element is not a file replace it with its value
else leave it alone
if isinstance(dpk, list):
if not dpk[0].filename:
value = [x.value for x in dpk]
else:
value = [x for x in dpk]
elif not dpk.filename:
value = dpk.value
else:
value = dpk
pvalue = listify(value)
if key in request.vars:
gvalue = listify(request.vars[key])
if isle25:
value = pvalue + gvalue
elif is_multipart:
pvalue = pvalue[len(gvalue):]
else:
pvalue = pvalue[:-len(gvalue)]
request.vars[key] = value
if len(pvalue):
request.post_vars[key] = (len(pvalue)1 and pvalue) or
pvalue[0]
### Begin added code
for k,v in request.vars.iteritems():
if isinstance(v, list) and len(v)==2:
request.vars[k] = v[0] if v[0] == v[1] else v
### End added code


Thoughts? Comments? Any reason I shouldn't make this change?


[web2py] Re: LEFT JOIN in web2py

2010-12-17 Thread DenesL

Hi Annet,

try a ',' instead of the '' inside the 'left' part.


On Dec 17, 4:12 am, annet annet.verm...@gmail.com wrote:
 In my model I have a company table and a person table and a
 combination table that links the two together. Some companies allow
 there people to maintain a profile text, in addition some companies
 allow there people to also upload a picture of themselves. To meet
 these requirements I defined a table profiletext and a table avatar
 referencing the person table.

 In my view I would like to list the people that work for a company,
 and in case they wrote a profile text and/or uploaded a picture show
 that picture. The problem is, I am struggling with the left join
 needed to accomplish this. I tried:

 print
 db((db.companyperson.person_id==db.person.id)(db.companyperson.bedrijf_id==2))
 \ 
 ._select(db.person.first_name,db.person.last_name,db.profiletext.text,db.avatar.link,
 \
 left=((db.avatar.on(db.companyperson.person_id==db.avatar.person_id)\
 (db.profiletext.on(db.companyperson.person_id==db.profiletext.person_id
 \
 ,orderby=db.profiletext.order)

 Running this code results in the following error:

 Traceback (most recent call last):
   File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
 restricted.py, line 188, in restricted
     exec ccode in environment
   File /Library/Python/2.5/site-packages/web2py_1.87.3/applications/
 demo/controllers/default.py, line 72, in module
   File /Library/Python/2.5/site-packages/web2py_1.87.3/gluon/
 globals.py, line 96, in lambda
     self._caller = lambda f: f()
   File /Library/Python/2.5/site-packages/web2py_1.87.3/applications/
 demo/controllers/default.py, line 26, in print_team

 (db.profieltekst.on(db.bedrijfcontactpersoon.contactpersoon_id==db.profieltekst.contactpersoon_id
 \
 TypeError: unsupported operand type(s) for : 'SQLJoin' and 'SQLJoin'

 This is the SQL query:

 SELECT *
 FROM companyperson JOIN person ON companyperson.person_id=person.id
 LEFT JOIN profiletext ON companyperson.person_id=profiletext.person_id
 LEFT JOIN
 avatar ON companyperson.person_id=avatar.person_id

 What is the correcet syntax for this query in web2py?

 Kind regards,

 Annet


[web2py] Re: delicious is closing

2010-12-17 Thread dlypka
I'm doing one for GAE.

I have it to the point where it can upload the .htm file that is
exported from Firefox.
It uses taskqueues and my own recursive logic similar to Map Reduce to
do the upload to GAE.
It is web2py based but uses native GAE Datastore api calls for speed.
They render to my own mulithreaded Treeview in a split second.

The goal functionality would be to do all that Zoo Tool stuff but a
lot more as well.

I would be interested in assembling a team to help finish it and do an
IPO...
Then we can buy own own island and start something even more cool

Anybody interested please email me

- Dave Lypka
  dly...@gmail.com.


Thanks.

On Dec 16, 6:26 pm, Bruno Rocha rochacbr...@gmail.com wrote:
 Nice idea, host it on GAE.

 2010/12/16 Albert Abril albert.ab...@gmail.com

  I'm using delicious from long time ago.
  Today I read that yahoo will close delicious soon.
  It's time to migrate to my own bookmark app, question is.. there's a
  bookmark application wrote in web2py, should I start one? :D

  Kind regards!

  --
  Albert Abril,
  @desmondo
 http://bressol.org

 --

 Bruno Rochahttp://about.me/rochacbruno/bio


[web2py] Re: Alternative Auth Fields (not additional ones)?

2010-12-17 Thread DenesL

Try setting

db.auth_user.last_name.requires=[]

in your model after auth is defined or in your action before the form.



On Dec 17, 12:44 am, Greg greg.kr...@gmail.com wrote:
 Hello,

 When my users register I won't have any need for them to enter First
 name or Last name. I really only need username, email address and
 password. I can change the label for first_name to 'Username', but
 they are still required to enter something in the Last Name field.
 I've tried setting last_name.readable, writeable, and required to
 False, but it still requires the field.

 I realize they are largely hard-coded, but is there any way around the
 built-in auth table requirements without breaking things?

 Thanks,

 greg


[web2py] Re: delicious is closing

2010-12-17 Thread dlypka
I'm doing one for GAE.
I have it to the point where it can upload the .htm file that is
exported from Firefox.
It uses taskqueues and my own recursive logic similar to Map Reduce
to
do the upload to GAE.
It is web2py based but uses native GAE Datastore api calls for speed.
They render to my own mulithreaded Treeview in a split second.
The goal functionality would be to do all that Zoo Tool stuff but a
lot more as well.
I would be interested in assembling a team to help finish it and do
an
IPO...
Then we can buy our own island and start something even more cool
Anybody interested please email me
- Dave Lypka
  dly...@gmail.com.
Thanks.

On Dec 16, 6:22 pm, Albert Abril albert.ab...@gmail.com wrote:
 I'm using delicious from long time ago.
 Today I read that yahoo will close delicious soon.
 It's time to migrate to my own bookmark app, question is.. there's a
 bookmark application wrote in web2py, should I start one? :D

 Kind regards!

 --
 Albert Abril,
 @desmondohttp://bressol.org


Re: [web2py] Re: How to fetch already exiting table data with out defining new table

2010-12-17 Thread Kenneth Lundström

 return dict(records=db().select(db.tablename.ALL))

You can´t use the word tablename if you don´t have a table named 
tablename. If you wan´t to have everything from a table named customers use

return dict(records=db().select(db.customers.ALL))


Kenneth


it throws below error

Traceback (most recent call last):
   File /home/sushanth/Desktop/web2py/gluon/restricted.py, line 188,
in restricted
 exec ccode in environment
   File /home/sushanth/Desktop/web2py/applications/welcome/controllers/
default.py, line 104, inmodule
   File /home/sushanth/Desktop/web2py/gluon/globals.py, line 96, in
lambda
 self._caller = lambda f: f()
   File /home/sushanth/Desktop/web2py/applications/welcome/controllers/
default.py, line 66, in contacts
 return dict(records=db().select(db.gtmaster.ALL))
   File /home/sushanth/Desktop/web2py/gluon/sql.py, line 1400, in
__getattr__
 return dict.__getitem__(self,key)
KeyError: 'tablename'

On Dec 16, 11:47 pm, pbreitpbreitenb...@gmail.com  wrote:

Here's one:https://groups.google.com/d/topic/web2py/mH5Toup0vwk/discussion




[web2py] Re: LEFT JOIN in web2py

2010-12-17 Thread annet
Hi Denes,

Thanks, problem solved!

Kind regards,

Annet


[web2py] Re: Powertable remarks

2010-12-17 Thread Carlos
Hi,

Just in case it helps (e.g. to check their apis, feature set, etc.),
following is (I believe) the most powerful treegrid out there:

   http://www.treegrid.com

Take care,

   Carlos

On Dec 17, 11:17 am, rochacbruno rochacbr...@gmail.com wrote:
   I noticed a scroll bar activated on the right side of the form and sure 
  enough if you scroll down there it is. I don't know how difficult it would 
  be to expose the part that opened if it is out of the current view area.

 I'll try to bring it up to the viewport.

 Thank you for mentioning.


Re: [web2py] Re: it case you missed it...

2010-12-17 Thread appydev
Greetings.

I am a new member of the community, however, I will take the dare to
give my humble opinion:

I think that a license of type BSD or MIT would be beneficial for web2py.

I think the GPL license, frighten off the business and other potential
users. Some do not understand the exception and others did not read it.

Do not get me wrong, I love Free Software, moreover, are said to permissive
licenses given the total freedom.

I think that a license of type permissive favor the growth of the
community web2py and I think we should
not fear, because, as stated above, we take the example of
communities of Django and Ruby on Rails, two very large
communities, and very active communities that have facilitated the evolution
of free software.


2010/12/16 mdipierro mdipie...@cs.depaul.edu

 GPL2 creates the loophole. The AGPL closes the loophole. The GPL3 was
 supposed to incorporate language from AGPL and close the loophole but
 did not. It is not clear to me whether GPL3 closes the loophole or
 not. If it does not (like GPL2 does not).

 I have no objection to move to GPL3.

 Yet that does not help in clarifying the web2py license.

 As a hypothetical question. Who here would oppose to moving to BSD or
 MIT or other more permissive license?

 Massimo

 On Dec 16, 2:54 pm, Branko Vukelic branko.vuke...@gmx.com wrote:
   - Original Message -
   From: mdipierro
   Sent: 12/16/10 07:56 PM
   To: web2py-users
   Subject: [web2py] Re: it case you missed it...
   If we were to move from GPL2 to GPL3 people would not be allowed to
   modify web2py running on their servers without making available the
   source code of their changes. I do not see any reason for requiring
   this.
 
  What's AGPL for then? Wasn't _AGPL_ supposed to prevent that? Anyway, I
 think GPLv3 makes i possible to use code licensed under licenses like MIT
 and BSD in a GPLv3 project, which is otherwise a bit incompatible. Or did I
 miss something?
 
  --
  Branko Vukelic
 
  branko.vuke...@gmx.com
 
  http://www.brankovukelic.com/http://flickr.com/photos/foxbunny



[web2py] Re: it case you missed it...

2010-12-17 Thread mdipierro
I think we can all agree on two issues:
1) the current license (GPL + exception) is OK for almost everybody
2) the current license is unclear and it is confused with pure GPL.
That is limiting the adoption of web2py. This needs to be addressed,

How do people feel about the following license:

GPL3 + Apache

GPL3 and Apache are compatible (GPL2 and Apache are not). Apache is
very similar to BSD but forces users who distribute modified versions
to spell in detail the changes they make. That should be sufficient to
discourage forks but not to discourage people to use it in commercial
products.

Massimo


On Dec 17, 1:52 pm, appydev appy...@gmail.com wrote:
 Greetings.

 I am a new member of the community, however, I will take the dare to
 give my humble opinion:

 I think that a license of type BSD or MIT would be beneficial for web2py.

 I think the GPL license, frighten off the business and other potential
 users. Some do not understand the exception and others did not read it.

 Do not get me wrong, I love Free Software, moreover, are said to permissive
 licenses given the total freedom.

 I think that a license of type permissive favor the growth of the
 community web2py and I think we should
 not fear, because, as stated above, we take the example of
 communities of Django and Ruby on Rails, two very large
 communities, and very active communities that have facilitated the evolution
 of free software.

 2010/12/16 mdipierro mdipie...@cs.depaul.edu

  GPL2 creates the loophole. The AGPL closes the loophole. The GPL3 was
  supposed to incorporate language from AGPL and close the loophole but
  did not. It is not clear to me whether GPL3 closes the loophole or
  not. If it does not (like GPL2 does not).

  I have no objection to move to GPL3.

  Yet that does not help in clarifying the web2py license.

  As a hypothetical question. Who here would oppose to moving to BSD or
  MIT or other more permissive license?

  Massimo

  On Dec 16, 2:54 pm, Branko Vukelic branko.vuke...@gmx.com wrote:
- Original Message -
From: mdipierro
Sent: 12/16/10 07:56 PM
To: web2py-users
Subject: [web2py] Re: it case you missed it...
If we were to move from GPL2 to GPL3 people would not be allowed to
modify web2py running on their servers without making available the
source code of their changes. I do not see any reason for requiring
this.

   What's AGPL for then? Wasn't _AGPL_ supposed to prevent that? Anyway, I
  think GPLv3 makes i possible to use code licensed under licenses like MIT
  and BSD in a GPLv3 project, which is otherwise a bit incompatible. Or did I
  miss something?

   --
   Branko Vukelic

   branko.vuke...@gmx.com

  http://www.brankovukelic.com/http://flickr.com/photos/foxbunny




Re: [web2py] Re: it case you missed it...

2010-12-17 Thread Branko Vukelic
 - Original Message -
 From: mdipierro
 Sent: 12/17/10 09:39 PM
 To: web2py-users
 Subject: [web2py] Re: it case you missed it...
 
 I think we can all agree on two issues:
 1) the current license (GPL + exception) is OK for almost everybody
 2) the current license is unclear and it is confused with pure GPL.
 That is limiting the adoption of web2py. This needs to be addressed,
 
 How do people feel about the following license:
 
 GPL3 + Apache
 
 GPL3 and Apache are compatible (GPL2 and Apache are not). Apache is
 very similar to BSD but forces users who distribute modified versions
 to spell in detail the changes they make. That should be sufficient to
 discourage forks but not to discourage people to use it in commercial
 products.

You were one step in front of me. :) +1


--
Branko Vukelic

branko.vuke...@gmx.com

http://www.brankovukelic.com/
http://flickr.com/photos/foxbunny


[web2py] Re: Alternative Auth Fields (not additional ones)?

2010-12-17 Thread Greg
Thank you, that does work.

On Dec 17, 11:54 am, DenesL denes1...@yahoo.ca wrote:
 Try setting

 db.auth_user.last_name.requires=[]

 in your model after auth is defined or in your action before the form.

 On Dec 17, 12:44 am, Greg greg.kr...@gmail.com wrote:







  Hello,

  When my users register I won't have any need for them to enter First
  name or Last name. I really only need username, email address and
  password. I can change the label for first_name to 'Username', but
  they are still required to enter something in the Last Name field.
  I've tried setting last_name.readable, writeable, and required to
  False, but it still requires the field.

  I realize they are largely hard-coded, but is there any way around the
  built-in auth table requirements without breaking things?

  Thanks,

  greg


[web2py] Re: Powertable remarks

2010-12-17 Thread Anthony
On Dec 17, 2:01 pm, Carlos carlosgali...@gmail.com wrote:
 Hi,

 Just in case it helps (e.g. to check their apis, feature set, etc.),
 following is (I believe) the most powerful treegrid out there:

    http://www.treegrid.com

It's not free, though: http://www.treegrid.com/treegrid/www/#Prices.html'Prices


[web2py] Re: it case you missed it...

2010-12-17 Thread ron_m
I think that is a good solution.


Re: [web2py] delicious is closing

2010-12-17 Thread Jonathan Lundell
On Dec 17, 2010, at 12:19 AM, LightDot wrote:
 SEO experts and SEO experts who use Delicious for ranking optimization will 
 have a lot of work on their hands these days :)
 
 Yahooo should have sold the service rather than close it, IMHO.

There's some confusion on that score.

What’s Next for Delicious?
John Gruber
12/17/10 12:51 PM
Daring Fireball
The actual blog is slammed, so here it is from Google’s cache:

Is Delicious being shut down? And should I be worried about my data?

No, we are not shutting down Delicious. While we have determined that there is 
not a strategic fit at Yahoo!, we believe there is a ideal home for Delicious 
outside of the company where it can be resourced to the level where it can be 
competitive.

What is Yahoo! going to do with Delicious?

We’re actively thinking about the future of Delicious and we believe there is a 
home outside the company that would make more sense for the service and our 
users. We’re in the process of exploring a variety of options and talking to 
companies right now. And we’ll share our plans with you as soon as we can.

Note that Yahoo does not dispute that the entire Delicious team has been fired, 
though. What kind of sense does this make? We’d like to sell the service, find 
it a new home, and to help, we’ve fired the entire product team, effective 
immediately.

 ★ 

[web2py] interval in a list

2010-12-17 Thread Rick
Hi,

In the database there are value records for 31 days. Now I'm trying to
make a html file where a value is presented for each day of a week.
The code below presents all the recorded values, and I don't know how
to make it printing the 7 first records only, or the last 3 records.

Thanks in advance for help.

table
tr
tdDay| br Value| /td
{{for record in records:}}
td{{=record.day}} br {{=record.value}}/td
{{pass}}
/tr
/table


[web2py] Run Web2py as a Service? on Ubuntu Lucid?

2010-12-17 Thread ghoulmann
I'm thankful this community is here. I'm working on a project for the
Sahana-Eden team [1]. It calls for running web2py as a service. I was
thankful to find documentation in the 3rd edition Official Web2py Book
[2]. Sadly, when I follow the docs I can't get the service running. /
etc/init.d/web2py start returns no errors; restart returns no errors,
and status returns nothing. Netstat tells me the interface isn't
listening on port 8000.

I did use the scripts/web2py.ubuntu.sh script, and did as instructed
in the documentation. I made changes to some of the paramaters near
the top of the script; I've made it available as a pastebin [3].

I've double-checked the daemon directory, and believe it to be
correct. I have created web2py user with no password (using useradd);
as web2py is new to me, I'm not sure that's necessary, but it has been
done. Web2py has precisely the same mode as a working service (webmin
in this case) and is owned root:root. Mode is rwxr-xr-x.

I would be very grateful for any guidance, suggestions, improvements,
encouragement you can offer.

Ultimately, it's the high school students that have committed to the
project that will benefit - I'm in unfamiliar territory and learning
along with them.

Rik


[1] http://eden.sahanafoundation.org/wiki/BluePrintlivecdinstaller
[2] http://web2py.com/book/default/chapter/11#Start-as-Linux-Daemon
[3] http://pastebin.com/9Uz45k3G


[web2py] Re: Run Web2py as a Service? on Ubuntu Lucid?

2010-12-17 Thread mdipierro
did you try start it simply with

python web2py.py -a password

or

nohup python web2py.py -a password 

Does it work fine in these cases?

On Dec 17, 4:59 pm, ghoulmann rikgold...@gmail.com wrote:
 I'm thankful this community is here. I'm working on a project for the
 Sahana-Eden team [1]. It calls for running web2py as a service. I was
 thankful to find documentation in the 3rd edition Official Web2py Book
 [2]. Sadly, when I follow the docs I can't get the service running. /
 etc/init.d/web2py start returns no errors; restart returns no errors,
 and status returns nothing. Netstat tells me the interface isn't
 listening on port 8000.

 I did use the scripts/web2py.ubuntu.sh script, and did as instructed
 in the documentation. I made changes to some of the paramaters near
 the top of the script; I've made it available as a pastebin [3].

 I've double-checked the daemon directory, and believe it to be
 correct. I have created web2py user with no password (using useradd);
 as web2py is new to me, I'm not sure that's necessary, but it has been
 done. Web2py has precisely the same mode as a working service (webmin
 in this case) and is owned root:root. Mode is rwxr-xr-x.

 I would be very grateful for any guidance, suggestions, improvements,
 encouragement you can offer.

 Ultimately, it's the high school students that have committed to the
 project that will benefit - I'm in unfamiliar territory and learning
 along with them.

 Rik

 [1]http://eden.sahanafoundation.org/wiki/BluePrintlivecdinstaller
 [2]http://web2py.com/book/default/chapter/11#Start-as-Linux-Daemon
 [3]http://pastebin.com/9Uz45k3G


[web2py] Re: interval in a list

2010-12-17 Thread Luther Goh Lu Feng
From 
http://web2py.com/book/default/chapter/06#orderby,-groupby,-limitby,-distinct

I think the following may work:

for row in db().select(db.table.ALL, limitby=(0, 7)):
print row.record

for row in db().select(db.table.ALL, limitby=(0, 3).
orderby=~db.table.id):
print row.record



On Dec 18, 7:30 am, Rick sababa.sab...@gmail.com wrote:
 Hi,

 In the database there are value records for 31 days. Now I'm trying to
 make a html file where a value is presented for each day of a week.
 The code below presents all the recorded values, and I don't know how
 to make it printing the 7 first records only, or the last 3 records.

 Thanks in advance for help.

 table
         tr
                 tdDay| br Value| /td
                 {{for record in records:}}
                 td{{=record.day}} br {{=record.value}}/td
                 {{pass}}
         /tr
 /table


[web2py] Re: interval in a list

2010-12-17 Thread Rick
Thanks a lot! The final code looks like this:
{{for record in db().select(db.table.ALL, orderby=db.table.day,
limitby=(0, 7)):}}

On Dec 18, 12:59 am, Luther Goh Lu Feng elf...@yahoo.com wrote:
 Fromhttp://web2py.com/book/default/chapter/06#orderby,-groupby,-limitby,-...

 I think the following may work:

 for row in db().select(db.table.ALL, limitby=(0, 7)):
         print row.record

 for row in db().select(db.table.ALL, limitby=(0, 3).
 orderby=~db.table.id):
         print row.record

 On Dec 18, 7:30 am, Rick sababa.sab...@gmail.com wrote:







  Hi,

  In the database there are value records for 31 days. Now I'm trying to
  make a html file where a value is presented for each day of a week.
  The code below presents all the recorded values, and I don't know how
  to make it printing the 7 first records only, or the last 3 records.

  Thanks in advance for help.

  table
          tr
                  tdDay| br Value| /td
                  {{for record in records:}}
                  td{{=record.day}} br {{=record.value}}/td
                  {{pass}}
          /tr
  /table


[web2py] Re: interval in a list

2010-12-17 Thread Rick
Sorry for spamming, but I want to be exact. Here is the final code,
where n is the week number:
{{for record in db().select(db.table.ALL, orderby=db.table.day,
limitby=(n*0, n*7)):}}

On Dec 18, 1:24 am, Rick sababa.sab...@gmail.com wrote:
 Thanks a lot! The final code looks like this:
 {{for record in db().select(db.table.ALL, orderby=db.table.day,
 limitby=(0, 7)):}}

 On Dec 18, 12:59 am, Luther Goh Lu Feng elf...@yahoo.com wrote:







  Fromhttp://web2py.com/book/default/chapter/06#orderby,-groupby,-limitby,-...

  I think the following may work:

  for row in db().select(db.table.ALL, limitby=(0, 7)):
          print row.record

  for row in db().select(db.table.ALL, limitby=(0, 3).
  orderby=~db.table.id):
          print row.record

  On Dec 18, 7:30 am, Rick sababa.sab...@gmail.com wrote:

   Hi,

   In the database there are value records for 31 days. Now I'm trying to
   make a html file where a value is presented for each day of a week.
   The code below presents all the recorded values, and I don't know how
   to make it printing the 7 first records only, or the last 3 records.

   Thanks in advance for help.

   table
           tr
                   tdDay| br Value| /td
                   {{for record in records:}}
                   td{{=record.day}} br {{=record.value}}/td
                   {{pass}}
           /tr
   /table


[web2py] Re: interval in a list

2010-12-17 Thread Rick
Oh no, the code above failed. Here is the final code where n is the
week number:
{{for record in db().select(db.table.ALL, orderby=db.table.day,
limitby=((n-1)*7, n*7)):}}

On Dec 18, 1:30 am, Rick sababa.sab...@gmail.com wrote:
 Sorry for spamming, but I want to be exact. Here is the final code,
 where n is the week number:
 {{for record in db().select(db.table.ALL, orderby=db.table.day,
 limitby=(n*0, n*7)):}}

 On Dec 18, 1:24 am, Rick sababa.sab...@gmail.com wrote:







  Thanks a lot! The final code looks like this:
  {{for record in db().select(db.table.ALL, orderby=db.table.day,
  limitby=(0, 7)):}}

  On Dec 18, 12:59 am, Luther Goh Lu Feng elf...@yahoo.com wrote:

   Fromhttp://web2py.com/book/default/chapter/06#orderby,-groupby,-limitby,-...

   I think the following may work:

   for row in db().select(db.table.ALL, limitby=(0, 7)):
           print row.record

   for row in db().select(db.table.ALL, limitby=(0, 3).
   orderby=~db.table.id):
           print row.record

   On Dec 18, 7:30 am, Rick sababa.sab...@gmail.com wrote:

Hi,

In the database there are value records for 31 days. Now I'm trying to
make a html file where a value is presented for each day of a week.
The code below presents all the recorded values, and I don't know how
to make it printing the 7 first records only, or the last 3 records.

Thanks in advance for help.

table
        tr
                tdDay| br Value| /td
                {{for record in records:}}
                td{{=record.day}} br {{=record.value}}/td
                {{pass}}
        /tr
/table


Re: [web2py] Re: uWSGI + Cherokee + web2py - a howto.

2010-12-17 Thread pbreit
Oops: also very similar to Ivan's instructions.

[web2py] variables

2010-12-17 Thread Rick
Hi,

I want to change the value of a variable by clicking on an a tag,
but can't find any information about the topic. I suppose the code
would look something like this:

{{=A('', request  n=n-1) }}

Thanks in advance for help


[web2py] variables

2010-12-17 Thread Rick
Hi,

I want to change the value of a variable by clicking on an a tag,
but can't find any information about the topic. I suppose the code
would look something like this:

{{=A('', request  n=n-1) }}

Thanks in advance for help


[web2py] Re: variables

2010-12-17 Thread pbreit
I don't really understand the question. Do you want to change a JavaScript 
variable? Or a variable in your web2py code? I don't think you would be able 
to modify a web2py variable as the result of a click. By the time the suer 
views your page, all the web2py code has been rendered into HTML. You'll 
either need to code some JavaScript or perform some sort of Ajax call back 
to your server.

What exactly are you trying to do?


Re: [web2py] Re: Powertable remarks

2010-12-17 Thread Bruno Rocha
I liked this treegrid library, but I think it is visually poluted, too much
complicated, I always need a simple dynamic html tables (just like SQLTABLE)
but including pagination, just one level of nested detail, edit in-line and
search. In adition with DAL virtual fields for live
calculations/transformations.

Take web2py appadmin as example, imagine a system with more than 500 users
registered (natalanimal.com.br has 1001+ users registered, and ~40 donations
by day). it is not easy to manage this data only with default appadmin
tables, and I found so complicated to customize jqGrid for doing that. else,
jQGrid, Ext js, YUI grid and others are so complicated for doing simple
things like that.

I also have a 'Simple Agile Tool' which I use to manage scrum projects, I
never loads more than 100 records in a single table ( because dashboards are
filtered per sprint/project/goal. In this case, if an agile project has more
than 100 records per sprint this is not being agile.

Was because of this, that I started developing the powerTable plugin to wrap
datatables library together with web2py features.

web2py and datatables is a perfect match. web2py has the best data access
layer for working with this library.

I am working on dict, Json, XMl parser to work server side, I am sure it
will be a good option for grids in web2py applications.

somebody knows who created jQgrid and webgrid plugin?









-- 

Bruno Rocha
http://about.me/rochacbruno/bio


Re: [web2py] Re: Powertable remarks

2010-12-17 Thread Branko Vukelic
In other words, there's no silver bullet. ;)

 - Original Message -
 From: Bruno Rocha
 Sent: 12/18/10 02:43 AM
 To: web2py@googlegroups.com
 Subject: Re: [web2py] Re: Powertable remarks
 
 I liked this treegrid library, but I think it is visually poluted, too much
 complicated, I always need a simple dynamic html tables (just like SQLTABLE)
 but including pagination, just one level of nested detail, edit in-line and
 search. In adition with DAL virtual fields for live
 calculations/transformations.
 
 Take web2py appadmin as example, imagine a system with more than 500 users
 registered (natalanimal.com.br has 1001+ users registered, and ~40 donations
 by day). it is not easy to manage this data only with default appadmin
 tables, and I found so complicated to customize jqGrid for doing that. else,
 jQGrid, Ext js, YUI grid and others are so complicated for doing simple
 things like that.
 
 I also have a 'Simple Agile Tool' which I use to manage scrum projects, I
 never loads more than 100 records in a single table ( because dashboards are
 filtered per sprint/project/goal. In this case, if an agile project has more
 than 100 records per sprint this is not being agile.
 
 Was because of this, that I started developing the powerTable plugin to wrap
 datatables library together with web2py features.
 
 web2py and datatables is a perfect match. web2py has the best data access
 layer for working with this library.
 
 I am working on dict, Json, XMl parser to work server side, I am sure it
 will be a good option for grids in web2py applications.
 
 somebody knows who created jQgrid and webgrid plugin?
 
 
 
 
 
 
 
 
 
 -- 
 
 Bruno Rocha
 http://about.me/rochacbruno/bio


--
Branko Vukelic

branko.vuke...@gmx.com

http://www.brankovukelic.com/
http://flickr.com/photos/foxbunny


[web2py] Re: variables

2010-12-17 Thread Rick
Thanks for the replies! The variable that I'm operating with is python
type, not javascript. Mdipierro, your solution looks nice, but i can't
get it working. The value of the variable doesn't seem to change. Here
is my code:

from views/default/index.html:
{{n=1}}
a href=# onclick=ajax('{{=URL('plus_n')}}',[],':eval');return
falseplus/a
{{=n}}

controller.py
def plus_n():
# check this was called by the ajax post
if request.env.request_method=='POST':
# do anything you need to do
session.n=session.n+1
# optional return instructions in JS
return $('.flash').html('n was incremented').slideDown();


On Dec 18, 2:26 am, pbreit pbreitenb...@gmail.com wrote:
 I don't really understand the question. Do you want to change a JavaScript
 variable? Or a variable in your web2py code? I don't think you would be able
 to modify a web2py variable as the result of a click. By the time the suer
 views your page, all the web2py code has been rendered into HTML. You'll
 either need to code some JavaScript or perform some sort of Ajax call back
 to your server.

 What exactly are you trying to do?


Re: [web2py] Re: Powertable remarks

2010-12-17 Thread Bruno Rocha
2010/12/17 Branko Vukelic branko.vuke...@gmx.com

 In other words, there's no silver bullet. ;)


My wife just told me:
Why are you so focused on these tables stuff, if
already exists microsoft excel, and everybody uses it?

LOL!

-- 

Bruno Rocha
http://about.me/rochacbruno/bio


[web2py] Re: variables

2010-12-17 Thread Luther Goh Lu Feng
You can use javascript or jquery(since web2py includes jquery) to do
this:

==javascript==
$('#some_id).click(function()
  {
 $('#target).val( ($('#target).val()+1) );
  }
)

==html==
span id=some_ida href=# Click me/a/span

span id=target2/span


This should more or less work.

On Dec 18, 10:02 am, Rick sababa.sab...@gmail.com wrote:
 Thanks for the replies! The variable that I'm operating with is python
 type, not javascript. Mdipierro, your solution looks nice, but i can't
 get it working. The value of the variable doesn't seem to change. Here
 is my code:

 from views/default/index.html:
 {{n=1}}
 a href=# onclick=ajax('{{=URL('plus_n')}}',[],':eval');return
 falseplus/a
 {{=n}}

 controller.py
 def plus_n():
     # check this was called by the ajax post
     if request.env.request_method=='POST':
         # do anything you need to do
         session.n=session.n+1
         # optional return instructions in JS
         return $('.flash').html('n was incremented').slideDown();

 On Dec 18, 2:26 am, pbreit pbreitenb...@gmail.com wrote:







  I don't really understand the question. Do you want to change a JavaScript
  variable? Or a variable in your web2py code? I don't think you would be able
  to modify a web2py variable as the result of a click. By the time the suer
  views your page, all the web2py code has been rendered into HTML. You'll
  either need to code some JavaScript or perform some sort of Ajax call back
  to your server.

  What exactly are you trying to do?


[web2py] helper tabs

2010-12-17 Thread Luis Díaz
Greetings.

I like working with tabs
here posted something that I designed,

http://www.box.net/shared/6p0hfupjin

I hope to improve the work with your comments and suggestions

and also post my progress on the mailing list in Spanish

I personally like ... obvious is my creation ha ha ha

notes:

* You can customize the color of the tabs
* The system is implemented within DIV
* takes into account padding


-- 
Díaz Luis
TSU Analisis de Sistemas
Universidad de Carabobo

http://web2pyfacil.blogspot.com/
Facultad de 
Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option=com_contentview=articleid=102Itemid=85


Re: [web2py] helper tabs

2010-12-17 Thread Bruno Rocha
I used in a different way of what you show in the app, and it works very
well!

In controller:

tabs =PEST([ ['Index', URL('default')] , ['Tab one',URL('tab1')] ])

return dict(tab=tab)

In view:

{{=tabs}}


I just suggest you:

Calling the class 'TAB' instead of 'PEST'.
Needs a way to output dynamic proper CSS
You can pack it as a plugin using plugin manager

I'll try it a little more in different kind of views, I'll give you feedback
about it.

Very Nice!  Thanks





-- 

Bruno Rocha
http://about.me/rochacbruno/bio


[web2py] Re: Run Web2py as a Service? on Ubuntu Lucid?

2010-12-17 Thread ghoulmann
Thanks so much for the reply. I did try both; retried them when I saw
your response. Both commands start web2py.py listening on :8000. SO,
it does work in these cases. Is there something I can try next?

On Dec 17, 6:34 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 did you try start it simply with

 python web2py.py -a password

 or

 nohup python web2py.py -a password 

 Does it work fine in these cases?

 On Dec 17, 4:59 pm, ghoulmann rikgold...@gmail.com wrote:

  I'm thankful this community is here. I'm working on a project for the
  Sahana-Eden team [1]. It calls for running web2py as a service. I was
  thankful to find documentation in the 3rd edition Official Web2py Book
  [2]. Sadly, when I follow the docs I can't get the service running. /
  etc/init.d/web2py start returns no errors; restart returns no errors,
  and status returns nothing. Netstat tells me the interface isn't
  listening on port 8000.

  I did use the scripts/web2py.ubuntu.sh script, and did as instructed
  in the documentation. I made changes to some of the paramaters near
  the top of the script; I've made it available as a pastebin [3].

  I've double-checked the daemon directory, and believe it to be
  correct. I have created web2py user with no password (using useradd);
  as web2py is new to me, I'm not sure that's necessary, but it has been
  done. Web2py has precisely the same mode as a working service (webmin
  in this case) and is owned root:root. Mode is rwxr-xr-x.

  I would be very grateful for any guidance, suggestions, improvements,
  encouragement you can offer.

  Ultimately, it's the high school students that have committed to the
  project that will benefit - I'm in unfamiliar territory and learning
  along with them.

  Rik

  [1]http://eden.sahanafoundation.org/wiki/BluePrintlivecdinstaller
  [2]http://web2py.com/book/default/chapter/11#Start-as-Linux-Daemon
  [3]http://pastebin.com/9Uz45k3G




[web2py] BUG on new DAL and _filter_fields?

2010-12-17 Thread Tito Garrido
When I try to create record that has an list:reference field I'm getting the
following error:

MODEL:
Field('troco_por', 'list:reference jogo', label='Troco por qualquer um
destes jogos', comment='Use a tecla Ctrl para selecionar mais de um jogo'),

CONTROLLER:
db.user_jogo.insert(**db.user_jogo._filter_fields(form.vars))


 File 
/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/applications/init/controllers/default.py
http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py,
line 103, in meus_jogos

form.vars.id = db.user_jogo.insert(**db.user_jogo._filter_fields(form.vars))

  File 
/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
line 3750, in insert

return self._db._adapter.insert(self,self._listify(fields))

  File 
/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
line 701, in insert

raise e
OperationalError: near ,: syntax error




And when I try to update:

db(db.user_jogo.id
==anuncio_id).update(**db.user_jogo._filter_fields(form.vars))

It raises an error:
  File
/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/applications/init/controllers/default.py,
line 127, in anunciar
form.vars.id = db(db.user_jogo.id
==anuncio_id).update(**db.user_jogo._filter_fields(form.vars))
  File
/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
line 4389, in update
return self.db._adapter.update(tablename,self.query,fields)
  File
/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
line 848, in update
self.execute(sql)
  File
/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
line 1055, in execute
return self.log_execute(*a, **b)
  File
/Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
line 1052, in log_execute
return self.cursor.execute(*a,**b)
OperationalError: near WHERE: syntax error


It was working before I update web2py... so probably something wrong on new
dal?

Regards,

Tito

-- 

Linux User #387870
.
 _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___


Re: [web2py] BUG on new DAL and _filter_fields?

2010-12-17 Thread Bruno Rocha
I ran with the same issue with the new dal.

https://groups.google.com/forum/#!topic/web2py-developers/RU5yUhu_2pU

Jus to to remember:
Also Virtual fields:
https://groups.google.com/forum/#!topic/web2py-developers/IPoWmlKoFOQ
And the load charts on applet:
https://groups.google.com/forum/#!topic/web2py-developers/eOW2wktnlsQ

2010/12/18 Tito Garrido titogarr...@gmail.com

 When I try to create record that has an list:reference field I'm getting
 the following error:

 MODEL:
 Field('troco_por', 'list:reference jogo', label='Troco por qualquer um
 destes jogos', comment='Use a tecla Ctrl para selecionar mais de um jogo'),

 CONTROLLER:
 db.user_jogo.insert(**db.user_jogo._filter_fields(form.vars))


  File 
 /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/applications/init/controllers/default.py
  http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py, line 
 103, in meus_jogos


 form.vars.id = 
 db.user_jogo.insert(**db.user_jogo._filter_fields(form.vars))


   File 
 /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py, 
 line 3750, in insert


 return self._db._adapter.insert(self,self._listify(fields))


   File 
 /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py, 
 line 701, in insert


 raise e
 OperationalError: near ,: syntax error




 And when I try to update:

 db(db.user_jogo.id
 ==anuncio_id).update(**db.user_jogo._filter_fields(form.vars))

 It raises an error:
   File
 /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/applications/init/controllers/default.py,
 line 127, in anunciar
 form.vars.id = db(db.user_jogo.id
 ==anuncio_id).update(**db.user_jogo._filter_fields(form.vars))
   File
 /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
 line 4389, in update
 return self.db._adapter.update(tablename,self.query,fields)
   File
 /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
 line 848, in update
 self.execute(sql)
   File
 /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
 line 1055, in execute
 return self.log_execute(*a, **b)
   File
 /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
 line 1052, in log_execute
 return self.cursor.execute(*a,**b)
 OperationalError: near WHERE: syntax error


 It was working before I update web2py... so probably something wrong on new
 dal?

 Regards,

 Tito

 --

 Linux User #387870
 .
  _/_õ|__|
 ..º[ .-.___.-._| . . . .
 .__( o)__( o).:___




-- 

Bruno Rocha
http://about.me/rochacbruno/bio


[web2py] Quick cron question

2010-12-17 Thread Thadeus Burgess
Do the models get executed before or after hard-cron process is started? And
are those models available to the scope of the cron application. In my
example cron would be executing a long-running controller function.

--
Thadeus


Re: [web2py] helper tabs

2010-12-17 Thread Luis Díaz
* very good perspective you used

* TAG is certainly easier to read than PEST
use PEST because my language is Spanish and use it asshorthand for 
PESTAÑA

* with respect to:
Needs a Proper way to output dynamic CSS
I do not understand, I could explain with an example?

* I do not like the plugin.
perhaps because I do not like plugin_wiki
I have not read about it, is like having a bad feeling and thenchoose to
avoid the issue
  ;)
(might change your mind)



2010/12/18 Bruno Rocha rochacbr...@gmail.com

 I used in a different way of what you show in the app, and it works very
 well!

 In controller:

 tabs =PEST([ ['Index', URL('default')] , ['Tab one',URL('tab1')] ])

 return dict(tab=tab)

 In view:

 {{=tabs}}


 I just suggest you:

 Calling the class 'TAB' instead of 'PEST'.
 Needs a way to output dynamic proper CSS
 You can pack it as a plugin using plugin manager

 I'll try it a little more in different kind of views, I'll give you
 feedback about it.

 Very Nice!  Thanks





 --

 Bruno Rocha
 http://about.me/rochacbruno/bio




-- 
Díaz Luis
TSU Analisis de Sistemas
Universidad de Carabobo

http://web2pyfacil.blogspot.com/
Facultad de 
Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option=com_contentview=articleid=102Itemid=85


[web2py] Re: Powertable remarks

2010-12-17 Thread mdipierro
Wifes are smarter than we are ready to admit.


On Dec 17, 8:04 pm, Bruno Rocha rochacbr...@gmail.com wrote:
 2010/12/17 Branko Vukelic branko.vuke...@gmx.com

  In other words, there's no silver bullet. ;)

 My wife just told me:
 Why are you so focused on these tables stuff, if
 already exists microsoft excel, and everybody uses it?

 LOL!

 --

 Bruno Rochahttp://about.me/rochacbruno/bio


[web2py] Re: BUG on new DAL and _filter_fields?

2010-12-17 Thread mdipierro
before

db.user_jogo.insert(**db.user_jogo._filter_fields(form.vars))

please add

print db.user_jogo._insert(**db.user_jogo._filter_fields(form.vars))

What does it print when the problem occurs?

On Dec 17, 11:14 pm, Bruno Rocha rochacbr...@gmail.com wrote:
 I ran with the same issue with the new dal.

 https://groups.google.com/forum/#!topic/web2py-developers/RU5yUhu_2pU

 Jus to to remember:
 Also Virtual 
 fields:https://groups.google.com/forum/#!topic/web2py-developers/IPoWmlKoFOQ
 And the load charts on 
 applet:https://groups.google.com/forum/#!topic/web2py-developers/eOW2wktnlsQ

 2010/12/18 Tito Garrido titogarr...@gmail.com



  When I try to create record that has an list:reference field I'm getting
  the following error:

  MODEL:
  Field('troco_por', 'list:reference jogo', label='Troco por qualquer um
  destes jogos', comment='Use a tecla Ctrl para selecionar mais de um jogo'),

  CONTROLLER:
  db.user_jogo.insert(**db.user_jogo._filter_fields(form.vars))

   File 
  /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/applications/init/controllers/default.py
   http://127.0.0.1:8000/admin/default/edit/init/controllers/default.py, 
  line 103, in meus_jogos

      form.vars.id = 
  db.user_jogo.insert(**db.user_jogo._filter_fields(form.vars))

    File 
  /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py, 
  line 3750, in insert

      return self._db._adapter.insert(self,self._listify(fields))

    File 
  /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py, 
  line 701, in insert

      raise e
  OperationalError: near ,: syntax error

  And when I try to update:

  db(db.user_jogo.id
  ==anuncio_id).update(**db.user_jogo._filter_fields(form.vars))

  It raises an error:
    File
  /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/applications/init/controllers/default.py,
  line 127, in anunciar
      form.vars.id = db(db.user_jogo.id
  ==anuncio_id).update(**db.user_jogo._filter_fields(form.vars))
    File
  /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
  line 4389, in update
      return self.db._adapter.update(tablename,self.query,fields)
    File
  /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
  line 848, in update
      self.execute(sql)
    File
  /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
  line 1055, in execute
      return self.log_execute(*a, **b)
    File
  /Users/titogarrido/Documents/Projetos/GAE/gametroca/web2py/gluon/dal.py,
  line 1052, in log_execute
      return self.cursor.execute(*a,**b)
  OperationalError: near WHERE: syntax error

  It was working before I update web2py... so probably something wrong on new
  dal?

  Regards,

  Tito

  --

  Linux User #387870
  .
   _/_õ|__|
  ..º[ .-.___.-._| . . . .
  .__( o)__( o).:___

 --

 Bruno Rochahttp://about.me/rochacbruno/bio


[web2py] Re: Quick cron question

2010-12-17 Thread mdipierro
cron just starts nwe web2py.py processes. Each cron task executes the
models.

If you are working on what I think you are working get rid of cron and
use a single background process that loops.

Massimo

On Dec 18, 12:27 am, Thadeus Burgess thade...@thadeusb.com wrote:
 Do the models get executed before or after hard-cron process is started? And
 are those models available to the scope of the cron application. In my
 example cron would be executing a long-running controller function.

 --
 Thadeus


Re: [web2py] Re: Quick cron question

2010-12-17 Thread Jonathan Lundell
On Dec 17, 2010, at 11:17 PM, mdipierro wrote:
 
 cron just starts nwe web2py.py processes. Each cron task executes the
 models.
 
 If you are working on what I think you are working get rid of cron and
 use a single background process that loops.

I was looking at the code, and have a question. When gluon.shell.run is invoked 
on behalf of a cron job, and it does

if f:
exec ('print %s()' % f, _env)

...what's the point of the print? What's stdout at this point?


 
 Massimo
 
 On Dec 18, 12:27 am, Thadeus Burgess thade...@thadeusb.com wrote:
 Do the models get executed before or after hard-cron process is started? And
 are those models available to the scope of the cron application. In my
 example cron would be executing a long-running controller function.
 




Re: [web2py] helper tabs

2010-12-17 Thread Luis Díaz
as recommended by a friend: Bruno Rocha

make some changes to the system tab

I get it link:

http://www.box.net/shared/6p0hfupjin

is the same but the file is new version


2010/12/18 Luis Díaz diazluis2...@gmail.com

 * very good perspective you used

 * TAG is certainly easier to read than PEST
 use PEST because my language is Spanish and use it asshorthand for 
 PESTAÑA

 * with respect to:
 Needs a Proper way to output dynamic CSS
 I do not understand, I could explain with an example?

 * I do not like the plugin.
 perhaps because I do not like plugin_wiki
 I have not read about it, is like having a bad feeling and thenchoose to
 avoid the issue
   ;)
 (might change your mind)



 2010/12/18 Bruno Rocha rochacbr...@gmail.com

 I used in a different way of what you show in the app, and it works very
 well!

 In controller:

 tabs =PEST([ ['Index', URL('default')] , ['Tab one',URL('tab1')] ])

 return dict(tab=tab)

 In view:

 {{=tabs}}


 I just suggest you:

 Calling the class 'TAB' instead of 'PEST'.
 Needs a way to output dynamic proper CSS
 You can pack it as a plugin using plugin manager

 I'll try it a little more in different kind of views, I'll give you
 feedback about it.

 Very Nice!  Thanks





 --

 Bruno Rocha
 http://about.me/rochacbruno/bio




 --
 Díaz Luis
 TSU Analisis de Sistemas
 Universidad de Carabobo

 http://web2pyfacil.blogspot.com/
 Facultad de 
 Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option=com_contentview=articleid=102Itemid=85




-- 
Díaz Luis
TSU Analisis de Sistemas
Universidad de Carabobo

http://web2pyfacil.blogspot.com/
Facultad de 
Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option=com_contentview=articleid=102Itemid=85