[web2py] Re: compute=lambda function

2010-09-25 Thread annet
Thanks for your reply. I tried: > > def mycompute(r): >     print 'In mycompute(r), r = ' + r >     return str(r['selector']) + ' ' + str(r['property']) > > db.define_table('css_selectorproperty', >     Field('selector',length=48,default='',notnull=True), >     Field('property',length=36,default='

[web2py] Re: import_from_csv_file looses reference, if it references the record it belongs to

2010-09-25 Thread mdipierro
This is a good idea. This could also be used to fix 'list:reference' On Sep 26, 1:26 am, Thadeus Burgess wrote: > Write a custom csv importer. use the code in gluon as an example for parsing. > > During the initial import, set the reference to None. While importing, > keep a dictionary in memory

Re: [web2py] Re: import_from_csv_file looses reference, if it references the record it belongs to

2010-09-25 Thread Thadeus Burgess
Write a custom csv importer. use the code in gluon as an example for parsing. During the initial import, set the reference to None. While importing, keep a dictionary in memory that can hold all needed references to a record. After import, commit, and then go through your dictionary fixing all of

[web2py] Re: new version of plugin_wiki is out!

2010-09-25 Thread mdipierro
I always recommend upgrading to the latest because so far I only fixed bugs and added feature but I make no promise that the plug-in will stay backward compatible (except for what explicitly described in the book). In fact I am thinking about some non-backward compatible changes in the near future

[web2py] Re: new version of plugin_wiki is out!

2010-09-25 Thread mart
Sounds great! Just one question though... I'm thinking upgrade paths, what happens when upgrading the plugin... I know I made some changes to the your wiki code on my mac (some good, and most probably bad ;)). The point is, I didn't document my changes (at least what I think were good changes for

[web2py] Re: GAE appstats problem in app.yaml

2010-09-25 Thread Scott
What version of the GAE development server are you using? On Sep 24, 5:55 am, mdmcginn wrote: > GAE appstats no longer works in app.yaml for 1.85.3 and some earlier > versions (at least using dev_appserver.py) > > This URL gets response code > 500:http://localhost:8080/_ah/login?continue=http://

[web2py] Re: bug in function ajax?

2010-09-25 Thread Jose
On 25 sep, 20:15, mdipierro wrote: > should be > > >     > > > Massimo Thank Massimo, Works halfway. In fact should be kept id = "id" Jose

[web2py] Re: @auth.requires(request.client=='127.0.0.1') doesn't work

2010-09-25 Thread mdipierro
I think I just fixed this in trunk. Please give it a try. Massimo On Sep 25, 6:24 pm, Jurgis Pralgauskis wrote: > hello, > I followed the example > fromhttp://web2py.com/book/default/chapter/08#Decorators > > @auth.requires(auth.user_id==1 or request.client=='127.0.0.1') > def function_six(): >

[web2py] Re: @auth.requires(request.client=='127.0.0.1') doesn't work

2010-09-25 Thread mdipierro
I On Sep 25, 6:24 pm, Jurgis Pralgauskis wrote: > hello, > I followed the example > fromhttp://web2py.com/book/default/chapter/08#Decorators > > @auth.requires(auth.user_id==1 or request.client=='127.0.0.1') > def function_six(): >     return 'you can read secret documents' > > but it doesn't wo

[web2py] Re: incorrect link path in GAE devserver terminal output

2010-09-25 Thread mdipierro
where? that is what it is in web2py. On Sep 25, 2:22 pm, Jurgis Pralgauskis wrote: > http://localhost:8080/stats/ > should probably behttp://localhost:8080/_ah/stats/ > > in > INFO     2010-09-25 19:01:17,653 recording.py:327] Saved; key: > __appstats__:074600, part: 160 bytes, full: 454797 bytes

[web2py] Re: import_from_csv_file looses reference, if it references the record it belongs to

2010-09-25 Thread mdipierro
There is no way to do this. When you import the first record, the second does not exist yet therefore the reference cannot be adjusted by web2py. This is why self references are never a good idea. Use a link table instead. On Sep 25, 2:19 pm, Jurgis Pralgauskis wrote: > Hello, > > I have Topics T

[web2py] Re: GAE appadmin weirdness

2010-09-25 Thread mdipierro
Should be Field('changed_fields', 'list:string', default=[], requires=IS_IN_SET(['explanation', 'output'],multiple=True) ), for multiple=True, IS_NOT_EMPTY is implicit and confuses web2py On Sep 25, 1:39 pm, Jurgis Pralgauskis wrote: > hello I get the same problem for list:string or list:i

[web2py] Re: new version of plugin_wiki is out!

2010-09-25 Thread mdipierro
No. The main changes are 1) you can set: plugins.wiki.widgets=['youtube','slideshow'] to limit the number of available widgets. plugins.wiki.widgets='all' for all. 2) you can pass a url to plugin_wiki.render to use a different URL. This is because I want to use the render function to ren

[web2py] @auth.requires(request.client=='127.0.0.1') doesn't work

2010-09-25 Thread Jurgis Pralgauskis
hello, I followed the example from http://web2py.com/book/default/chapter/08#Decorators @auth.requires(auth.user_id==1 or request.client=='127.0.0.1') def function_six(): return 'you can read secret documents' but it doesn't work -- it asks to login anyway. and just in case I tested with pin

Re: [web2py] new version of plugin_wiki is out!

2010-09-25 Thread Bruno Rocha
Is there a repository or another place where we can see the change log for plugin_wiki? I am going to try this now. Tks Massimo. 2010/9/25 mdipierro > fixed some bugs and made it more general. -- http://rochacbruno.com.br

[web2py] Re: bug in function ajax?

2010-09-25 Thread mdipierro
should be Massimo On Sep 25, 1:26 pm, Jose wrote: > Any changes in the function ajax of the application scaffold? > > The following code works in an old application > > >     > > > > {{for r in rows:}} >     >         {{=r.name}} >     > {{pass}} > > > > def bg_myfunction(): >

[web2py] new version of plugin_wiki is out!

2010-09-25 Thread mdipierro
fixed some bugs and made it more general.

[web2py] incorrect link path in GAE devserver terminal output

2010-09-25 Thread Jurgis Pralgauskis
http://localhost:8080/stats/ should probably be http://localhost:8080/_ah/stats/ in INFO 2010-09-25 19:01:17,653 recording.py:327] Saved; key: __appstats__:074600, part: 160 bytes, full: 454797 bytes, overhead: 0.084 + 0.415; link: http://localhost:8080/stats/details?time=1285441274663

[web2py] import_from_csv_file looses reference, if it references the record it belongs to

2010-09-25 Thread Jurgis Pralgauskis
Hello, I have Topics Tree like this db.define_table("Topics", Field("parent_id","reference Topics", label=T("Parent Topic"), #~ widget=my_hierarchical_options_widget, # probably overriden by requires requires=IS_EMPTY_OR(IS_IN_DB(db, 'Topics.id','Topics.n

[web2py] Re: Unable to debug this!-trying to use memcache on GAE

2010-09-25 Thread b vivek
Ok seems like I got it again is it not '_ah/queue/default'.. will have to got through the documentation of appengine I believe.. Sorry again for the trouble On Sun, Sep 26, 2010 at 12:23 AM, b vivek wrote: > Sorry for that but I was able to solve it. I had missed to create the db > instance. > B

[web2py] Re: Unable to debug this!-trying to use memcache on GAE

2010-09-25 Thread b vivek
Sorry for that but I was able to solve it. I had missed to create the db instance. By the way I needed a little understanding here. It talks about requesting a dummy url every 10 secs to keep the app fresh in cache. Digging into gaehandler.py leads me to believe that this is where the action takes

[web2py] GAE appadmin weirdness

2010-09-25 Thread Jurgis Pralgauskis
hello I get the same problem for list:string or list:integer on GAE using version 1.85.3 note: I think now, that the way I defined requires here is not needed, but anyway the errorreporting should handle it more fluently :) if from appadmin I try to insert recrod with Field('changed_fields', 'l

[web2py] Unable to debug this!-trying to use memcache on GAE

2010-09-25 Thread b vivek
So this is what I did:- 1. I decided to use mecache to store sessions and modified my db.py file as below:- if request.env.web2py_runtime_gae: from gluon.contrib.memdb import MEMDB from google.appengine.api.memcache import Client session.connect(request, response, db = MEMDB(Client()))

[web2py] bug in function ajax?

2010-09-25 Thread Jose
Any changes in the function ajax of the application scaffold? The following code works in an old application {{for r in rows:}} {{=r.name}} {{pass}} def bg_myfunction(): id = request.vars.id return id But in a new, created from the application of scaffolding

[web2py] bug in function ajax?

2010-09-25 Thread Jose
Any changes in the function ajax of the application scaffold? The following code works in an old application {{for r in rows:}} {{=r.name}} {{pass}} def bg_myfunction(): id = request.vars.id return id But in a new, created from the application of scaffolding

[web2py] Re: sql form data in hebrew

2010-09-25 Thread mdipierro
looks like a good fix. thanks. it is in trunk. On Sep 25, 11:42 am, Napoleon Moreno wrote: > Good day sir > > It works for me if i change in web2py/gluon/contrib/gql.py > > L617 > >     def __str__(self): >         return ' AND '.join([str(filter) for filter in self.filters]) > > for > >     def

[web2py] Re: Problem with rss feed from wiki application in book

2010-09-25 Thread mdipierro
it depends on the model. You must have wiki fields and your action must return record in the format described by the book in chapter 3. Massimo On Sep 25, 12:34 pm, Tom Atkins wrote: > I've just copied and pasted from the online book the wiki application in > chapter 3.  It all works great. > >

Re: [web2py] Problem with rss feed from wiki application in book

2010-09-25 Thread b vivek
Can I please have a look at your "news" action in the default controller On Sat, Sep 25, 2010 at 11:04 PM, Tom Atkins wrote: > I've just copied and pasted from the online book the wiki application in > chapter 3. It all works great. > > I've added the function for the rss feed to controlle

[web2py] Problem with rss feed from wiki application in book

2010-09-25 Thread Tom Atkins
I've just copied and pasted from the online book the wiki application in chapter 3. It all works great. I've added the function for the rss feed to controller/default.py and if I go to: http://127.0.0.1:8000/mywiki/default/news I get a nice page showing the wiki entries. However if I go to: h

[web2py] Re: JQuery plugin

2010-09-25 Thread Rick
Thanks for the suggestions. Now I consider this plugin: http://www.happyworm.com/jquery/jplayer/ On Sep 25, 3:33 am, Magnitus wrote: > Assuming that you know how to create sound effects in regular > Javascript, making your own pluggin for it doesn't seem that > difficult. > > Lets assume that you

Re: [web2py] Re: sql form data in hebrew

2010-09-25 Thread Napoleon Moreno
Good day sir It works for me if i change in web2py/gluon/contrib/gql.py L617 def __str__(self): return ' AND '.join([str(filter) for filter in self.filters]) for def __str__(self): return ' AND '.join([unicode(filter) for filter in self.filters]) Maybe that is not the

Re: [web2py] Re: db.table.truncate() does not reset the id

2010-09-25 Thread Johann Spies
Thanks. 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.                    

Re: [web2py] Re: sql form data in hebrew

2010-09-25 Thread Napoleon Moreno
I tried it It works well in sqllite In gae returns a ticket: Traceback (most recent call last): File "/home/napoleon/triviaapp/web2py/gluon/restricted.py", line 188, in restricted exec ccode in environment File "/home/napoleon/triviaapp/web2py/applications/welcome/controllers/default.py:

[web2py] Re: sql form data in hebrew

2010-09-25 Thread mdipierro
can you help us debug? Try db.category.name.requires = IS_NOT_IN_DB(db, 'category.name') On Sep 25, 8:37 am, Napoleon Moreno wrote: > Good day > > My dal was: > > db.define_table('category', >      Field('name','string'), >      format='%(name)s' > ) > > db.category.name.requires = IS_NOT_IN_DB

[web2py] Re: db.table.truncate() does not reset the id

2010-09-25 Thread mdipierro
1) after you define the table, db.table.drop() 2) run appadmin 3) remove the drop 4) re run appadmin there may be problems if the table is referenced On Sep 25, 5:06 am, Johann Spies wrote: > On 25 September 2010 06:45, mdipierro wrote: > > > It incorrect in the manual. > > It did work with ve

[web2py] Re: Store and retrieve blob

2010-09-25 Thread winti
I tried many different ways, but i ended with this. I checked also chapter 6.15 in the web2py manual and study the wiki example. If i upload a file manually and retrieve this i can download it without any issue. If i store the file in a blob field db.srattachments.file i am not able to retrieve the

[web2py] Re: Problem to deploy web2py in a Shared Hosting with web2py

2010-09-25 Thread mdipierro
I need the traceback from the apache log. It could be a path error or a permission error. I should say I have tested mod_python long ago but nobody uses it any more mod_python is no longer an active project. On Sep 25, 2:59 am, victors wrote: > Hi, > My hosting had mod_python, and i follow this(h

[web2py] Re: Format= ?

2010-09-25 Thread Johann Spies
represent=lambda id:db_auth_user(id).username does also not make a difference. 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

[web2py] Re: sql form data in hebrew

2010-09-25 Thread Napoleon Moreno
Good day My dal was: db.define_table('category', Field('name','string'), format='%(name)s' ) db.category.name.requires = IS_NOT_IN_DB(db, db.category.name) The error ocurrs in db.category.name.requires = IS_NOT_IN_DB(db, db.category.name). I removed this for the moment. Thanks for

[web2py] Format= ?

2010-09-25 Thread Johann Spies
Using the following in my tables: signature = db.Table(db, 'signature', Field('created_on', 'datetime', default=request.now,readable=True,writable=False), Field('created_by', db.auth_user, default=auth.user_id, readable=True,wri

[web2py] Solved -- Problems with special characters and pyfpdf

2010-09-25 Thread Bernardo
Hi all, When using pyfpdf which comes with web2py framework, there are some issues with special characters such as accented characters (á, é, í, ...). After some research, I found out that pyfpdf just understands 'iso-8859-1', and web2py gives him the strings in 'utf-8' format. So, as a solution,

[web2py] Re: compute=lambda function

2010-09-25 Thread cjrh
On Sep 25, 10:23 am, annet wrote: > compute=lambda r: str(r['selector']) + ' ' + str(r['property']) > > is syntactically incorrect. What is the correct syntax? The syntax of that command, on its own, is correct. Perhaps you can try dumping the contents of the argument to see whether it contains

[web2py] Image zoom from thumbnail, jQuery plugin recommendations?

2010-09-25 Thread cjrh
Hi Imagine you have a row of thumbnails in a page, and when the guest clicks on an image, a popup-like window is opened with a larger version of the image shown; what is the best or easiest method to do this in web2py, and does anyone perhaps have experience with one of the jQuery plugins listed

[web2py] decoding app engine

2010-09-25 Thread b vivek
Hii ! I just deployed an app on appspot, and I have a routes.py file which looks like this:- routes_in=(('/','/mysite/default/homepage'),) routes_out=(('/mysite/default/homepage','/'),) I have not rewritten any other paths. The site is working fine as of now but GAE's logs show an error like the

Re: [web2py] Re: db.table.truncate() does not reset the id

2010-09-25 Thread Johann Spies
On 25 September 2010 06:45, mdipierro wrote: > It incorrect in the manual. It did work with versions around the beginning of this year. So how do I reset the counter? Regards Johann --  May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord!  His divi

[web2py] compute=lambda function

2010-09-25 Thread annet
I defined the following table: db.define_table('css_selectorproperty', Field('selector',length=48,default='',notnull=True), Field('property',length=36,default='',notnull=True), Field('name',length=84,default='',notnull=True,compute=lambda r: str(r['selector']) + ' ' + str(r['property']

[web2py] Problem to deploy web2py in a Shared Hosting with web2py

2010-09-25 Thread victors
Hi, My hosting had mod_python, and i follow this(http://web2py.com/book/ default/chapter/11#Shared-Hosting-with-mod_python): " Place contents of web2py into the "htdocs" folder. In the web2py folder, create a file "web2py_modpython.py" file with the following contents: from mod_py

[web2py] Re: Question about CRUD forms and compute values

2010-09-25 Thread Bernardo
Hi Luis, those two fields are placed in the same table as the n_lote field. The funny point is that n_lote is stored correctly from the insert form generated by crud. The problem comes when I try to se the record from the database using crud with crud.read(). The n_lote field is not shown in that